Class LinkReplanningMap
- java.lang.Object
-
- org.matsim.withinday.replanning.identifiers.tools.LinkReplanningMap
-
- All Implemented Interfaces:
EventListener
,ActivityEndEventHandler
,ActivityStartEventHandler
,PersonStuckEventHandler
,MatsimExtensionPoint
,EventHandler
,MobsimAfterSimStepListener
,MobsimListener
,QSimComponent
public class LinkReplanningMap extends Object implements PersonStuckEventHandler, ActivityStartEventHandler, ActivityEndEventHandler, MobsimAfterSimStepListener
This Module is used by a CurrentLegReplanner. It calculates the time when an agent should do CurrentLegReplanning. The time is estimated as following: When a LinkEnterEvent is thrown the Replanning Time is set to the current time + the FreeSpeed Travel Time. This guarantees that the replanning will be done while the agent is on the Link. After that time, the agent might be already in the outgoing queue of a QLink where not all replanning operations are possible anymore (the agent can e.g. not insert an Activity on its current link anymore).The replanning interval (multiple replannings on the same link when an agent is stuck on a link due to a traffic jam) has been removed since it cannot be guaranteed that all replanning operations are valid anymore.
- Author:
- cdobler
-
-
Constructor Summary
Constructors Constructor Description LinkReplanningMap(EarliestLinkExitTimeProvider earliestLinkExitTimeProvider, EventsManager eventsManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Id<Person>>
getLegPerformingAgents()
Set<Id<Person>>
getLegStartedAgents()
Set<Id<Person>>
getReplanningAgents(double time)
Set<Id<Person>>
getRestrictedReplanningAgents(double time)
Set<Id<Person>>
getUnrestrictedReplanningAgents(double time)
void
handleEvent(ActivityEndEvent event)
void
handleEvent(ActivityStartEvent event)
void
handleEvent(PersonStuckEvent event)
void
notifyMobsimAfterSimStep(MobsimAfterSimStepEvent e)
void
reset(int iteration)
Gives the event handler the possibility to clean up its internal state.
-
-
-
Constructor Detail
-
LinkReplanningMap
@Inject public LinkReplanningMap(EarliestLinkExitTimeProvider earliestLinkExitTimeProvider, EventsManager eventsManager)
-
-
Method Detail
-
handleEvent
public void handleEvent(PersonStuckEvent event)
- Specified by:
handleEvent
in interfacePersonStuckEventHandler
-
handleEvent
public void handleEvent(ActivityEndEvent event)
- Specified by:
handleEvent
in interfaceActivityEndEventHandler
-
handleEvent
public void handleEvent(ActivityStartEvent event)
- Specified by:
handleEvent
in interfaceActivityStartEventHandler
-
notifyMobsimAfterSimStep
public void notifyMobsimAfterSimStep(MobsimAfterSimStepEvent e)
- Specified by:
notifyMobsimAfterSimStep
in interfaceMobsimAfterSimStepListener
-
reset
public void reset(int iteration)
Description copied from interface:EventHandler
Gives the event handler the possibility to clean up its internal state. Within a Controler-Simulation, this is called before the mobsim starts.- Specified by:
reset
in interfaceEventHandler
- Parameters:
iteration
- the up-coming iteration from which up-coming events will be from.
-
getReplanningAgents
public Set<Id<Person>> getReplanningAgents(double time)
- Parameters:
time
-- Returns:
- a list of agents who might need a replanning
-
getUnrestrictedReplanningAgents
public Set<Id<Person>> getUnrestrictedReplanningAgents(double time)
- Parameters:
time
-- Returns:
- a list of agents who might need an unrestricted replanning and use the given transport mode
-
getRestrictedReplanningAgents
public Set<Id<Person>> getRestrictedReplanningAgents(double time)
- Parameters:
time
-- Returns:
- a list of agents who might need a restricted replanning and use the given transport mode
-
getLegPerformingAgents
public Set<Id<Person>> getLegPerformingAgents()
- Returns:
- A list of all agents that are currently performing a leg. Note that some of them might be limited in the available replanning operations!
-
getLegStartedAgents
public Set<Id<Person>> getLegStartedAgents()
- Returns:
- A list of all agents that have just started a leg. Note that they cannot end their leg on their current link!
-
-