optaplanner

Drools collect list from object property

旧巷老猫 提交于 2020-06-17 15:51:03
问题 I have a student, who have list of courses. Also I have a lectures and I need to check that student courses list and list of courses of lectures that he visits are same I added rule for case, when student visits lecture, that he doesn't have in courses list: when $student:Student ($courses:courses) LectureAssignment(student == $student, course not memberOf $courses) then scoreHolder.addHardConstraintMatch(kcontext, -1); But I also need to check, that student visits all lecture, that he have

No static method metafactory (OptaPlanner)

丶灬走出姿态 提交于 2020-06-17 14:54:08
问题 Recently I added OptaPlanner dependency to my build.gradle in order to use the Vehicle Routing Problem of the Library. When I tried to use the solver I received the following error java.lang.NoSuchMethodError: No static method metafactory(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite; in class Ljava/lang/invoke/LambdaMetafactory; or its

What is the best practice for solving VRPMT problem with optaplanner?

自作多情 提交于 2020-02-02 12:52:26
问题 Our current approach is running solver many times. I am wondering if there is a better approach. Some explanation: Vehicle Routing Problem with Multiple Trips (VRPMT): The vehicles can do more than one route. 回答1: Take the VRP example, rename Vehicle to VehiclePerDay , then introduce 2 fields on it: the vehicle and the LocalDate. This is presuming one trip per day. If you do multiple trips on the same day, there are 2 approaches: 1) Split Vehicle into VehicleTrip as above and have them point

optaplanner - VRP but with no depot

风格不统一 提交于 2020-01-25 05:18:04
问题 i'm working with the Multiple Vehicles Route Problem. I'm trying Optaplanner and looks good and promising. I'm using the CVRP-32customers example, but I need to remove the "depots". I just need to optimize a route for some salesman, where they start is not an issue to me. I just need the best 10 routes to visit my 100 customers, does not matter where they start. I looked at this SO Question, but could not take anything from it to solve my problem. Can this be achieved with Optaplanner? Is

OptaPlanner: How to add a planning entity with ProblemFactChange

十年热恋 提交于 2020-01-07 05:34:09
问题 I have a long running solver that I wish to periodically update with new planning entities (incoming orders). Below is the sequence in the ProblemFactChange that I have pieced together. Is this the correct sequence? I could not find an example for this. solution = scoreDirector.getWorkingSolution(); scoreDirector.beforeEntityAdded(order); solution.getOrderList().add(order); scoreDirector.triggerVariableListeners(); scoreDirector.afterEntityAdded(order); 回答1: Yes, see also the new task