0

My planning variable is Boolean.

I want to use changeMoves only, and I want to use a cartesian product of changeMove to have a coarser move. This is in my planner config:

    <unionMoveSelector>
        <changeMoveSelector/>
        <cartesianProductMoveSelector>
            <changeMoveSelector/>
            <changeMoveSelector/>
            <changeMoveSelector/>
            <changeMoveSelector/>
            <changeMoveSelector/>
        </cartesianProductMoveSelector>
    </unionMoveSelector>        

How can I avoid to have "move not doable" half of the time?

At the moment, I often have for example:

Move index (5) not doable, ignoring move (... {false -> false})

Basically, I want a move that consists of switching the boolean state, which is always doable (false becomes true and true becomes false).

This is even worse for cartesian products of changeMoves, since I assume the move is ignored when one of the changeMove is not doable... So with n changeMoves, I have only a 1/2^n chance of getting a doable cartesian...

Do I have to create a custom move or is there any other way to do this?

asachet
  • 6,620
  • 2
  • 30
  • 74
  • This might be [a small design flaw](https://issues.jboss.org/browse/PLANNER-589). Currently, isDoable is not handled as a move filter (and I intend to change that at some point in the long-term future if possible). If it were, it would be more efficient. – Geoffrey De Smet Jun 03 '16 at 07:52

1 Answers1

0

Workaround (untested - let me know here if it works): On the <changeMoveSelector/> add a MoveFilter to filter the non doable moves. That way they won't get into the cartesian selector, which might improve your efficiency.

If this workaround works, it's also a proof on how we should fix PLANNER-589 upstream.

Geoffrey De Smet
  • 26,223
  • 11
  • 73
  • 120
  • Thanks, I will try when I have the chance. For now I have implemented a custom "FlipMove" which reverse the boolean value and is always accepted. – asachet Jun 03 '16 at 09:17
  • Intresting. Do try it and let me know - I 'd be interested if that filter makes a big difference in your use case, as it would make an argument to refactor isDoable accordingly. – Geoffrey De Smet Jun 03 '16 at 09:43