Eclipse 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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // Calibrates the flow on a segment to a specified one
16 /****************************************************************************/
17 #ifndef METriggeredCalibrator_h
18 #define METriggeredCalibrator_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <string>
27 #include <vector>
29 #include <mesosim/MESegment.h>
30 
31 
32 // ===========================================================================
33 // class definitions
34 // ===========================================================================
40 public:
42  METriggeredCalibrator(const std::string& id,
43  const MSEdge* const edge, const double pos,
44  const std::string& aXMLFilename,
45  const std::string& outputFilename,
46  const SUMOTime freq, const double length,
47  const MSRouteProbe* probe,
48  const std::string& vTypes);
49 
51  virtual ~METriggeredCalibrator();
52 
53 
56  SUMOTime execute(SUMOTime currentTime);
57 
58 protected:
59 
60  bool tryEmit(MESegment* s, MEVehicle* vehicle);
61 
62  inline int passed() const {
63  // calibrator measures at start of segment
65  }
66 
68  bool invalidJam() const;
69 
71  int remainingVehicleCapacity() const;
72 
74  void reset();
75 
77  void updateMeanData() {}
78 
80  inline int maximumInflow() const {
81  return (int)std::ceil((double)myFrequency / (double)mySegment->getMinimumHeadwayTime());
82  }
83 
84 private:
87 
88 };
89 
90 #endif
91 
92 /****************************************************************************/
int nVehEntered
The number of vehicles that entered this lane within the sample interval.
long long int SUMOTime
Definition: SUMOTime.h:35
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:45
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:61
SUMOTime myFrequency
The frequeny with which to check for calibration.
Definition: MSCalibrator.h:283
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:375
A road/street connecting two junctions.
Definition: MSEdge.h:76
void updateMeanData()
do nothing
Calibrates the flow on a segment to a specified one.
MESegment * mySegment
mesoscopic edge segment the calibrator lies on
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, const std::string &vTypes)
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:50
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:51
MSMeanData_Net::MSLaneMeanDataValues myEdgeMeanData
accumlated data for the whole edge
Definition: MSCalibrator.h:262
void reset()
reset collected vehicle data