@Override public Person getPerson() { return ((HasPerson) delegate).getPerson(); }
private void addAgent(MobsimAgent mobsimAgent, double now) { Map<String, TravelTime> multiModalTravelTime = this.simEngine.getMultiModalTravelTimes(); Person person = null; if (mobsimAgent instanceof HasPerson) { person = ((HasPerson) mobsimAgent).getPerson(); } double travelTime = multiModalTravelTime.get(mobsimAgent.getMode()).getLinkTravelTime(link, now, person, null); double departureTime = now + travelTime; departureTime = Math.round(departureTime); this.agents.add(new Tuple<>(departureTime, mobsimAgent)); }
@Deprecated // yyyy but I don't have an easy replacement yet // (maybe just editTrips.replanCurrentTrip(...)?) protected final void reRouteCurrentLeg( MobsimAgent agent, double now ) { Plan plan = WithinDayAgentUtils.getModifiablePlan(agent) ; PlanElement pe = plan.getPlanElements().get( WithinDayAgentUtils.getCurrentPlanElementIndex(agent)) ; if ( !(pe instanceof Leg) ) { return ; } int currentLinkIndex = WithinDayAgentUtils.getCurrentRouteLinkIdIndex(agent) ; this.editRoutes.replanCurrentLegRoute((Leg)pe, ((HasPerson)agent).getPerson(), currentLinkIndex, now ) ; WithinDayAgentUtils.resetCaches(agent); } @Deprecated // I don't think that this is really needed for the bushfire applications. kai, nov'17
@Override public boolean handleActivity(MobsimAgent agent) { // We expect all the agents to appear here at the beginning of the simulation (starting their // overnight activity.) That's when we enter them into JDEQSim and never let them out. new Vehicle(scheduler, ((HasPerson) agent).getPerson(), scenario.getConfig().plans().getActivityDurationInterpretation()); numberOfAgents++; return true; }
public final void replanCurrentLeg( MobsimAgent agent, double now ) { Plan plan = WithinDayAgentUtils.getModifiablePlan(agent) ; PlanElement pe = plan.getPlanElements().get( WithinDayAgentUtils.getCurrentPlanElementIndex(agent)) ; if ( !(pe instanceof Leg) ) { return ; } int currentLinkIndex = WithinDayAgentUtils.getCurrentRouteLinkIdIndex(agent) ; this.replanCurrentLegRoute((Leg)pe, ((HasPerson)agent).getPerson(), currentLinkIndex, now ) ; WithinDayAgentUtils.resetCaches(agent); }