bugfixes, added debug output
This commit is contained in:
@@ -67,6 +67,7 @@ public class ActionList extends Action implements Iterable<Action>{
|
||||
}
|
||||
|
||||
public boolean fire(Context context) {
|
||||
LOG.debug("{}.fire({})",this,context);
|
||||
if (context.invalidated()) {
|
||||
LOG.debug("Context has been invalidated, aborting {}",this);
|
||||
return false;
|
||||
|
||||
@@ -25,7 +25,10 @@ public class PreserveRoute extends Action {
|
||||
if (train.destination() == route.endBlock()) return true;
|
||||
|
||||
Range waitTime = route.endBlock().getWaitTime(train,route.endDirection);
|
||||
if (waitTime.max > 0) return true; // train is expected to wait in next block.
|
||||
if (waitTime.max > 0) {
|
||||
LOG.debug("Not preserving route, as train needs to stop in following block!");
|
||||
return true; // train is expected to wait in next block.
|
||||
}
|
||||
|
||||
train.reserveNext();
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user