Understanding the Drools planner examples: where is the problem state initialized?
-
30-10-2019 - |
Question
I am trying to understand the N Queens and Cloud Balancer examples of Drools. I delved into chapter 3 and 4 of the manual and the sources for the two examples.
I (mis)understand that
- The problem has to begin from an unassigned or unoptimal state
- So then, the problem facts and planning entities, which are POJOs, have to be instantiated
- The solution class, such as CloudBalance or NQueens have to be aware of the problem facts and planning entities
Question 1: In the examples, where are the objects of the planning entity and problem fact classes initialized?
For example, when I load the cloud balancing, I see this:
2012 .. INFO Loaded: data/cloudbalancing/unsolved/cb-0002comp-0006proc.xml
This means that a serialized format is converted to real objects and fed into a solution right?
Question 2: Where are the planning entities handled?
What is the meaning of that comment? How was that handled in the first place?
public Collection<? extends Object> getProblemFacts() {
List<Object> facts = new ArrayList<Object>();
facts.addAll(columnList);
facts.addAll(rowList);
// Do not add the planning entity's (queenList) because that will be done automatically
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow