drools-planner

OptaPlanner vehicle routing and relations between customer visits

被刻印的时光 ゝ 提交于 2019-12-12 20:52:26
问题 I am using OptaPlanner to optimize a vehicle routing problem very similar to the provided example. I am faced with the following challenge and will appreciate some ideas. Some of the visits to customers have relations to other visits, for example: A visit must start at the same time with another visit. A visit must start 2 hours after another visit finishes. A visit must be allocated to the same vehicle allocated to another visit. The challenge is: How to allow moves of the visits without

OptaPlanner construction phase - Is there a way to define filters?

天大地大妈咪最大 提交于 2019-12-12 03:29:22
问题 In local search phase you can configure filters for entities, values and moves. You can even provide a custom move factory if you want. However, I can't find any documentation on how to do the same in construction phase. The only configuration is a heuristic type and forager: Chapter 8. Construction heuristics I want to implement some of my very hard rules in filters, however, without the ability to filter in construction phase I must also define them as scoring rules to avoid bad

drools rule get value from a map

自闭症网瘾萝莉.ら 提交于 2019-12-11 22:44:26
问题 How to get the perticular value in the drools when block. I am looking for something like this but its not working: I have inserted Hashmap into Working memory and trying to retrieve it in When $expiry_date:HashMap(get("CREDIT_CARD_EXPIRATION_DATE")); eval(ageInDays($expiry_date)>10) ; I get below error [42,37]: [ERR 101] Line 42:37 no viable alternative at input '"CREDIT_CARD_EXPIRATION_DATE"' in rule "Rule1" in pattern HashMap 回答1: For maps/lists/arrays, you can use [] syntax to access

How to solve many to many relationship using OptaPlanner?

旧城冷巷雨未停 提交于 2019-12-11 08:22:55
问题 How do we solve many to many problems using OptaPlanner 6? For example, in cloud balancing example, what do we need to do if we want to put each process on multiple computers/threads? More like parallel execution of the process. 回答1: The same way as you solve it if you want to store a many2many relationship in a relational database: create an extra Class. For example: In cloud balancing, create a class Assignment that has a many2one relationship to Process and a many2one relationship to

Drool rules using cron expression?

纵饮孤独 提交于 2019-12-11 01:17:35
问题 I have one requirement that i want to fire rule only for weekdays.i have some rule like smoke, temperature, motion.can you suggest me how i can make rule as per my requirement.please provide me some example. Is there any better way to fire rules based on time other then cron? 回答1: You can fire rule on weekdays or weekends , same requirement i have faced , found some solution. you just fallow steps: DRL File: package com.javacodegeeks.drools; import java.text.DateFormat; import java.text

Implementing Custom metaheuristic in OptaPlanner

帅比萌擦擦* 提交于 2019-12-10 10:54:07
问题 As of now Opta Planner planner provides support for: Tabu Search. Simulated Annealing. However if i need to implement any other algorithm like Genetic Algorithm with Opta Planner then where and how could it could be used. I have got the code of genetic algorithm, however i don't know how to integrate it with Opta planner. I found few places where it may be possible. Inside custom Score class. Inside custom Move class. Inside custom MoveFactory class. In the XML configuration file. Kindly

Retrieve drools working memory from Optaplanner solution

北城以北 提交于 2019-12-08 06:24:04
问题 When drl file used while solving constraints one could use insertLogical() which insert facts in drools working memory only and may not be retracted till completion of solution(LHS stay true forever for that insertLogical() ). When we get solution from Optaplanner's solver.solve() , we receive our own solution classes option like NurseRoster, CloudBalance. But how could I retrieve facts which stayed in Drools working memory till my solution stayed so I can see what caused solution? I'm

Implementing Custom metaheuristic in OptaPlanner

自闭症网瘾萝莉.ら 提交于 2019-12-06 13:18:27
As of now Opta Planner planner provides support for: Tabu Search. Simulated Annealing. However if i need to implement any other algorithm like Genetic Algorithm with Opta Planner then where and how could it could be used. I have got the code of genetic algorithm, however i don't know how to integrate it with Opta planner. I found few places where it may be possible. Inside custom Score class. Inside custom Move class. Inside custom MoveFactory class. In the XML configuration file. Kindly guide where i need to do the modification. Thanks Actually, a student (Sam Van Malderen) already forked

How do I use Drools Planner?

纵然是瞬间 提交于 2019-12-06 01:00:00
问题 I have a scheduling problem where each student expresses his preferences for a lecture and a course timetable is generated for all of the students at the same time (in a batch mode if I may). From what I read around and understand, Drools Planner is very well suited to solve this type of problem. I installed Drools and GEF into my Eclipse IDE. Everything loads just fine. Unfortunately, I can not figure out how to build a simple project. I looked online for references and found Drools Planner

How do I use Drools Planner?

老子叫甜甜 提交于 2019-12-04 06:14:05
I have a scheduling problem where each student expresses his preferences for a lecture and a course timetable is generated for all of the students at the same time (in a batch mode if I may). From what I read around and understand, Drools Planner is very well suited to solve this type of problem. I installed Drools and GEF into my Eclipse IDE. Everything loads just fine. Unfortunately, I can not figure out how to build a simple project. I looked online for references and found Drools Planner examples, which look and work great. However, I did not find any good tutorial that walks people