How to develope an efficent job scheduling with constraints??
The scheduler should include these methods:
startBeforeEndOf(Job j)
startAfterEndOf(Job j)
startBeforeStartOf(Job j)
startAfterStartOf(Job j)
endBeforeEndOf(Job j)
endAfterEndOf(Job j)
endBeforeStartOf(Job j)
endAfterStartOf(Job j)
Every job has an id and the time parameter.
A possible solution for this matter, may be based on technical backtracking. The jobs are used as choice points, and temporal instants as choices (in the worst case the total duration of the activity is the sum of the durations of the work, resulting in a fully sequential execution).
Alternatively I should adequately represent the data and then generates a scheduling on the time axis, placing the work under the constraints and moving forward in a job (and all the jobs that depend on it) when a constraint is not satisfied.
But I don’t know how exactly I can do this in java.
In other words I looking for a way to avoiding the intense backtracking approach, in the job management described.
Try OptaPlanner (java, open source). There is a quick start here.
For example, assign each
Jobto astartMinute, then add score rules like: