Search code examples
optaplannertimefold

OptaPlanner/TimeFold FULL_ASSERT vs NON_INTRUSIVE_FULL_ASSERT


I understand that FULL_ASSERT can call calculateScore() multiple times whereas NON_INTRUSIVE_FULL_ASSERT won't. Given that, why would I ever want to use FULL_ASSERT? Does it do more checking than NON_INTRUSIVE_FULL_ASSERT? Is it faster? The documentation doesn't make this clear.


Solution

  • FULL_ASSERT does more checks than NON_INTRUSIVE_FULL_ASSERT. In particular, it does both the intrusive FAST_ASSERT checks and the non-intrusive NON_INTRUSIVE_FULL_ASSERT checks. NON_INTRUSIVE_FULL_ASSERT does not do the intrusive FAST_ASSERT checks, because (as the name imply), all the checks it does are non-intrusive.

    As for what intrusive checks are, they check for variable listener corruption and score corruption, which require calculating the score multiple times (for instance, in FAST_ASSERT/FULL_ASSERT, it checks if the score after a undo move the same as the score before the move, which is assumed true in non-intrusive modes).