private void prepareNextLeg() { if (state == AT_THE_DEPARTURE_TRANSFER_TERMINAL) { state = ENTERING_THE_DEPARTURE_TERMINAL; zoneGeneral.setPassengerState(id, state); } randomSleep(100); // Wait until everyone is ready and leave zoneEnEx.goingHome(id); }
private void enterTheBus() { if (state == AT_THE_ARRIVAL_TRANSFER_TERMINAL) { state = TERMINAL_TRANSFER; zoneGeneral.setPassengerState(id, state); } randomSleep(100); // Wait for the bus to finish zoneTD.finishBusTrip(); leaveTheBus(); }
private void takeABus() { if (state == AT_THE_DISEMBARKING_ZONE) { state = AT_THE_ARRIVAL_TRANSFER_TERMINAL; zoneGeneral.setPassengerState(id, state); } randomSleep(100); // Get on the bus zoneTA.takeABus(id); enterTheBus(); }
private void goHome() { if (state == AT_THE_LUGGAGE_COLLECTION_POINT || state == AT_THE_BAGGAGE_RECLAIM_OFFICE || state == AT_THE_DISEMBARKING_ZONE) { state = EXITING_THE_ARRIVAL_TERMINAL; zoneGeneral.setPassengerState(id, state); } randomSleep(100); // Wait until everyone is ready and leave zoneEnEx.goingHome(id); }
private void reportMissingBags(int bags) { if (state == AT_THE_LUGGAGE_COLLECTION_POINT) { state = AT_THE_BAGGAGE_RECLAIM_OFFICE; zoneGeneral.setPassengerState(id, state); } randomSleep(100); // Report luggage missing zoneLug.reportLuggageMissing(bags); goHome(); }
private void leaveTheBus() { if (state == TERMINAL_TRANSFER) { state = AT_THE_DEPARTURE_TRANSFER_TERMINAL; zoneGeneral.setPassengerState(id, state); } randomSleep(100); // Leave the bus requestId++; zoneTD.leaveBus(id, requestId); prepareNextLeg(); }
private void goCollectABag() { if (state == AT_THE_DISEMBARKING_ZONE) { state = AT_THE_LUGGAGE_COLLECTION_POINT; zoneGeneral.setPassengerState(id, state); } randomSleep(100); // Pick up all his luggage luggageMissing -= zoneLug.getLuggage(id, luggageMissing); // If no lost bags if (luggageMissing == 0) { goHome(); } // If any bags lost else { reportMissingBags(luggageMissing); } }