PathFinder.LOG.debug("{} is occupied by {}",this,train);
returnfalse;
returnfalse;
}
}
if(isSet(route)){
if(isSet(route)){
LOG.debug("{} is occupied by {}",this,route);
PathFinder.LOG.debug("{} is occupied by {}",this,route);
returnfalse;
returnfalse;
}
}
@ -132,26 +133,26 @@ public abstract class Tile extends BaseClass implements Comparable<Tile>{
if(isSet(train)){
if(isSet(train)){
booleanfree=train==context.train();// during train.reserveNext, we may encounter, parts, that are already reserved by the respective train, but having another route. do not compare routes in that case!
booleanfree=train==context.train();// during train.reserveNext, we may encounter, parts, that are already reserved by the respective train, but having another route. do not compare routes in that case!
if(free){
if(free){
LOG.debug("already reserved by {} → true",train);
PathFinder.LOG.debug("already reserved by {} → true",train);
}else{
}else{
LOG.debug("occupied by {} → false",train);
PathFinder.LOG.debug("occupied by {} → false",train);
}
}
returnfree;
returnfree;
}
}
// if we get here, the tile is not occupied by a train, but reserved by a route, yet. thus, the tile is not available for another route
// if we get here, the tile is not occupied by a train, but reserved by a route, yet. thus, the tile is not available for another route
if(isSet(route)&&route!=context.route()){
if(isSet(route)&&route!=context.route()){
LOG.debug("reserved by other route: {}",route);
PathFinder.LOG.debug("reserved by other route: {}",route);
if(isSet(route.train())){
if(isSet(route.train())){
if(route.train()==context.train()){
if(route.train()==context.train()){
LOG.debug("that route is used by {}, which is also requesting this tile → true",route.train());
PathFinder.LOG.debug("that route is used by {}, which is also requesting this tile → true",route.train());