Package org.matsim.pt.counts
Class OccupancyAnalyzer
- java.lang.Object
-
- org.matsim.pt.counts.OccupancyAnalyzer
-
- All Implemented Interfaces:
PersonEntersVehicleEventHandler
,PersonLeavesVehicleEventHandler
,TransitDriverStartsEventHandler
,VehicleArrivesAtFacilityEventHandler
,VehicleDepartsAtFacilityEventHandler
,MatsimExtensionPoint
,EventHandler
public class OccupancyAnalyzer extends Object implements PersonEntersVehicleEventHandler, PersonLeavesVehicleEventHandler, VehicleArrivesAtFacilityEventHandler, VehicleDepartsAtFacilityEventHandler, TransitDriverStartsEventHandler
- Author:
- yChen, mrieser / senozon
-
-
Constructor Summary
Constructors Constructor Description OccupancyAnalyzer(int timeBinSize, double maxTime)
-
Method Summary
-
-
-
Constructor Detail
-
OccupancyAnalyzer
public OccupancyAnalyzer(int timeBinSize, double maxTime)
-
-
Method Detail
-
setBoards
public void setBoards(Map<Id<TransitStopFacility>,int[]> boards)
-
setAlights
public void setAlights(Map<Id<TransitStopFacility>,int[]> alights)
-
setOccupancies
public void setOccupancies(Map<Id<TransitStopFacility>,int[]> occupancies)
-
getTimeSlotIndex
public int getTimeSlotIndex(double time)
-
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.
-
handleEvent
public void handleEvent(TransitDriverStartsEvent event)
- Specified by:
handleEvent
in interfaceTransitDriverStartsEventHandler
-
handleEvent
public void handleEvent(PersonEntersVehicleEvent event)
- Specified by:
handleEvent
in interfacePersonEntersVehicleEventHandler
-
handleEvent
public void handleEvent(PersonLeavesVehicleEvent event)
- Specified by:
handleEvent
in interfacePersonLeavesVehicleEventHandler
-
handleEvent
public void handleEvent(VehicleArrivesAtFacilityEvent event)
- Specified by:
handleEvent
in interfaceVehicleArrivesAtFacilityEventHandler
-
handleEvent
public void handleEvent(VehicleDepartsAtFacilityEvent event)
- Specified by:
handleEvent
in interfaceVehicleDepartsAtFacilityEventHandler
-
getBoardVolumesForStop
public int[] getBoardVolumesForStop(Id<TransitStopFacility> stopId)
- Parameters:
stopId
-- Returns:
- Array containing the number of agents boarding at the stop
stopId
per time bin, starting with time bin 0 from 0 seconds to (timeBinSize-1)seconds.
-
getAlightVolumesForStop
public int[] getAlightVolumesForStop(Id<TransitStopFacility> stopId)
- Parameters:
stopId
-- Returns:
- Array containing the number of agents alighting at the stop
stopId
per time bin, starting with time bin 0 from 0 seconds to (timeBinSize-1)seconds.
-
getOccupancyVolumesForStop
public int[] getOccupancyVolumesForStop(Id<TransitStopFacility> stopId)
- Parameters:
stopId
-- Returns:
- Array containing the number of passengers in bus after the
transfer at the stop
stopId
per time bin, starting with time bin 0 from 0 seconds to (timeBinSize-1)seconds.
-
getBoardStopIds
public Set<Id<TransitStopFacility>> getBoardStopIds()
- Returns:
- Set of
Id
s containing all stop ids, where the agents boarded, for which counting-values are available.
-
getAlightStopIds
public Set<Id<TransitStopFacility>> getAlightStopIds()
- Returns:
- Set of
Id
s containing all stop ids, where the agents alit, for which counting-values are available.
-
getOccupancyStopIds
public Set<Id<TransitStopFacility>> getOccupancyStopIds()
-
getAllStopIds
public Set<Id<TransitStopFacility>> getAllStopIds()
- Returns:
- Set of
Id
s containing all stop ids, where the agents alit or/and boarded, for which counting-values are available.
-
-