SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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

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

Protected Attributes

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

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 53 of file GUIE3Collector.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 174 of file GUIE3Collector.cpp.

GUIE3Collector::~GUIE3Collector ( )

Destructor.

Definition at line 181 of file GUIE3Collector.cpp.

Member Function Documentation

void Named::addTo ( const StoringVisitor cont) const
inlineinherited

Adds this object to the given container.

Parameters
in,filled]cont The container to add this item to

Definition at line 114 of file Named.h.

References Named::StoringVisitor::add().

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 198 of file GUIE3Collector.cpp.

void MSE3Collector::detectorUpdate ( const SUMOTime  step)
virtualinherited

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 287 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::myCurrentHaltingsNumber, MSE3Collector::myCurrentMeanSpeed, MSE3Collector::myCurrentTouchedVehicles, MSE3Collector::myEnteredContainer, MSE3Collector::myHaltingSpeedThreshold, MSE3Collector::myHaltingTimeThreshold, MSE3Collector::E3Values::speedSum, SUMOReal, and TS.

SUMOReal MSE3Collector::getCurrentHaltingNumber ( ) const
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 340 of file MSE3Collector.cpp.

References MSE3Collector::myCurrentHaltingsNumber.

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

SUMOReal MSE3Collector::getCurrentMeanSpeed ( ) const
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 327 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
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 352 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 185 of file GUIE3Collector.cpp.

References MSE3Collector::myEntries.

Referenced by GUIE3Collector::MyWrapper::MyWrapper().

const CrossSectionVector & GUIE3Collector::getExits ( ) const

Returns the list of exit points.

Returns
The list of exit points

Definition at line 191 of file GUIE3Collector.cpp.

References MSE3Collector::myExits.

Referenced by GUIE3Collector::MyWrapper::MyWrapper().

const std::string& Named::getID ( ) const
inlineinherited

Returns the id.

Returns
The stored id

Definition at line 60 of file Named.h.

References Named::myID.

