Understanding the Drools planner examples: where is the p‌r‌o‌b‌l‌e‌m state initialized?

StackOverflow https://stackoverflow.com/questions/8923851

  •  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

  1. The problem has to begin from an unassigned or unoptimal state
  2. So then, the problem facts and planning entities, which are POJOs, have to be instantiated
  3. 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
scroll top