Package org.matsim.analysis
Class CalcLegTimes
- java.lang.Object
-
- org.matsim.analysis.CalcLegTimes
-
- All Implemented Interfaces:
ActivityEndEventHandler
,ActivityStartEventHandler
,PersonArrivalEventHandler
,PersonDepartureEventHandler
,MatsimExtensionPoint
,EventHandler
public class CalcLegTimes extends Object implements PersonDepartureEventHandler, PersonArrivalEventHandler, ActivityEndEventHandler, ActivityStartEventHandler
- Author:
- mrieser Calculates the distribution of legs-durations, e.g. how many legs took at most 5 minutes, how many between 5 and 10 minutes, and so on. Also calculates the average trip duration. Trips ended because of vehicles being stuck are not counted.
-
-
Constructor Summary
Constructors Constructor Description CalcLegTimes()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getAverageTripDuration()
Map<String,int[]>
getLegStats()
static int
getTimeslotIndex(double time_s)
void
handleEvent(ActivityEndEvent event)
void
handleEvent(ActivityStartEvent event)
void
handleEvent(PersonArrivalEvent event)
void
handleEvent(PersonDepartureEvent event)
void
reset(int iteration)
Gives the event handler the possibility to clean up its internal state.void
writeStats(Writer out)
void
writeStats(String filename)
-
-
-
Constructor Detail
-
CalcLegTimes
public CalcLegTimes()
-
-
Method Detail
-
handleEvent
public void handleEvent(ActivityEndEvent event)
- Specified by:
handleEvent
in interfaceActivityEndEventHandler
-
handleEvent
public void handleEvent(PersonDepartureEvent event)
- Specified by:
handleEvent
in interfacePersonDepartureEventHandler
-
handleEvent
public void handleEvent(PersonArrivalEvent event)
- Specified by:
handleEvent
in interfacePersonArrivalEventHandler
-
handleEvent
public void handleEvent(ActivityStartEvent event)
- Specified by:
handleEvent
in interfaceActivityStartEventHandler
-
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.
-
getLegStats
public Map<String,int[]> getLegStats()
-
getTimeslotIndex
public static int getTimeslotIndex(double time_s)
-
getAverageTripDuration
public double getAverageTripDuration()
-
writeStats
public void writeStats(String filename)
-
writeStats
public void writeStats(Writer out) throws UncheckedIOException
- Throws:
UncheckedIOException
-
-