currentPhaseDuration = 0; // reset
setNextPhaseIndex();
}
private void determinePhase() {
Phase phase = phases.get(currentPhaseIndex);
// first check if all "clear" conditions are fullfilled.
// then check fixed-time schedule for next phase
// and last check trigger condition for overriding fixed-time scheduler
if (isClearConditionsFullfilled(phase)
&& (currentPhaseDuration > phase.getDuration() || isTriggerConditionFullfilled(phase))) {
nextPhase();
}
}