コード例 #1
0
  public static double getSearchTime(AgentWithParking aem, Id parkingId) {
    Link currentLink = aem.getCurrentLink();
    double travelTime =
        ZHScenarioGlobal.ttMatrix.getTravelTime(aem.getMessageArrivalTime(), currentLink.getId());
    double speed = currentLink.getLength() / travelTime;

    Id linkOfParking = AgentWithParking.parkingManager.getLinkOfParking(parkingId);
    double distance =
        GeneralLib.getDistance(
            ZHScenarioGlobal.scenario.getNetwork().getLinks().get(linkOfParking).getCoord(),
            currentLink.getCoord());

    double searchTime =
        distance / speed * ZHScenarioGlobal.loadDoubleParam("Dummy_SearchTimeFactor");
    return searchTime;
  }
コード例 #2
0
  public void parkVehicleAndLogSearchTime(AgentWithParking aem, Id personId, Id parkingId) {
    double searchTime = getSearchTime(aem, parkingId);
    triggerSeachTimeStart(personId, aem.getMessageArrivalTime() - searchTime);

    parkVehicle(aem, parkingId);
  }