Closed Pfizer-BradleyBare closed 1 year ago
Figured it out. Needed to add the following before the solve line.
import processscheduler as ps
# a simple problem, without horizon (solver will find it)
pb = ps.SchedulingProblem("HelloWorldProcessScheduler")
# add two tasks
task_world = ps.FixedDurationTask("World", duration=2, priority=3)
task_hello = ps.FixedDurationTask("Hello", duration=2, priority=2)
w = ps.Worker("Worker")
task_hello.add_required_resource(w)
task_world.add_required_resource(w)
# solve
pb.add_objective_priorities()
solver = ps.SchedulingSolver(pb)
solution = solver.solve()
# display solution, ascii or matplotlib gantt diagram
solution.render_gantt_matplotlib()
Added pb.add_objective_priorities()
Hi,
Great project! I am starting to implement priority and for some reason am having trouble. I've modified the example program to show my issue. I have added a worker then added a priority. For some reason my priority setting is not followed. What am I missing here?