SUMO - Simulation of Urban MObility
METriggeredCalibrator.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // Calibrates the flow on a segment to a specified one
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef METriggeredCalibrator_h
21 #define METriggeredCalibrator_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <string>
34 #include <vector>
36 #include <mesosim/MESegment.h>
37 
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
47 public:
49  METriggeredCalibrator(const std::string& id,
50  const MSEdge* const edge, const double pos,
51  const std::string& aXMLFilename,
52  const std::string& outputFilename,
53  const SUMOTime freq, const double length,
54  const MSRouteProbe* probe);
55 
57  virtual ~METriggeredCalibrator();
58 
59 
62  SUMOTime execute(SUMOTime currentTime);
63 
64 protected:
65 
66  bool tryEmit(MESegment* s, MEVehicle* vehicle);
67 
68  inline int passed() const {
69  // calibrator measures at start of segment
71  }
72 
74  bool invalidJam() const;
75 
77  int remainingVehicleCapacity() const;
78 
80  void reset();
81 
83  void updateMeanData() {}
84 
86  inline int maximumInflow() const {
87  return (int)std::ceil((double)myFrequency / (double)mySegment->getMinimumHeadwayTime());
88  }
89 
90 private:
93 
94 };
95 
96 #endif
97 
98 /****************************************************************************/
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:52
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:68
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:237
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: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:57
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:57
long long int SUMOTime
Definition: TraCIDefs.h:52
MSMeanData_Net::MSLaneMeanDataValues myEdgeMeanData
accumlated data for the whole edge
Definition: MSCalibrator.h:219
void reset()
reset collected vehicle data