[rules-users] [planner] getBestSolution not returning the correct Solution?

Geoffrey De Smet ge0ffrey.spam at gmail.com
Fri Jun 15 02:36:27 EDT 2012


> 2. Question about the cloneSolution.
>
> I have 3 properties in my Solution implementation.
> ArrayList<Material>  materials; // Problem Facts
> ArrayList<ServiceRequest>  serviceRequests;  // Planning Entities
> SimpleScore score;
>
> In example, I noticed that Planning Entity is cloned but Problem Facts is
> not cloned.
> Why problem facts not cloned?
It's a waste of performance time: they don't change during planning.
Only entity classes changes during planning.
The clone() method is called every time a new best solution is found (to 
recall it later while the workingSolution proceeds).

This works even in the face of real-time planning, where the problem 
facts look like they change during planning,
but actually the problem facts only change "in between" planning, not 
during.

-- 
With kind regards,
Geoffrey De Smet




More information about the rules-users mailing list