 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
44 MSLane* lane,
double startPos,
double endPos,
double detLength,
45 SUMOTime haltingTimeThreshold,
double haltingSpeedThreshold,
46 double jamDistThreshold,
const std::string& vTypes,
bool showDetector)
47 :
MSE2Collector(id, usage, lane, startPos, endPos, detLength, haltingTimeThreshold,
48 haltingSpeedThreshold, jamDistThreshold, vTypes),
49 myShowDetectorInGUI(showDetector) {}
52 std::vector<MSLane*> lanes,
double startPos,
double endPos,
53 SUMOTime haltingTimeThreshold,
double haltingSpeedThreshold,
54 double jamDistThreshold,
const std::string& vTypes,
bool showDetector)
55 :
MSE2Collector(id, usage, lanes, startPos, endPos, haltingTimeThreshold,
56 haltingSpeedThreshold, jamDistThreshold, vTypes),
57 myShowDetectorInGUI(showDetector) {}
73 myDetector(detector) {
76 const std::vector<MSLane*> lanes = detector.
getLanes();
77 double detectorLength = detector.
getLength();
78 for (std::vector<MSLane*>::const_iterator li = lanes.begin(); li != lanes.end(); ++li) {
82 detectorLength += v.back().distanceTo2D(shape.front());
84 v.insert(v.end(), shape.begin(), shape.end());
88 lanes.front()->interpolateLanePosToGeometryPos(detector.
getStartPos()),
89 lanes.back()->interpolateLanePosToGeometryPos(detector.
getStartPos() + detectorLength));
94 for (
int i = 0; i < e; ++i) {
123 ret->
mkItem(
"length [m]",
false, myDetector.getLength());
124 ret->
mkItem(
"position [m]",
false, myDetector.getStartPos());
125 ret->
mkItem(
"lane",
false, myDetector.getLane()->getID());
127 ret->
mkItem(
"vehicles [#]",
true,
129 ret->
mkItem(
"occupancy [%]",
true,
131 ret->
mkItem(
"mean speed [m/s]",
true,
133 ret->
mkItem(
"mean vehicle length [m]",
true,
135 ret->
mkItem(
"jam number [#]",
true,
137 ret->
mkItem(
"max jam length [veh]",
true,
139 ret->
mkItem(
"max jam length [m]",
true,
141 ret->
mkItem(
"jam length sum [veh]",
true,
143 ret->
mkItem(
"jam length sum [m]",
true,
145 ret->
mkItem(
"started halts [#]",
true,
155 if (!myDetector.myShowDetectorInGUI) {
158 glPushName(getGlID());
160 glTranslated(0, 0, getType());
163 if (exaggeration > 0) {
165 dwidth = (double) 0.3;
166 glColor3d(0, (
double) .6, (
double) .8);
168 glColor3d(0, (
double) .8, (
double) .8);
170 double width = (double) 2.0 * s.
scale;
171 if (width * exaggeration > 1.0) {
174 int e = (int) myFullGeometry.size() - 1;
175 for (
int i = 0; i < e; ++i) {
181 drawName(getCenteringBoundary().getCenter(), s.
scale, s.
addName);
A window containing a gl-object's parameter.
int getCurrentJamLengthInVehicles() const
Returns the length of all jams in vehicles.
double getCurrentMeanLength() const
Returns the mean vehicle length of vehicles currently on the detector.
Representation of a lane in the micro simulation.
double getCurrentOccupancy() const
Returns the current detector occupancy.
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
PositionVector getSubpart(double beginOffset, double endOffset) const
get subpart of a position vector
Boundary myBoundary
The detector's boundary.
An areal detector corresponding to a sequence of consecutive lanes.
double getLength() const
Returns the length of the detector.
std::vector< double > myShapeLengths
A sequence of lengths in full-geometry mode.
double getStartPos() const
Returns the begin position of the detector.
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
double getCurrentMeanSpeed() const
Returns the mean vehicle speed of vehicles currently on the detector.
GUIVisualizationTextSettings addName
GUIE2Collector(const std::string &id, DetectorUsage usage, MSLane *lane, double startPos, double endPos, double detLength, SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold, const std::string &vTypes, bool showDetector)
Constructor with given end position and detector length.
int getCurrentJamNumber() const
Returns the current number of jams.
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
A class that stores a 2D geometrical boundary.
double scale
information about a lane's width (temporary, used for a single view)
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
int getCurrentMaxJamLengthInVehicles() const
Returns the length in vehicles of the currently largest jam.
~GUIE2Collector()
Destructor.
GUIE2Collector & getDetector()
Returns the detector itself.
virtual GUIDetectorWrapper * buildDetectorGUIRepresentation()
Returns the wrapper for this detector.
std::vector< MSLane * > getLanes()
Returns a vector containing pointers to the lanes covered by the detector ordered from its first to i...
double y() const
Returns the y-position.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
double getCurrentJamLengthInMeters() const
Returns the length of all jams in meters.
double getCurrentMaxJamLengthInMeters() const
Returns the length in meters of the currently largest jam.
GUIVisualizationSizeSettings addSize
int getCurrentStartedHalts() const
Returns the length of all jams in meters.
The gui-version of the MSE2Collector.
int getCurrentVehicleNumber() const
Returns the number of vehicles currently on the detector.
Boundary & grow(double by)
extends the boundary by the given amount
Stores the information about how to visualize structures.
std::vector< double > myShapeRotations
A sequence of rotations in full-geometry mode.
PositionVector myFullGeometry
A sequence of positions in full-geometry mode.
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
MyWrapper(GUIE2Collector &detector)
Constructor.