[rules-users] SelectionFilter<ChangeMove> question

Geoffrey De Smet ge0ffrey.spam at gmail.com
Mon Jun 23 03:22:53 EDT 2014


On 16-06-14 13:46, dBijkoo wrote:
> i have a class ChangeMoveFilter which implements
> SelectionFilter<ChangeMoveSelector> to sort out moves that break hard
> constraints.
>
> In the config it looks like this
>      <constructionHeuristic>
>          <queuedEntityPlacer>
>              <entitySelector id="placerEntitySelector">
>                  <cacheType>PHASE</cacheType>
>              </entitySelector>
>              <changeMoveSelector>
>                  *<filterClass>solver.move.ChangeMoveFilter</filterClass>*
>                  <entitySelector mimicSelectorRef="placerEntitySelector"/>
>                  <valueSelector>
>                      <cacheType>PHASE</cacheType>
>                  </valueSelector>
>              </changeMoveSelector>
>          </queuedEntityPlacer>
>      </constructionHeuristic>
>
> However I am getting the impression that the overridden accept function is
> called before anything changed in the entity. Because the (only)
> planningvariable of the entity is still null, which would never be able to
> happen in my understanding.

The CH (construction heursistics) start from an uninitialized solution 
(usually),
so all variables start out as null. This means, for example on the cloud 
balancing example:

ChangeMove.getEntity() is NOT null and an instance of Process
((Process) ChangeMove.getEntity()).getComputer() is null
ChangeMove.getToPlanningValue() is NOT null and an instance of Computer

HTH

>
> Am i missing something or is the filter move called before anything changes
> in the given entity?
>
>
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/SelectionFilter-ChangeMove-question-tp4030063.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>




More information about the rules-users mailing list