SUMO - Simulation of Urban MObility

GUIE3Collector Class Reference

The gui-version of the MSE3Collector. More...

#include <GUIE3Collector.h>

Inheritance diagram for GUIE3Collector:
MSE3Collector MSDetectorFileOutput Named

Data Structures

class  MyWrapper

Public Member Functions

GUIDetectorWrapper * buildDetectorGUIRepresentation ()
 Returns the wrapper for this detector.
void detectorUpdate (const SUMOTime step) throw ()
 Computes the detector values in each time step.
void enter (SUMOVehicle &veh, SUMOReal entryTimestep) throw ()
 Called if a vehicle touches an entry-cross-section.
const CrossSectionVector & getEntries () const
 Returns the list of entry points.
const CrossSectionVector & getExits () const
 Returns the list of exit points.
const std::string & getID () const
 Returns the id.
 GUIE3Collector (const std::string &id, const CrossSectionVector &entries, const CrossSectionVector &exits, SUMOReal haltingSpeedThreshold, SUMOTime haltingTimeThreshold) throw ()
 Constructor.
void leave (SUMOVehicle &veh, SUMOReal leaveTimestep) throw ()
 Called if a vehicle passes a leave-cross-section.
void reset () throw ()
 Resets all generated values to allow computation of next interval.
void setID (const std::string &newID)
 resets the id
 ~GUIE3Collector () throw ()
 Destructor.
Methods returning current values
SUMOReal getCurrentMeanSpeed () const throw ()
 Returns the mean speed within the area.
SUMOReal getCurrentHaltingNumber () const throw ()
 Returns the number of current haltings within the area.
SUMOReal getVehiclesWithin () const throw ()
 Returns the number of vehicles within the area.
std::vector< std::string > getCurrentVehicleIDs () const throw ()
 Returns the number of vehicles within the area.
Methods inherited from MSDetectorFileOutput.
void writeXMLOutput (OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime) throw (IOError)
 Writes collected values into the given stream.
void writeXMLDetectorProlog (OutputDevice &dev) const throw (IOError)
 Opens the XML-output using "e3Detector" as root element.

Protected Attributes

std::map< SUMOVehicle *, E3Values > myEnteredContainer
 Container for vehicles that have entered the area.
CrossSectionVector myEntries
 The detector's entries.
std::vector< MSE3EntryReminder * > myEntryReminders
 The detector's built entry reminder.
CrossSectionVector myExits
 The detector's exits.
SUMOReal myHaltingSpeedThreshold
 Speed-threshold to determine if a vehicle is halting.
SUMOTime myHaltingTimeThreshold
std::string myID
 The name of the object.
SUMOTime myLastResetTime
 Information when the last reset has been done.
std::vector< MSE3LeaveReminder * > myLeaveReminders
 The detector's built exit reminder.
std::map< SUMOVehicle *, E3Values > myLeftContainer
 Container for vehicles that have left the area.
Storages for current values
SUMOReal myCurrentMeanSpeed
 The current mean speed of known vehicles (inside)
SUMOReal myCurrentHaltingsNumber
 The current number of haltings (inside)
SUMOReal myCurrentTouchedVehicles
 The current number of vehicles inside;.

Detailed Description

The gui-version of the MSE3Collector.

Allows the building of a wrapper (also declared herein) which draws the detector on the gl-canvas.

Definition at line 50 of file GUIE3Collector.h.


Constructor & Destructor Documentation

GUIE3Collector::GUIE3Collector ( const std::string &  id,
const CrossSectionVector &  entries,
const CrossSectionVector &  exits,
SUMOReal  haltingSpeedThreshold,
SUMOTime  haltingTimeThreshold 
) throw ()

Constructor.

Definition at line 176 of file GUIE3Collector.cpp.

GUIE3Collector::~GUIE3Collector ( ) throw ()

Destructor.

Definition at line 183 of file GUIE3Collector.cpp.


Member Function Documentation

GUIDetectorWrapper * GUIE3Collector::buildDetectorGUIRepresentation ( ) [virtual]

Returns the wrapper for this detector.

Returns:
The wrapper representing the detector
See also:
MyWrapper

Reimplemented from MSDetectorFileOutput.