Referenced by Named::StoringVisitor::add(), MSDetectorControl::add(), RORouteDef::addAlternative(), MSNet::addBusStop(), NBLoadedSUMOTLDef::addConnection(), NLHandler::addConnection(), NIImporter_OpenDrive::addE2EConnectionsSecure(), RONet::addNode(), NIImporter_SUMO::addPhase(), RONet::addRouteDef(), NBDistrict::addSink(), NBDistrict::addSource(), NBTrafficLightLogic::addStep(), MSRouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciStop(), MSPerson::MSPersonStage_Driving::beginEventOutput(), MSPerson::MSPersonStage_Waiting::beginEventOutput(), NIVisumTL::build(), MS_E2_ZS_CollectorOverLanes::buildCollector(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), NBEdge::buildInnerEdges(), NIVissimEdge::buildNBEdge(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), MSVehicleTransfer::checkInsertions(), ODDistrictHandler::closeDistrict(), NLHandler::closeEdge(), RORouteHandler::closeRouteDistribution(), NBTrafficLightDefinition::collectEdges(), NBOwnTLDef::collectLinks(), NBTrafficLightDefinition::compute(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBNode::computeNodeShape(), NBTrafficLightLogicCont::computeSingleLogic(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NBEdge::connections_sorter(), MSLane::detectCollisions(), NIVissimDistrictConnection::dict_BuildDistricts(), MSPerson::MSPersonStage_Driving::endEventOutput(), MSPerson::MSPersonStage_Waiting::endEventOutput(), MSE3Collector::enter(), Command_SaveTLSSwitches::execute(), MSVTypeProbe::execute(), NBNodeCont::extract(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), MSNet::getBusStopID(), MS_E2_ZS_CollectorOverLanes::getLanePredeccessorLanes(), NIImporter_VISUM::getNamedEdgeContinuating(), NLTriggerBuilder::getPosition(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), NBEdgeCont::ignoreFilterMatch(), MSActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NBDistrictCont::insert(), NBTrafficLightLogicCont::insert(), NBNodeCont::insert(), NBEdgeCont::insert(), NBEdgeCont::joinSameNodeConnectingEdges(), MSE3Collector::leave(), NIImporter_OpenDrive::loadNetwork(), MSVehicle::moveChecked(), NBRampsComputer::moveRampRight(), MSPerson::MSPersonStage_Waiting::MSPersonStage_Waiting(), MSVehicle::MSVehicle(), NBOwnTLDef::myCompute(), NBLoadedTLDef::myCompute(), NIXMLTrafficLightsHandler::myEndElement(), NIXMLEdgesHandler::myEndElement(), NIImporter_SUMO::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSTriggeredRerouter::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), MSDevice_Tripinfo::notifyEnter(), MSDevice_Tripinfo::notifyLeave(), MSDevice_Person::notifyLeave(), RORouteHandler::openRoute(), Named::ComparatorIdLess::operator()(), NBTurningDirectionsComputer::combination_by_angle_sorter::operator()(), NBOwnTLDef::edge_by_incoming_priority_sorter::operator()(), NBNetBuilder::by_id_sorter::operator()(), NBContHelper::same_connection_edge_sorter::operator()(), NBNode::nodes_by_id_sorter::operator()(), MSEdge::by_id_sorter::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(), RORDLoader_SUMOBase::parseRoute(), NBLoadedTLDef::SignalGroup::patchTYellow(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Vehicle::processGet(), NWWriter_SUMO::prohibitionConnection(), NBEdgeCont::recheckPostProcessConnections(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::remapOutgoing(), NBLoadedSUMOTLDef::removeConnection(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBNodeCont::rename(), NBEdgeCont::rename(), NBConnection::replaceFrom(), MSBaseVehicle::replaceRouteEdges(), NBConnection::replaceTo(), NIImporter_DlrNavteq::TrafficlightsHandler::report(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), PCPolyContainer::save(), RONet::saveAndRemoveRoutesUntil(), NBNodeCont::setAsTLControlled(), NBEdge::setControllingTLInformation(), MSLane::setCritical(), NIXMLEdgesHandler::setNodes(), NBOwnTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), RORDLoader_SUMOBase::startRoute(), NBEdge::startShapeAt(), NIXMLConnectionsHandler::validateLaneInfo(), MSEmissionExport::write(), MSInstantInductLoop::write(), NBSign::writeAsPOI(), NWWriter_SUMO::writeConnection(), NWWriter_SUMO::writeDistrict(), MSFullExport::writeEdge(), MSXMLRawOut::writeEdge(), NWWriter_SUMO::writeEdge(), MSMeanData::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_SUMO::writeInternalConnections(), NWWriter_SUMO::writeJunction(), MSQueueExport::writeLane(), MSFullExport::writeLane(), NWWriter_DlrNavteq::writeLinksUnsplitted(), NWWriter_OpenDrive::writeNetwork(), NWWriter_XML::writeNodes(), NWWriter_DlrNavteq::writeNodesUnsplitted(), MSInductLoop::writeTypedXMLOutput(), MSFullExport::writeVehicles(), MSRouteProbe::writeXMLOutput(), and MSE2Collector::writeXMLOutput().

SUMOReal MSE3Collector::getVehiclesWithin ( ) const
inherited

Returns the number of vehicles within the area.

Returns
The number of vehicles that passed the entry collector

Definition at line 346 of file MSE3Collector.cpp.

References MSE3Collector::myEnteredContainer, and SUMOReal.

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

void MSE3Collector::reset ( )
virtualinherited

Resets all generated values to allow computation of next interval.

Reimplemented from MSDetectorFileOutput.

Definition at line 152 of file MSE3Collector.cpp.

References MSE3Collector::myLeftContainer.

Referenced by MSE3Collector::MSE3Collector().

void Named::setID ( const std::string &  newID)
inlineinherited

resets the id

Parameters
[in]newIDThe new id of this object

Definition at line 68 of file Named.h.

References Named::myID.

Referenced by NBNodeCont::rename(), and NBEdgeCont::rename().

void MSE3Collector::writeXMLDetectorProlog ( OutputDevice dev) const
virtualinherited

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 281 of file MSE3Collector.cpp.

References OutputDevice::writeXMLHeader().

void MSE3Collector::writeXMLOutput ( OutputDevice dev,
SUMOTime  startTime,
SUMOTime  stopTime 
)
virtualinherited

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 214 of file MSE3Collector.cpp.

References MIN2(), MSE3Collector::myEnteredContainer, Named::myID, MSE3Collector::myLastResetTime, MSE3Collector::myLeftContainer, SUMOReal, and time2string().

Field Documentation

SUMOReal MSE3Collector::myCurrentHaltingsNumber
protectedinherited

The current number of haltings (inside)

Definition at line 365 of file MSE3Collector.h.

Referenced by MSE3Collector::detectorUpdate(), and MSE3Collector::getCurrentHaltingNumber().

SUMOReal MSE3Collector::myCurrentMeanSpeed
protectedinherited

The current mean speed of known vehicles (inside)

Definition at line 362 of file MSE3Collector.h.

Referenced by MSE3Collector::detectorUpdate().

SUMOReal MSE3Collector::myCurrentTouchedVehicles
protectedinherited

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 372 of file MSE3Collector.h.

Referenced by MSE3Collector::detectorUpdate().

std::map<SUMOVehicle*, E3Values> MSE3Collector::myEnteredContainer
protectedinherited
CrossSectionVector MSE3Collector::myEntries
protectedinherited

The detector's entries.

Definition at line 306 of file MSE3Collector.h.

Referenced by getEntries().

std::vector<MSE3EntryReminder*> MSE3Collector::myEntryReminders
protectedinherited

The detector's built entry reminder.

Definition at line 312 of file MSE3Collector.h.

Referenced by MSE3Collector::MSE3Collector(), and MSE3Collector::~MSE3Collector().

CrossSectionVector MSE3Collector::myExits
protectedinherited

The detector's exits.

Definition at line 309 of file MSE3Collector.h.

Referenced by getExits().

SUMOReal MSE3Collector::myHaltingSpeedThreshold
protectedinherited

Speed-threshold to determine if a vehicle is halting.

Definition at line 322 of file MSE3Collector.h.

Referenced by MSE3Collector::detectorUpdate(), MSE3Collector::enter(), and MSE3Collector::leave().

SUMOTime MSE3Collector::myHaltingTimeThreshold
protectedinherited
SUMOTime MSE3Collector::myLastResetTime
protectedinherited

Information when the last reset has been done.

Definition at line 377 of file MSE3Collector.h.

Referenced by MSE3Collector::writeXMLOutput().

std::vector<MSE3LeaveReminder*> MSE3Collector::myLeaveReminders
protectedinherited

The detector's built exit reminder.

Definition at line 315 of file MSE3Collector.h.

Referenced by MSE3Collector::MSE3Collector(), and MSE3Collector::~MSE3Collector().

std::map<SUMOVehicle*, E3Values> MSE3Collector::myLeftContainer
protectedinherited

Container for vehicles that have left the area.

Definition at line 355 of file MSE3Collector.h.

Referenced by MSE3Collector::leave(), MSE3Collector::reset(), and MSE3Collector::writeXMLOutput().


The documentation for this class was generated from the following files: