SUMO - Simulation of Urban MObility
METriggeredCalibrator.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // Calibrates the flow on a segment to a specified one
18 /****************************************************************************/
19 #ifndef METriggeredCalibrator_h
20 #define METriggeredCalibrator_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include <string>
33 #include <vector>
35 #include <mesosim/MESegment.h>
36 
37 
38 // ===========================================================================
39 // class definitions
40 // ===========================================================================
46 public:
48  METriggeredCalibrator(const std::string& id,
49  const MSEdge* const edge, const double pos,
50  const std::string& aXMLFilename,
51  const std::string& outputFilename,
52  const SUMOTime freq, const double length,
53  const MSRouteProbe* probe);
54 
56  virtual ~METriggeredCalibrator();
57 
58 
61  SUMOTime execute(SUMOTime currentTime);
62 
63 protected:
64 
65  bool tryEmit(MESegment* s, MEVehicle* vehicle);
66 
67  inline int passed() const {
68  // calibrator measures at start of segment
70  }
71 
73  bool invalidJam() const;
74 
76  int remainingVehicleCapacity() const;
77 
79  void reset();
80 
82  void updateMeanData() {}
83 
85  inline int maximumInflow() const {
86  return (int)std::ceil((double)myFrequency / (double)mySegment->getMinimumHeadwayTime());
87  }
88 
89 private:
92 
93 };
94 
95 #endif
96 
97 /****************************************************************************/
int nVehEntered
The number of vehicles that entered this lane within the sample interval.
SUMOTime execute(SUMOTime currentTime)
int maximumInflow() const
returns the maximum number of vehicles that could enter from upstream until the calibrator is activat...
A vehicle from the mesoscopic point of view.
Definition: MEVehicle.h:51
int nVehVaporized
The number of vehicles that left this lane within the sample interval.
Writes routes of vehicles passing a certain edge.
Definition: MSRouteProbe.h:67
METriggeredCalibrator(const std::string &id, const MSEdge *const edge, const double pos, const std::string &aXMLFilename, const std::string &outputFilename, const SUMOTime freq, const double length, const MSRouteProbe *probe)
SUMOTime myFrequency
The frequeny with which to check for calibration.
Definition: MSCalibrator.h:261
bool tryEmit(MESegment *s, MEVehicle *vehicle)
SUMOTime getMinimumHeadwayTime() const
return the minimum headway-time with which vehicles may enter or leave this segment ...
Definition: MESegment.h:374
A road/street connecting two junctions.
Definition: MSEdge.h:80
void updateMeanData()
do nothing
Calibrates the flow on a segment to a specified one.
MESegment * mySegment
mesoscopic edge segment the calibrator lies on
int remainingVehicleCapacity() const
returns the number of vehicles (of the current type) that still fit onto the segment ...
A single mesoscopic segment (cell)
Definition: MESegment.h:56
bool invalidJam() const
returns whether the segment is jammed although it should not be
Calibrates the flow on a segment to a specified one.
Definition: MSCalibrator.h:56
long long int SUMOTime
Definition: TraCIDefs.h:51
MSMeanData_Net::MSLaneMeanDataValues myEdgeMeanData
accumlated data for the whole edge
Definition: MSCalibrator.h:243
void reset()
reset collected vehicle data