Definition at line 200 of file GUIE3Collector.cpp.

void MSE3Collector::detectorUpdate ( const SUMOTime  step) throw () [virtual, inherited]

Computes the detector values in each time step.

This method should be called at the end of a simulation step, when all vehicles have moved. The current values are computed and summed up with the previous.

Parameters:
[in]currentTimeThe current simulation time (unused)

Reimplemented from MSDetectorFileOutput.

Definition at line 280 of file MSE3Collector.cpp.

References MSE3Collector::E3Values::entryTime, SUMOVehicle::getSpeed(), MSE3Collector::E3Values::hadUpdate, MSE3Collector::E3Values::haltingBegin, MSE3Collector::E3Values::haltings, MSE3Collector::E3Values::intervalHaltings, MSE3Collector::E3Values::intervalSpeedSum, MSE3Collector::E3Values::speedSum, SUMOReal, and TS.

void MSE3Collector::enter ( SUMOVehicle &  veh,
SUMOReal  entryTimestep 
) throw () [inherited]

Called if a vehicle touches an entry-cross-section.

Inserts vehicle into internal containers.

Parameters:
[in]vehThe vehicle that entered the area
[in]entryTimestepThe time step the vehicle entered the area

Definition at line 152 of file MSE3Collector.cpp.

References DELTA_T, MSE3Collector::E3Values::entryTime, MSE3Collector::E3Values::hadUpdate, MSE3Collector::E3Values::haltingBegin, MSE3Collector::E3Values::haltings, MSE3Collector::E3Values::intervalHaltings, MSE3Collector::E3Values::intervalSpeedSum, MSE3Collector::E3Values::leaveTime, MSE3Collector::E3Values::speedSum, SUMO_TAG_E3DETECTOR, SUMOReal, toString(), and WRITE_WARNING.

SUMOReal MSE3Collector::getCurrentHaltingNumber ( ) const throw () [inherited]

Returns the number of current haltings within the area.

If no vehicle is within the area, 0 is returned.

Returns:
The mean number of haltings within the area

Definition at line 333 of file MSE3Collector.cpp.

References MSE3Collector::myCurrentHaltingsNumber.

Referenced by GUIE3Collector::MyWrapper::getParameterWindow(), and TraCIServerAPI_MeMeDetector::processGet().

SUMOReal MSE3Collector::getCurrentMeanSpeed ( ) const throw () [inherited]

Returns the mean speed within the area.

If no vehicle is within the area, -1 is returned.

Returns:
The mean speed [m/s] of all vehicles within the area, -1 if there is none

Definition at line 320 of file MSE3Collector.cpp.

References MSE3Collector::myEnteredContainer, and SUMOReal.

Referenced by GUIE3Collector::MyWrapper::getParameterWindow(), and TraCIServerAPI_MeMeDetector::processGet().

std::vector< std::string > MSE3Collector::getCurrentVehicleIDs ( ) const throw () [inherited]

Returns the number of vehicles within the area.

Returns:
The number of vehicles that have passed the entry, but not yet an exit point

Definition at line 345 of file MSE3Collector.cpp.

References MSE3Collector::myEnteredContainer.

Referenced by TraCIServerAPI_MeMeDetector::processGet().

const CrossSectionVector & GUIE3Collector::getEntries ( ) const

Returns the list of entry points.

Returns:
The list of entry points

Definition at line 187 of file GUIE3Collector.cpp.

References MSE3Collector::myEntries.

const CrossSectionVector & GUIE3Collector::getExits ( ) const

Returns the list of exit points.

Returns:
The list of exit points

Definition at line 193 of file GUIE3Collector.cpp.

References MSE3Collector::myExits.

const std::string& Named::getID ( ) const [inline, inherited]

Returns the id.

Returns:
The stored id

Reimplemented in MS_E2_ZS_CollectorOverLanes.

Definition at line 59 of file Named.h.

References Named::myID.

