descheduleStack.deschedule();
if (active) {
MDL2ePlan currentAtom = executionStack.pop();
if (currentAtom != null) {
if (currentAtom.checkInterrupt(time)) {
executionStack.push(currentAtom);
currentAtom.execute(time);
return;
} else { // currentAtom.checkInterrupt(time) == false
//queue for deschedule
descheduleStack.push(currentAtom);
//currentAtom.deschedule();
while ((currentAtom = executionStack.pop()) != null) {
MDL2ePlan schedulable = currentAtom.getSchedulable(
time, executionStack);
// schedulable atom found, its already on stack
if (schedulable != null) {
//if(schedulable.name.equals("MOVE")) System.out.println(schedulable);
schedulable.execute(time);
return;
}
// currentAtom has no schedulable children -->
// queue for deschedule
descheduleStack.push(currentAtom);