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-2018 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 
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 /****************************************************************************/
int nVehEntered
The number of vehicles that entered this lane within the sample interval.
long long int SUMOTime
Definition: SUMOTime.h:36
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
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:255
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:75
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: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:50
MSMeanData_Net::MSLaneMeanDataValues myEdgeMeanData
accumlated data for the whole edge
Definition: MSCalibrator.h:237
void reset()
reset collected vehicle data