Commit 16e0e8bf authored by Jakob Schöttl's avatar Jakob Schöttl
Browse files

Add and fix debug logs

parent b541b111
......@@ -111,7 +111,7 @@ public class SeatingModel implements ActiveCallback, Model {
private void assignSeatTarget(Pedestrian p) {
final Compartment compartment = trainModel.getCompartment(p);
if (compartment.isFull()) {
logDebug("Compartment %d is full. No seat available for pedestrian %d.",
logDebug("Compartment %d is full. No seat available for pedestrian %d. Proceeding to next compartment.",
compartment.getIndex(), p.getId());
proceedToNextCompartmentIfPossible(p);
return;
......@@ -320,6 +320,10 @@ public class SeatingModel implements ActiveCallback, Model {
private final TargetListener seatTargetListener = new TargetListener() {
@Override
public void reachedTarget(Target target, Agent agent) {
final Seat seat = trainModel.getSeatForTarget(target);
logDebug("Pedestrian %d reached seat %d.%d (%d)", agent.getId(),
seat.getSeatGroup().getCompartment().getIndex(), seat.getSeatNumberWithinCompartment(),
target.getId());
sitDownIfPossible((Pedestrian) agent, trainModel.getSeatForTarget(target));
}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment