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 /****************************************************************************/
14 // Calibrates the flow on a segment to a specified one
15 /****************************************************************************/
16 #ifndef METriggeredCalibrator_h
17 #define METriggeredCalibrator_h
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <string>
26 #include <vector>
28 #include <mesosim/MESegment.h>
29 
30 
31 // ===========================================================================
32 // class definitions
33 // ===========================================================================
39 public:
41  METriggeredCalibrator(const std::string& id,
42  const MSEdge* const edge, const double pos,
43  const std::string& aXMLFilename,
44  const std::string& outputFilename,
45  const SUMOTime freq, const double length,
46  const MSRouteProbe* probe,
47  const std::string& vTypes);
48 
50  virtual ~METriggeredCalibrator();
51 
52 
55  SUMOTime execute(SUMOTime currentTime);
56 
57 protected:
58 
59  bool tryEmit(MESegment* s, MEVehicle* vehicle);
60 
61  inline int passed() const {
62  // calibrator measures at start of segment
64  }
65 
67  bool invalidJam() const;
68 
70  int remainingVehicleCapacity() const;
71 
73  void reset();
74 
76  void updateMeanData() {}
77 
79  inline int maximumInflow() const {
80  return (int)std::ceil((double)myFrequency / (double)mySegment->getMinimumHeadwayTime());
81  }
82 
83 private:
86 
87 };
88 
89 #endif
90 
91 /****************************************************************************/
MEVehicle
A vehicle from the mesoscopic point of view.
Definition: MEVehicle.h:44
METriggeredCalibrator::tryEmit
bool tryEmit(MESegment *s, MEVehicle *vehicle)
Definition: METriggeredCalibrator.cpp:77
METriggeredCalibrator::execute
SUMOTime execute(SUMOTime currentTime)
Definition: METriggeredCalibrator.cpp:89
MESegment
A single mesoscopic segment (cell)
Definition: MESegment.h:49
MSCalibrator::myFrequency
SUMOTime myFrequency
The frequeny with which to check for calibration.
Definition: MSCalibrator.h:285
MSRouteProbe
Writes routes of vehicles passing a certain edge.
Definition: MSRouteProbe.h:60
MSCalibrator.h
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
METriggeredCalibrator::remainingVehicleCapacity
int remainingVehicleCapacity() const
returns the number of vehicles (of the current type) that still fit onto the segment
Definition: METriggeredCalibrator.cpp:254
METriggeredCalibrator
Calibrates the flow on a segment to a specified one.
Definition: METriggeredCalibrator.h:38
METriggeredCalibrator::passed
int passed() const
Definition: METriggeredCalibrator.h:61
MESegment.h
METriggeredCalibrator::mySegment
MESegment * mySegment
mesoscopic edge segment the calibrator lies on
Definition: METriggeredCalibrator.h:85
METriggeredCalibrator::~METriggeredCalibrator
virtual ~METriggeredCalibrator()
Definition: METriggeredCalibrator.cpp:65
METriggeredCalibrator::reset
void reset()
reset collected vehicle data
Definition: METriggeredCalibrator.cpp:262
MSMeanData_Net::MSLaneMeanDataValues::nVehVaporized
int nVehVaporized
The number of vehicles that left this lane within the sample interval.
Definition: MSMeanData_Net.h:164
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:78
MSCalibrator::myEdgeMeanData
MSMeanData_Net::MSLaneMeanDataValues myEdgeMeanData
accumlated data for the whole edge
Definition: MSCalibrator.h:264
METriggeredCalibrator::invalidJam
bool invalidJam() const
returns whether the segment is jammed although it should not be
Definition: METriggeredCalibrator.cpp:243
METriggeredCalibrator::maximumInflow
int maximumInflow() const
returns the maximum number of vehicles that could enter from upstream until the calibrator is activat...
Definition: METriggeredCalibrator.h:79
config.h
METriggeredCalibrator::updateMeanData
void updateMeanData()
do nothing
Definition: METriggeredCalibrator.h:76
MSMeanData_Net::MSLaneMeanDataValues::nVehEntered
int nVehEntered
The number of vehicles that entered this lane within the sample interval.
Definition: MSMeanData_Net.h:158
MSMeanData_Net::MSLaneMeanDataValues::nVehDeparted
int nVehDeparted
Definition: MSMeanData_Net.h:152
MSCalibrator
Calibrates the flow on a segment to a specified one.
Definition: MSCalibrator.h:50
METriggeredCalibrator::METriggeredCalibrator
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)
Definition: METriggeredCalibrator.cpp:51
MESegment::getMinimumHeadwayTime
SUMOTime getMinimumHeadwayTime() const
return the minimum headway-time with which vehicles may enter or leave this segment
Definition: MESegment.h:374