optaplanner

Optaplanner remove customer from working VRP solution

旧巷老猫 提交于 2021-02-08 12:22:22
问题 Based on this question i tried the following: public void doFactChange() { Location toBeRemovedLocation = customerToBeRemoved.getLocation(); Location lookUpWorkingObject = (Location) scoreDirector.lookUpWorkingObject(toBeRemovedLocation); scoreDirector.beforeProblemFactRemoved(lookUpWorkingObject); routingSolution.getLocationList().remove(lookUpWorkingObject); scoreDirector.afterProblemFactRemoved(lookUpWorkingObject); Customer workingCustomer = (Customer) scoreDirector.lookUpWorkingObject

Optaplanner GroupBy with toList not working as expected

流过昼夜 提交于 2021-02-08 11:11:06
问题 I'd like to write a simple constraint for mandatory lunch breaks. I use the ConstraintCollector "toList" in my groupBy like so: public Constraint lunchBreak(ConstraintFactory constraintFactory) { return constraintFactory.from(TimetableEntry.class) .groupBy(TimetableEntry::getPlanningDay, TimetableEntry::getSchoolClass, toList()) .filter((day, schoolClass, entries) -> { if (entries.size() == 7) { List<TimetableEntry> freePeriods = entries.stream().filter( timetableEntry -> timetableEntry

Implementing a planning optimization algorithm on hierarchical problem

喜欢而已 提交于 2021-01-29 08:35:41
问题 I am working on a planning problem involving: a collection of planning entities each containing the planning variable A a global planning variable B (contained in the planning solution) Since I am a beginner with Optaplanner and planning optimization in general, I started on a simpler version problem, focusing on optimizing A with B modeled as a planning fact. Now that I have a program successfully optimizing A given B. I want to implement a new solver optimizing both A and B. It turns out

Nullable chained planning variable in Optaplanner

北战南征 提交于 2021-01-28 03:10:15
问题 So I am looking at modelling an overconstrained routing problem, where not all tasks have to be picked up in that specific planning problem. Rather the objective will be to maximise the tasks picked up in that planning problem. I was thinking this should be easy to achieve by allowing the planning variable to be nullable, but it seems that Optaplanner does not allow this on chained planning variables. So the workaround I am thinking about would be to devise a Dummy/Ghost vehicle for which the

Nullable chained planning variable in Optaplanner

此生再无相见时 提交于 2021-01-28 00:31:00
问题 So I am looking at modelling an overconstrained routing problem, where not all tasks have to be picked up in that specific planning problem. Rather the objective will be to maximise the tasks picked up in that planning problem. I was thinking this should be easy to achieve by allowing the planning variable to be nullable, but it seems that Optaplanner does not allow this on chained planning variables. So the workaround I am thinking about would be to devise a Dummy/Ghost vehicle for which the

No entityClass, and because there are multiple in the entityClassSet, it can not be deduced automatically

99封情书 提交于 2021-01-27 20:13:40
问题 I'm trying to implement a solution with multiple entity classes, and it fails with the following error message: no entityClass (null) configured and because there are multiple in the entityClassSet ([class com.myspace.wla.JobA, class com.myspace.wla.JobB]), it can not be deduced automatically This is the solver configuration: <?xml version="1.0" encoding="UTF-8"?> <solver xStreamId="1"> <solutionClass>com.myspace.wla.AllocationSolution</solutionClass> <entityClass>com.myspace.wla.JobA<

Employee schedule with individual and vairiable startdate for each employee

时光毁灭记忆、已成空白 提交于 2021-01-07 03:52:27
问题 When creating a schedule you have to abide by the law (hard requirement) that stipulates that as an employee you are only allowed to work a certain amount of hours per each given Sevenday period and you must . The reason that it does not say calendar week is to provide some wiggle room for the employer when creating the schedule (usually for 4-16 weeks ahead). Once your startdate for this planning period is set it cannot change until you want to do a complete replanning but then you need to