예제 #1
0
  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);
  }
예제 #2
0
  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();
  }
예제 #3
0
  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();
  }
예제 #4
0
  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);
  }
예제 #5
0
  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();
  }
예제 #6
0
  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();
  }
예제 #7
0
  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);
    }
  }