MATSIM
SimpleTransitStopHandler.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * *
4  * *********************************************************************** *
5  * *
6  * copyright : (C) 2010 by the members listed in the COPYING, *
7  * LICENSE and WARRANTY file. *
8  * email : info at matsim dot org *
9  * *
10  * *********************************************************************** *
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * See also COPYING, LICENSE and WARRANTY file *
17  * *
18  * *********************************************************************** */
19 
20 package org.matsim.core.mobsim.qsim.pt;
21 
22 import java.util.List;
23 
26 
31 
33 
35  }
36 
37  @Override
38  public double handleTransitStop(TransitStopFacility stop, double now, List<PTPassengerAgent> leavingPassengers,
39  List<PTPassengerAgent> enteringPassengers, PassengerAccessEgress accessEgress, MobsimVehicle vehicle) {
40  int cntEgress = leavingPassengers.size();
41  int cntAccess = enteringPassengers.size();
42  double stopTime = 0;
43  if ((cntAccess > 0) || (cntEgress > 0)) {
44  stopTime = cntAccess * 4 + cntEgress * 2;
45  if (this.lastHandledStop != stop) {
46  stopTime += 15.0; // add fixed amount of time for door-operations and similar stuff
47  }
48  for (PTPassengerAgent passenger : leavingPassengers) {
49  accessEgress.handlePassengerLeaving(passenger, vehicle, stop.getLinkId() , now);
50  }
51  for (PTPassengerAgent passenger : enteringPassengers) {
52  accessEgress.handlePassengerEntering(passenger, vehicle, stop.getId(), now);
53  }
54  }
55  this.lastHandledStop = stop;
56  return stopTime;
57  }
58 
59 }
boolean handlePassengerLeaving(final PTPassengerAgent agent, MobsimVehicle vehicle, Id< Link > toLinkId, final double time)
boolean handlePassengerEntering(final PTPassengerAgent agent, MobsimVehicle vehicle, Id< TransitStopFacility > fromStopFacilityId, final double time)
double handleTransitStop(TransitStopFacility stop, double now, List< PTPassengerAgent > leavingPassengers, List< PTPassengerAgent > enteringPassengers, PassengerAccessEgress accessEgress, MobsimVehicle vehicle)