I don't know a lot about Java Streams, I'm learning about it right now but I'm trying to solve this problem if anyone has advice:
Say I'm doing job scheduling, and each job has a width X. When we do a new job with a different width, the machine has to be reconfigured, so we prefer to do all jobs of width X in a row. I'm trying to set up a soft score penalty if the next job in the queue has a different width.
private Constraint customConstraint(ConstraintFactory constraintFactory) {
return constraintFactory.forEach(Job.class)
//filter down to jobs whose next job has a different width
.penalize(HardSoftScore.ONE_SOFT)
.asConstraint("Width change");
}
Or, if we use the hello world quickstart as an example, a penalty for when a teacher has to change rooms. Does anyone have advice? Thank you.