/** * If this method is called to update a changed ActivityEndTime please * ensure that the ActivityEndsList in the {@link QSim} is also updated. */ private final void calculateAndSetDepartureTime(Activity act) { PlansConfigGroup.ActivityDurationInterpretation activityDurationInterpretation = this.getScenario().getConfig().plans().getActivityDurationInterpretation(); double now = this.getSimTimer().getTimeOfDay() ; double departure = ActivityDurationUtils.calculateDepartureTime(act, now, activityDurationInterpretation); if ( this.getCurrentPlanElementIndex() == this.getCurrentPlan().getPlanElements().size()-1 ) { if ( finalActHasDpTimeWrnCnt < 1 && departure!=Double.POSITIVE_INFINITY ) { log.error( "last activity of person driver agent id " + this.getId() + " has end time < infty; setting it to infty") ; log.error( Gbl.ONLYONCE ) ; finalActHasDpTimeWrnCnt++ ; } departure = Double.POSITIVE_INFINITY ; } this.activityEndTime = departure ; }
double departureTime = ActivityDurationUtils.calculateDepartureTime(currentAct, getMessageArrivalTime(), activityDurationInterpretation) ;