Referenced by RORouteDef_Alternatives::addAlternative(), MSNet::addBusStop(), NLHandler::addConnection(), NBLoadedSUMOTLDef::addConnection(), NIImporter_OpenDrive::addE2EConnectionsSecure(), NIImporter_SUMO::addPhase(), NBDistrict::addSink(), NBDistrict::addSource(), MSRouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciStop(), NIVisumTL::build(), RORouteDef_Complete::buildCurrentRoute(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), NBEdge::buildInnerEdges(), NIVissimEdge::buildNBEdge(), NBNodeCont::buildOffRamp(), NBNodeCont::buildOnRamp(), ODDistrictHandler::closeDistrict(), NBTrafficLightDefinition::collectEdges(), NBOwnTLDef::collectLinks(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBNode::computeNodeShape(), NBTrafficLightLogicCont::computeSingleLogic(), NBEdge::connections_sorter(), MSLane::detectCollisions(), NIVissimDistrictConnection::dict_BuildDistricts(), MSVTypeProbe::execute(), Command_SaveTLSSwitches::execute(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), MSNet::getBusStopID(), NIImporter_VISUM::getNamedEdgeContinuating(), NLTriggerBuilder::getPosition(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), MSUnboundActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), MSActuatedTrafficLightLogic::init(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NIImporter_SUMO::initTrafficLightLogic(), NBNodeCont::joinJunctions(), NBEdgeCont::joinSameNodeConnectingEdges(), NIImporter_OpenDrive::loadNetwork(), MSLane::moveCritical(), MSVehicle::MSVehicle(), NBLoadedTLDef::myCompute(), NIXMLEdgesHandler::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSLaneSpeedTrigger::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), NBOwnTLDef::edge_by_incoming_priority_sorter::operator()(), NBNode::nodes_by_id_sorter::operator()(), NBNetBuilder::by_id_sorter::operator()(), NBContHelper::same_connection_edge_sorter::operator()(), Named::ComparatorIdLess::operator()(), NIImporter_VISUM::parse_EdgePolys(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_LanesConnections(), NIImporter_VISUM::parse_Turns(), NIImporter_VISUM::parse_TurnsToSignalGroups(), NIXMLConnectionsHandler::parseDeprecatedLaneDefinition(), NIXMLConnectionsHandler::parseLaneBound(), NBLoadedTLDef::SignalGroup::patchTYellow(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_InductionLoop::processGet(), NWWriter_SUMO::prohibitionConnection(), NBNodeCont::remapEdge(), NBLoadedSUMOTLDef::removeConnection(), NBNode::removeDummyEdges(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBConnection::replaceFrom(), NBConnection::replaceTo(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), NBNodeCont::setAsTLControlled(), NBEdge::setControllingTLInformation(), MSLane::setCritical(), NBOwnTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), RORDLoader_SUMOBase::startRoute(), NIXMLConnectionsHandler::validateLaneInfo(), MSInstantInductLoop::write(), NWWriter_SUMO::writeConnection(), NWWriter_SUMO::writeDistrict(), NWWriter_SUMO::writeEdge(), MSMeanData::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_SUMO::writeInternalConnections(), NWWriter_SUMO::writeJunction(), NWWriter_OpenDrive::writeNetwork(), NWWriter_XML::writeNodes(), and MSRouteProbe::writeXMLOutput().

SUMOReal MSE3Collector::getVehiclesWithin ( ) const throw () [inherited]

Returns the number of vehicles within the area.

Returns:
The number of vehicles that passed the entry collector

Definition at line 339 of file MSE3Collector.cpp.

References MSE3Collector::myEnteredContainer, and SUMOReal.

Referenced by GUIE3Collector::MyWrapper::getParameterWindow(), and TraCIServerAPI_MeMeDetector::processGet().

void MSE3Collector::leave ( SUMOVehicle &  veh,
SUMOReal  leaveTimestep 
) throw () [inherited]

Called if a vehicle passes a leave-cross-section.

Removes vehicle from internal containers.

Parameters:
[in]vehThe vehicle that left the area
[in]entryTimestepThe time step the vehicle left the area

Definition at line 179 of file MSE3Collector.cpp.

References DELTA_T, MSE3Collector::E3Values::hadUpdate, MSE3Collector::E3Values::haltingBegin, MSE3Collector::E3Values::haltings, MSE3Collector::E3Values::intervalHaltings, MSE3Collector::E3Values::intervalSpeedSum, MSE3Collector::E3Values::leaveTime, MSE3Collector::E3Values::speedSum, SUMO_TAG_E3DETECTOR, SUMOReal, toString(), and WRITE_WARNING.

void MSE3Collector::reset ( ) throw () [virtual, inherited]

Resets all generated values to allow computation of next interval.

Reimplemented from MSDetectorFileOutput.

Definition at line 145 of file MSE3Collector.cpp.

References MSE3Collector::myLeftContainer.

void Named::setID ( const std::string &  newID) [inline, inherited]

resets the id

Definition at line 65 of file Named.h.

References Named::myID.

void MSE3Collector::writeXMLDetectorProlog ( OutputDevice &  dev) const throw (IOError) [virtual, inherited]

Opens the XML-output using "e3Detector" as root element.

The lists of entries/exists are written, too.

Parameters:
[in]devThe output device to write the root into
See also:
MSDetectorFileOutput::writeXMLDetectorProlog
Exceptions:
IOErrorIf an error on writing occurs (!!! not yet implemented)

Implements MSDetectorFileOutput.

Definition at line 274 of file MSE3Collector.cpp.

void MSE3Collector::writeXMLOutput ( OutputDevice &  dev,
SUMOTime  startTime,
SUMOTime  stopTime 
) throw (IOError) [virtual, inherited]

Writes collected values into the given stream.

Parameters:
[in]devThe output device to write the data into
[in]startTimeFirst time step the data were gathered
[in]stopTimeLast time step the data were gathered
See also:
MSDetectorFileOutput::writeXMLOutput
Exceptions:
IOErrorIf an error on writing occurs (!!! not yet implemented)

Implements MSDetectorFileOutput.

Definition at line 207 of file MSE3Collector.cpp.

References MIN2(), SUMOReal, and time2string().


Field Documentation

SUMOReal MSE3Collector::myCurrentHaltingsNumber [protected, inherited]

The current number of haltings (inside)

Definition at line 363 of file MSE3Collector.h.

Referenced by MSE3Collector::getCurrentHaltingNumber().

SUMOReal MSE3Collector::myCurrentMeanSpeed [protected, inherited]

The current mean speed of known vehicles (inside)

Definition at line 360 of file MSE3Collector.h.

SUMOReal MSE3Collector::myCurrentTouchedVehicles [protected, inherited]

The current number of vehicles inside;.

Please note, that vehicles that enter the area are given as a fraction

See also:
execute

Definition at line 370 of file MSE3Collector.h.

std::map<SUMOVehicle*, E3Values> MSE3Collector::myEnteredContainer [protected, inherited]

Container for vehicles that have entered the area.

Definition at line 350 of file MSE3Collector.h.

Referenced by MSE3Collector::getCurrentMeanSpeed(), MSE3Collector::getCurrentVehicleIDs(), and MSE3Collector::getVehiclesWithin().

The detector's entries.

Definition at line 304 of file MSE3Collector.h.

Referenced by getEntries().

std::vector<MSE3EntryReminder*> MSE3Collector::myEntryReminders [protected, inherited]

The detector's built entry reminder.

Definition at line 310 of file MSE3Collector.h.

Referenced by MSE3Collector::~MSE3Collector().

The detector's exits.

Definition at line 307 of file MSE3Collector.h.

Referenced by getExits().

SUMOReal MSE3Collector::myHaltingSpeedThreshold [protected, inherited]

Speed-threshold to determine if a vehicle is halting.

Definition at line 320 of file MSE3Collector.h.

Definition at line 317 of file MSE3Collector.h.

SUMOTime MSE3Collector::myLastResetTime [protected, inherited]

Information when the last reset has been done.

Definition at line 375 of file MSE3Collector.h.

std::vector<MSE3LeaveReminder*> MSE3Collector::myLeaveReminders [protected, inherited]

The detector's built exit reminder.

Definition at line 313 of file MSE3Collector.h.

Referenced by MSE3Collector::~MSE3Collector().

std::map<SUMOVehicle*, E3Values> MSE3Collector::myLeftContainer [protected, inherited]

Container for vehicles that have left the area.

Definition at line 353 of file MSE3Collector.h.

Referenced by MSE3Collector::reset().


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines