optaplanner

OptaPlanner CVRPTW - solution with capacity issue

拥有回忆 提交于 2019-12-25 09:36:19
问题 I have the following CVRPTW problem and I'm trying to find a good solution with OptaPlanner. Time is in hh:mm:ss format. My DRL file is like this. Moreover I defined also a hard contraint relative to the arrival before ready time. My solver configuration is like this, with the difference of the termination tag: <termination> <terminationCompositionStyle>OR</terminationCompositionStyle> <maximumSecondsSpend>10</maximumSecondsSpend> <scoreAttained>0hard/-750000soft</scoreAttained> </termination

Deactivating optaplanner rule

隐身守侯 提交于 2019-12-25 09:33:49
问题 I have an optimisation problem which I am trying to solve with optaplanner. The solution algorithm uses a set of rules. The engine uses an object that captures the weight of each rule. The final score of a rule is an intermediate score of the rule multiplied with the weight. The score is set in the right hand side of every rule. The left hand side of every rule evaluates if its weight is not zero and only then executes the right hand side. Setting the weight of a rule to zero is a mechanism

OptaPlanner Nurse Rostering accumulate sum Null Pointer Exception

南楼画角 提交于 2019-12-25 09:10:06
问题 I try to modify the OptaPlanner nurse Roster example. So far, I want to write a rule in the drl file which reacts when an employee works more than 13 hours per day. I expanded the class shiftType to get hours per Shift. At first look, the rule seems to work but when there is no feasible solution after a while I get a NullPointerException. Here is some relevant code: rule "dailyRestPeriod" when ShiftAssignment($employee : employee, $shiftType : shiftType, $shiftDate : shiftDate, $employee!

Loading real world XML problems in OptaPlanner 6.1.0

感情迁移 提交于 2019-12-25 07:15:53
问题 I've been studying the OptaPlanner framwork for a bit and have found the CloudBalancingHelloWorld example fits a problem I'm tasked with fairly well - only it loads a fake generated problem set and I'd like to create my own XML file and load that instead ... but the docs seem a bit sparse on this subject, and I don't see any examples. The existing code in CloudBalancingHellowWorld.java is: // Load a problem with 400 computers and 1200 processes // This gets replaced with a class that loads a

Can optaplanner solve partly pre-assigned planning entities using Drools rules?

跟風遠走 提交于 2019-12-25 03:15:46
问题 We are using the time dependent vehicle routing problem example of Optaplanner 6.2. In our case the domain model consists of activities (corresponding to customers) and technicians (corresponding to vehicles). Is it possible to initialize an optimization with partly pre-assigned activities to certain technicians, whereby the rest of activities is not assigned? This would correspond to the case of optaplanner (cvrptw-case) when we stop the solving or wait for the solution, and then add at the

optaplanner: how to enforce planning variables values to be used only once

坚强是说给别人听的谎言 提交于 2019-12-24 15:40:28
问题 I am trying to learn optaplanner. And as a learning project I am trying to implement a very basic and simple program which calculates "magic squares". Basically I am trying to assign "Number"s to the "Box"es defined in rows and columns. Sorry for not copy/pasting directly from source code, my development machine can not connect to internet so I will try to write down important part of classes by hand. My domain structure is as follows: @PlanningSolution MagicSquareSolution //facts List<Column

Optaplanner: The selectionList contains 2 times the same selection

元气小坏坏 提交于 2019-12-24 13:59:37
问题 I am new to optplanner and playing around with using it to solve a timetabling problem however after all the setup, when I try to solve the problem, I get the following error: java.lang.IllegalStateException: The selectionList contains 2 times the same selection (c0001{t000}-0 @ null + null) and (c0001{t000}-1 @ null + null). at org.optaplanner.core.impl.heuristic.selector.common.decorator.WeightFactorySelectionSorter.sort(WeightFactorySelectionSorter.java:58) at org.optaplanner.core.impl

Exception after version upgrade

北慕城南 提交于 2019-12-24 02:45:15
问题 Having problem with Score persistance on a project using Optaplanner v7.11.0.Final, I upgraded to the latest one (v7.25.0.Final) but got the following exception : The externalObject (Etat(super=DbObject(id=11), libelle=RCD, ordre=60)) with planningId ((class plr.domain.Etat$HibernateProxy$EZnO4cSz,11)) has no known workingObject (null). Maybe the workingObject was never added because the planning solution doesn't have a @ProblemFactCollectionProperty annotation on a member with instances of

Optaplanner VRP remove customer from working solution

浪尽此生 提交于 2019-12-23 20:43:29
问题 Based on this example from cloud balancing problem, I'm trying to remove customer from a working solution as follows: Location toBeRemovedLocation = customerToBeRemoved.getLocation(); Location lookUpWorkingObject = (Location) scoreDirector.lookUpWorkingObject(toBeRemovedLocation); scoreDirector.beforeProblemFactRemoved(lookUpWorkingObject); routingSolution.getLocationList().remove(lookUpWorkingObject); scoreDirector.afterProblemFactRemoved(lookUpWorkingObject); Customer workingCustomer=

Problems with the solver configuration for two planning entity classes

倖福魔咒の 提交于 2019-12-23 18:29:47
问题 I'm working on a solution of a problem that is close to the Nurse Rostering Example in optaplanner . Employees are assigned to shifts as in the Nurse Roster but the main difference is that there are also skill requirements (assignments) that last lets say 20 minutes. An employee can be assigned to a skill requirement if he gets assigned to a shift that covers the given skill requirement time. Lets say we have a skill requirement for Skill1 from 12:00 to 12:20 and an employee is assigned on a