@Override public final Id<TransitStopFacility> getDesiredAccessStopId() { return transitAgentDelegate.getDesiredAccessStopId(); } @Override
@Override public final Id<TransitStopFacility> getDesiredDestinationStopId() { return transitAgentDelegate.getDesiredDestinationStopId(); }
@Override public final boolean getEnterTransitRoute(TransitLine line, TransitRoute transitRoute, List<TransitRouteStop> stopsToCome, TransitVehicle transitVehicle) { return transitAgentDelegate.getEnterTransitRoute(line, transitRoute, stopsToCome, transitVehicle); } @Override
@Override public final boolean getExitAtStop(TransitStopFacility stop) { return transitAgentDelegate.getExitAtStop(stop); } @Override
@Override public final double getWeight() { return transitAgentDelegate.getWeight(); } @Override
@Override public final boolean getEnterTransitRoute(final TransitLine line, final TransitRoute transitRoute, final List<TransitRouteStop> stopsToCome, TransitVehicle transitVehicle) { ExperimentalTransitRoute route = (ExperimentalTransitRoute) basicAgentDelegate.getCurrentLeg().getRoute(); switch ( boardingAcceptance ) { case checkLineAndStop: return line.getId().equals(route.getLineId()) && containsId(stopsToCome, route.getEgressStopId()); case checkStopOnly: return containsId(stopsToCome, route.getEgressStopId()); default: throw new RuntimeException("not implemented"); } }
@Override public final Id<TransitStopFacility> getDesiredAccessStopId() { Leg leg = basicAgentDelegate.getCurrentLeg(); if (!(leg.getRoute() instanceof ExperimentalTransitRoute)) { log.error("pt-leg has no TransitRoute. Removing agent from simulation. Agent " + getId().toString()); log.info("route: " + leg.getRoute().getClass().getCanonicalName() + " " + leg.getRoute().getRouteDescription()); return null; } else { ExperimentalTransitRoute route = (ExperimentalTransitRoute) leg.getRoute(); Id<TransitStopFacility> accessStopId = route.getAccessStopId(); return accessStopId; } }
private TransitAgent(final Person p, final Netsim simulation) { basicAgentDelegate = new BasicPlanAgentImpl( p.getSelectedPlan(), simulation.getScenario(), simulation.getEventsManager(), simulation.getSimTimer() ) ; driverAgentDelegate = new PlanBasedDriverAgentImpl( basicAgentDelegate ) ; transitAgentDelegate = new TransitAgentImpl( basicAgentDelegate, simulation.getScenario().getConfig().transit().getBoardingAcceptance() ); }