SUMO - Simulation of Urban MObility
|
Class representing a detector within the DFROUTER. More...
#include <RODFDetector.h>
Public Member Functions | |
void | addFollowingDetector (RODFDetector *det) |
void | addPriorDetector (RODFDetector *det) |
void | addRoute (RODFRouteDesc &nrd) |
void | addRoutes (RODFRouteCont *routes) |
void | buildDestinationDistribution (const RODFDetectorCon &detectors, const RODFDetectorFlows &flows, SUMOTime startTime, SUMOTime endTime, SUMOTime stepOffset, const RODFNet &net, std::map< size_t, RandomDistributor< size_t > * > &into, int maxFollower) const |
void | computeSplitProbabilities (const RODFNet *net, const RODFDetectorCon &detectors, const RODFDetectorFlows &flows, SUMOTime startTime, SUMOTime endTime, SUMOTime stepOffset) |
const std::vector < RODFDetector * > & | getFollowerDetectors () const |
const std::vector < RODFDetector * > & | getPriorDetectors () const |
const std::vector < RODFRouteDesc > & | getRouteVector () const |
const std::vector< std::map < RODFEdge *, SUMOReal > > & | getSplitProbabilities () const |
bool | hasRoutes () const |
RODFDetector (const std::string &id, const std::string &laneID, SUMOReal pos, const RODFDetectorType type) | |
Constructor. | |
RODFDetector (const std::string &id, const RODFDetector &f) | |
Constructor. | |
void | setType (RODFDetectorType type) |
~RODFDetector () | |
Destructor. | |
Atomar getter methods | |
const std::string & | getID () const |
Returns the ID of this detector. | |
const std::string & | getLaneID () const |
Returns the id of the lane this detector is placed on. | |
std::string | getEdgeID () const |
Returns the id of the edge this detector is placed on. | |
SUMOReal | getPos () const |
Returns the position at which the detector lies. | |
RODFDetectorType | getType () const |
Returns the type of the detector. | |
Writing methods | |
bool | writeEmitterDefinition (const std::string &file, const std::map< size_t, RandomDistributor< size_t > * > &dists, const RODFDetectorFlows &flows, SUMOTime startTime, SUMOTime endTime, SUMOTime stepOffset, bool includeUnusedRoutes, SUMOReal scale, bool insertionsOnly, SUMOReal defaultSpeed) const |
bool | writeRoutes (std::vector< std::string > &saved, OutputDevice &out) |
void | writeSingleSpeedTrigger (const std::string &file, const RODFDetectorFlows &flows, SUMOTime startTime, SUMOTime endTime, SUMOTime stepOffset, SUMOReal defaultSpeed) |
void | writeEndRerouterDetectors (const std::string &file) |
Protected Member Functions | |
SUMOReal | computeDistanceFactor (const RODFRouteDesc &rd) const |
int | getFlowFor (const ROEdge *edge, SUMOTime time) const |
Protected Attributes | |
std::vector< RODFDetector * > | myFollowingDetectors |
std::string | myID |
std::string | myLaneID |
SUMOReal | myPosition |
std::vector< RODFDetector * > | myPriorDetectors |
std::map< std::string, RODFEdge * > | myRoute2Edge |
RODFRouteCont * | myRoutes |
std::vector< std::map < RODFEdge *, SUMOReal > > | mySplitProbabilities |
RODFDetectorType | myType |
Private Member Functions | |
RODFDetector & | operator= (const RODFDetector &src) |
Invalidated assignment operator. | |
RODFDetector (const RODFDetector &src) | |
Invalidated copy constructor. |
Class representing a detector within the DFROUTER.
Definition at line 87 of file RODFDetector.h.
RODFDetector::RODFDetector | ( | const std::string & | id, |
const std::string & | laneID, | ||
SUMOReal | pos, | ||
const RODFDetectorType | type | ||
) |
Constructor.
This constructor is used when detectors are read from a file
[in] | id | The id of the detector |
[in] | laneID | The id of the lane the detector is placed at |
[in] | pos | The position of the detector at the lane |
[in] | type | The df-router type of the detector |
Definition at line 61 of file RODFDetector.cpp.
RODFDetector::RODFDetector | ( | const std::string & | id, |
const RODFDetector & | f | ||
) |
Constructor.
This constructor is used when detectors shall be joined
[in] | id | The id of the detector |
[in] | f | A detector from which routes shall be copied |
Definition at line 66 of file RODFDetector.cpp.
References myRoutes.
RODFDetector::RODFDetector | ( | const RODFDetector & | src | ) | [private] |
Invalidated copy constructor.
void RODFDetector::addFollowingDetector | ( | RODFDetector * | det | ) |
Definition at line 208 of file RODFDetector.cpp.
References myFollowingDetectors.
void RODFDetector::addPriorDetector | ( | RODFDetector * | det | ) |
Definition at line 202 of file RODFDetector.cpp.
References myPriorDetectors.
void RODFDetector::addRoute | ( | RODFRouteDesc & | nrd | ) |
Definition at line 234 of file RODFDetector.cpp.
References RODFRouteCont::addRouteDesc(), and myRoutes.
void RODFDetector::addRoutes | ( | RODFRouteCont * | routes | ) |
Definition at line 227 of file RODFDetector.cpp.
References myRoutes.
void RODFDetector::buildDestinationDistribution | ( | const RODFDetectorCon & | detectors, |
const RODFDetectorFlows & | flows, | ||
SUMOTime | startTime, | ||
SUMOTime | endTime, | ||
SUMOTime | stepOffset, | ||
const RODFNet & | net, | ||
std::map< size_t, RandomDistributor< size_t > * > & | into, | ||
int | maxFollower | ||
) | const |
Definition at line 146 of file RODFDetector.cpp.
References BETWEEN_DETECTOR, DISCARDED_DETECTOR, RODFRouteCont::get(), RODFDetectorCon::getAnyDetectorForEdge(), getSplitProbabilities(), RODFNet::hasDetector(), myID, myRoutes, myType, SUMOReal, UNUSED_PARAMETER, and WRITE_ERROR.
Referenced by RODFDetectorCon::writeEmitters().
SUMOReal RODFDetector::computeDistanceFactor | ( | const RODFRouteDesc & | rd | ) | const [protected] |
Definition at line 87 of file RODFDetector.cpp.
References RODFRouteDesc::edges2Pass, and SUMOReal.
void RODFDetector::computeSplitProbabilities | ( | const RODFNet * | net, |
const RODFDetectorCon & | detectors, | ||
const RODFDetectorFlows & | flows, | ||
SUMOTime | startTime, | ||
SUMOTime | endTime, | ||
SUMOTime | stepOffset | ||
) |
Definition at line 98 of file RODFDetector.cpp.
References RODFRouteDesc::edges2Pass, RODFRouteCont::get(), RODFDetectorCon::getAggFlowFor(), RODFNet::hasDetector(), myRoute2Edge, myRoutes, mySplitProbabilities, RODFRouteDesc::routename, and SUMOReal.
std::string RODFDetector::getEdgeID | ( | ) | const [inline] |
Returns the id of the edge this detector is placed on.
Definition at line 140 of file RODFDetector.h.
References myLaneID.
Referenced by RODFDetectorCon::writeEmitters(), and RODFDetectorCon::writeSpeedTrigger().
int RODFDetector::getFlowFor | ( | const ROEdge * | edge, |
SUMOTime | time | ||
) | const [protected] |
const std::vector< RODFDetector * > & RODFDetector::getFollowerDetectors | ( | ) | const |
Definition at line 220 of file RODFDetector.cpp.
References myFollowingDetectors.
Referenced by RODFDetectorCon::guessEmptyFlows().
const std::string& RODFDetector::getID | ( | ) | const [inline] |
Returns the ID of this detector.
Definition at line 124 of file RODFDetector.h.
References myID.
Referenced by RODFDetectorCon::addDetector(), RODFNet::computeRoutesFor(), RODFNet::getDetectorEdge(), RODFDetectorCon::guessEmptyFlows(), RODFNet::isDestination(), RODFNet::isFalseSource(), RODFNet::isSource(), RODFNet::revalidateFlows(), writeEmitterDefinition(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), RODFDetectorCon::writeSpeedTrigger(), and RODFDetectorCon::writeValidationDetectors().
const std::string& RODFDetector::getLaneID | ( | ) | const [inline] |
Returns the id of the lane this detector is placed on.
Definition at line 132 of file RODFDetector.h.
References myLaneID.
Referenced by RODFDetectorCon::addDetector(), RODFNet::getDetectorEdge(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), RODFDetectorCon::writeSpeedTrigger(), and RODFDetectorCon::writeValidationDetectors().
SUMOReal RODFDetector::getPos | ( | ) | const [inline] |
Returns the position at which the detector lies.
Definition at line 148 of file RODFDetector.h.
References myPosition.
Referenced by RODFNet::buildEdgeFlowMap(), RODFNet::getAbsPos(), RODFNet::mesoJoin(), RODFDetectorCon::writeEmitters(), and RODFDetectorCon::writeValidationDetectors().
const std::vector< RODFDetector * > & RODFDetector::getPriorDetectors | ( | ) | const |
Definition at line 214 of file RODFDetector.cpp.
References myPriorDetectors.
Referenced by RODFDetectorCon::guessEmptyFlows().
const std::vector< RODFRouteDesc > & RODFDetector::getRouteVector | ( | ) | const |
Definition at line 196 of file RODFDetector.cpp.
References RODFRouteCont::get(), and myRoutes.
Referenced by RODFNet::buildDetectorDependencies().
const std::vector<std::map<RODFEdge*, SUMOReal> >& RODFDetector::getSplitProbabilities | ( | ) | const [inline] |
Definition at line 203 of file RODFDetector.h.
References mySplitProbabilities.
Referenced by buildDestinationDistribution().
RODFDetectorType RODFDetector::getType | ( | ) | const [inline] |
Returns the type of the detector.
Definition at line 157 of file RODFDetector.h.
References myType.
Referenced by RODFNet::buildRoutes(), RODFNet::hasInBetweenDetectorsOnly(), RODFNet::hasSourceDetector(), RODFNet::isFalseSource(), writeEmitterDefinition(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), RODFDetectorCon::writeSpeedTrigger(), and RODFDetectorCon::writeValidationDetectors().
bool RODFDetector::hasRoutes | ( | ) | const |
Definition at line 243 of file RODFDetector.cpp.
References RODFRouteCont::get(), and myRoutes.
Referenced by RODFNet::buildDetectorDependencies().
RODFDetector& RODFDetector::operator= | ( | const RODFDetector & | src | ) | [private] |
Invalidated assignment operator.
void RODFDetector::setType | ( | RODFDetectorType | type | ) |
Definition at line 81 of file RODFDetector.cpp.
References myType.
bool RODFDetector::writeEmitterDefinition | ( | const std::string & | file, |
const std::map< size_t, RandomDistributor< size_t > * > & | dists, | ||
const RODFDetectorFlows & | flows, | ||
SUMOTime | startTime, | ||
SUMOTime | endTime, | ||
SUMOTime | stepOffset, | ||
bool | includeUnusedRoutes, | ||
SUMOReal | scale, | ||
bool | insertionsOnly, | ||
SUMOReal | defaultSpeed | ||
) | const |
!! type = lkwTypes[vehSpeedDist.get()];
!! type = pkwTypes[vehSpeedDist.get()];
Definition at line 249 of file RODFDetector.cpp.
References OutputDevice::close(), OutputDevice::closeTag(), RandomDistributor< T >::get(), RODFRouteCont::get(), OutputDevice::getDevice(), RODFDetectorFlows::getFlowDefs(), getID(), RandomDistributor< T >::getOverallProb(), getType(), RODFDetectorFlows::knows(), myID, myLaneID, myPosition, myRoutes, OutputDevice::openTag(), SOURCE_DETECTOR, SUMOReal, time2string(), WRITE_ERROR, and OutputDevice::writeXMLHeader().
Referenced by RODFDetectorCon::writeEmitters().
void RODFDetector::writeEndRerouterDetectors | ( | const std::string & | file | ) |
bool RODFDetector::writeRoutes | ( | std::vector< std::string > & | saved, |
OutputDevice & | out | ||
) |
Definition at line 359 of file RODFDetector.cpp.
References myRoutes, and RODFRouteCont::save().
void RODFDetector::writeSingleSpeedTrigger | ( | const std::string & | file, |
const RODFDetectorFlows & | flows, | ||
SUMOTime | startTime, | ||
SUMOTime | endTime, | ||
SUMOTime | stepOffset, | ||
SUMOReal | defaultSpeed | ||
) |
Definition at line 369 of file RODFDetector.cpp.
References OutputDevice::close(), OutputDevice::getDevice(), RODFDetectorFlows::getFlowDefs(), MAX2(), myID, SUMOReal, and OutputDevice::writeXMLHeader().
Referenced by RODFDetectorCon::writeSpeedTrigger().
std::vector<RODFDetector*> RODFDetector::myFollowingDetectors [protected] |
Definition at line 218 of file RODFDetector.h.
Referenced by addFollowingDetector(), and getFollowerDetectors().
std::string RODFDetector::myID [protected] |
Definition at line 213 of file RODFDetector.h.
Referenced by buildDestinationDistribution(), getID(), writeEmitterDefinition(), and writeSingleSpeedTrigger().
std::string RODFDetector::myLaneID [protected] |
Definition at line 214 of file RODFDetector.h.
Referenced by getEdgeID(), getLaneID(), and writeEmitterDefinition().
SUMOReal RODFDetector::myPosition [protected] |
Definition at line 215 of file RODFDetector.h.
Referenced by getPos(), and writeEmitterDefinition().
std::vector<RODFDetector*> RODFDetector::myPriorDetectors [protected] |
Definition at line 218 of file RODFDetector.h.
Referenced by addPriorDetector(), and getPriorDetectors().
std::map<std::string, RODFEdge*> RODFDetector::myRoute2Edge [protected] |
Definition at line 220 of file RODFDetector.h.
Referenced by computeSplitProbabilities().
RODFRouteCont* RODFDetector::myRoutes [protected] |
Definition at line 217 of file RODFDetector.h.
Referenced by addRoute(), addRoutes(), buildDestinationDistribution(), computeSplitProbabilities(), getRouteVector(), hasRoutes(), RODFDetector(), writeEmitterDefinition(), writeRoutes(), and ~RODFDetector().
std::vector<std::map<RODFEdge*, SUMOReal> > RODFDetector::mySplitProbabilities [protected] |
Definition at line 219 of file RODFDetector.h.
Referenced by computeSplitProbabilities(), and getSplitProbabilities().
RODFDetectorType RODFDetector::myType [protected] |
Definition at line 216 of file RODFDetector.h.
Referenced by buildDestinationDistribution(), getType(), and setType().