drools-planner

Optaplanner: extending the vrp example to tackle multi trip case

天大地大妈咪最大 提交于 2020-01-04 05:26:17
问题 At my company we are currently using optaplanner to solve a vehicle routing problem with great results, we built a web app to manage vehicles, clientes, locations, depots and to show a graphic representation of the solution (including showing the locations in a map). We wrapped the solver in a spring java app with a rest interface to receive request and solve the problem. We are using Google maps to get distance-time data. Now we need to implement multirip.... To tackle the multitrip part I

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

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!

Setting global variables in working memory in Drools planner

孤人 提交于 2019-12-25 01:39:31
问题 How do I add a global variable to working memory in drools planner's solver to be able to use in scores drool. This is similar to https://issues.jboss.org/browse/JBRULES-2700 but couldn't find a solution though. 回答1: First some preaching: Using a service (set as a global) to calculate part of the score will break delta based score calculation (read the manual section on that topic), resulting in much less score calculations per second (say 50 instead of 5000 per second on big data sets). Then

Live rule creation in Drools Planner

試著忘記壹切 提交于 2019-12-24 14:37:05
问题 I am interested in creating rules for Drools Planner. I want that a user can create his own rules in a java app before starting the Drools Planner. Maybe a Drools-rule-file could be generated after the user has added his rules. Would this be possible or do I have to create the rule-file while developing the whole java application? Many thanks... 回答1: Yes it's possible. The trick is to build your own RuleBase and set it in the Planner config. See section "5.3.4.2.2. A RuleBase (possibly

Does OptaPlanner support optimizations and constraints on continuous variables?

喜你入骨 提交于 2019-12-23 10:26:14
问题 I'm reading contradictory things in the documentation. On one hand, this passage seems to indicate that continuous planning variables are possible: A planning value range is the set of possible planning values for a planning variable. This set can be a discrete (for example row 1, 2, 3 or 4) or continuous (for example any double between 0.0 and 1.0). On the other hand, when defining a Planning Variable, you must specify a ValueRangeProvider annotation on a field to use for the value set: The

OptaPlanner : ValueSelector can not use ValueRangeType.FROM_PLANNING_ENTITY_PROPERTY

≡放荡痞女 提交于 2019-12-20 06:57:41
问题 I am using MoveSelector configuration in the ConstructionHeuristic Phase. It works fine with configuring filterClass and comparatorClass in EntitySelector. However, in ValueSelector session, I am not able to use "ValueRangeType.FROM_PLANNING_ENTITY_PROPERTY" planning variable. It throws this exception: java.lang.IllegalArgumentException : The valueSelectorConfig (ValueSelectorConfig(row)) with resolvedCacheType (PHASE) and resolvedSelectionOrder (SORTED) needs to be based on a

Confused about naming of JavaBean properties, with respect to getters and setters

隐身守侯 提交于 2019-12-18 06:14:20
问题 I am making an application that uses Drools planner. The @ValueRangeFromSolutionProperty is supposed to refer to a property from another class ( NQueens in this case). From the JavaDocs for @ValueRangeFromSolutionProperty: propertyName The property name of which exists a getter on the Solution that returns a Collection. But I noticed an inconsistency : the annotator uses the property rowList from NQueens . But rowList (as opposed to RowList ) is a private variable (see snippets below). If it

Confused about naming of JavaBean properties, with respect to getters and setters

假如想象 提交于 2019-12-18 06:14:12
问题 I am making an application that uses Drools planner. The @ValueRangeFromSolutionProperty is supposed to refer to a property from another class ( NQueens in this case). From the JavaDocs for @ValueRangeFromSolutionProperty: propertyName The property name of which exists a getter on the Solution that returns a Collection. But I noticed an inconsistency : the annotator uses the property rowList from NQueens . But rowList (as opposed to RowList ) is a private variable (see snippets below). If it

how to keep track of planning variable assignment in optaplanner

江枫思渺然 提交于 2019-12-13 04:27:40
问题 Is there a way to access planning variable's assignment during planning? In my use case, I want to assign a planning variable with certain status only one time only during planning. After that I don't want to use that planning variable. I know that in optaplanner, a planning variable/problem fact can not change, so i can not change its status. Is there a way to get list of planning variable assignment during planning so that in java code or drools file, i can avoid re-assignment if it has