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, SUMOTime startTime, SUMOTime endTime, SUMOTime stepOffset, const RODFNet &net, std::map< size_t, RandomDistributor< size_t > * > &into) 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. More... | |
RODFDetector (const std::string &id, const RODFDetector &f) | |
Constructor. More... | |
void | setType (RODFDetectorType type) |
~RODFDetector () | |
Destructor. More... | |
Atomar getter methods | |
const std::string & | getID () const |
Returns the ID of this detector. More... | |
const std::string & | getLaneID () const |
Returns the id of the lane this detector is placed on. More... | |
std::string | getEdgeID () const |
Returns the id of the edge this detector is placed on. More... | |
SUMOReal | getPos () const |
Returns the position at which the detector lies. More... | |
RODFDetectorType | getType () const |
Returns the type of the detector. More... | |
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. More... | |
RODFDetector (const RODFDetector &src) | |
Invalidated copy constructor. More... | |
Class representing a detector within the DFROUTER.
Definition at line 86 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 63 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 68 of file RODFDetector.cpp.
References myRoutes.
RODFDetector::~RODFDetector | ( | ) |
|
private |
Invalidated copy constructor.
void RODFDetector::addFollowingDetector | ( | RODFDetector * | det | ) |
Definition at line 204 of file RODFDetector.cpp.
References myFollowingDetectors.
void RODFDetector::addPriorDetector | ( | RODFDetector * | det | ) |
Definition at line 198 of file RODFDetector.cpp.
References myPriorDetectors.
void RODFDetector::addRoute | ( | RODFRouteDesc & | nrd | ) |
Definition at line 230 of file RODFDetector.cpp.
References RODFRouteCont::addRouteDesc(), and myRoutes.
void RODFDetector::addRoutes | ( | RODFRouteCont * | routes | ) |
Definition at line 223 of file RODFDetector.cpp.
References myRoutes.
void RODFDetector::buildDestinationDistribution | ( | const RODFDetectorCon & | detectors, |
SUMOTime | startTime, | ||
SUMOTime | endTime, | ||
SUMOTime | stepOffset, | ||
const RODFNet & | net, | ||
std::map< size_t, RandomDistributor< size_t > * > & | into | ||
) | const |
Definition at line 148 of file RODFDetector.cpp.
References BETWEEN_DETECTOR, DISCARDED_DETECTOR, RODFRouteCont::get(), RODFDetectorCon::getAnyDetectorForEdge(), getSplitProbabilities(), RODFNet::hasDetector(), myID, myRoutes, myType, SUMOReal, and WRITE_ERROR.
Referenced by RODFDetectorCon::writeEmitters().
|
protected |
Definition at line 89 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 100 of file RODFDetector.cpp.
References RODFRouteDesc::edges2Pass, RODFRouteCont::get(), RODFDetectorCon::getAggFlowFor(), RODFNet::hasDetector(), myRoute2Edge, myRoutes, mySplitProbabilities, RODFRouteDesc::routename, and SUMOReal.
|
inline |
Returns the id of the edge this detector is placed on.
Definition at line 139 of file RODFDetector.h.
References myLaneID.
Referenced by RODFDetectorCon::writeEmitters(), and RODFDetectorCon::writeSpeedTrigger().
const std::vector< RODFDetector * > & RODFDetector::getFollowerDetectors | ( | ) | const |
Definition at line 216 of file RODFDetector.cpp.
References myFollowingDetectors.
Referenced by RODFDetectorCon::guessEmptyFlows().
|
inline |
Returns the ID of this detector.
Definition at line 123 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().
|
inline |
Returns the id of the lane this detector is placed on.
Definition at line 131 of file RODFDetector.h.
References myLaneID.
Referenced by RODFDetectorCon::addDetector(), RODFNet::getDetectorEdge(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), RODFDetectorCon::writeSpeedTrigger(), and RODFDetectorCon::writeValidationDetectors().
|
inline |
Returns the position at which the detector lies.
Definition at line 147 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 210 of file RODFDetector.cpp.
References myPriorDetectors.
Referenced by RODFDetectorCon::guessEmptyFlows().
const std::vector< RODFRouteDesc > & RODFDetector::getRouteVector | ( | ) | const |
Definition at line 192 of file RODFDetector.cpp.
References RODFRouteCont::get(), and myRoutes.
Referenced by RODFNet::buildDetectorDependencies().
|
inline |
Definition at line 200 of file RODFDetector.h.
References mySplitProbabilities.
Referenced by buildDestinationDistribution().
|
inline |
Returns the type of the detector.
Definition at line 156 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 239 of file RODFDetector.cpp.
References RODFRouteCont::get(), and myRoutes.
Referenced by RODFNet::buildDetectorDependencies().
|
private |
Invalidated assignment operator.
void RODFDetector::setType | ( | RODFDetectorType | type | ) |
Definition at line 83 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 |
Definition at line 245 of file RODFDetector.cpp.
References TplConvert::_2int(), OutputDevice::close(), OutputDevice::closeOpener(), OutputDevice::closeTag(), RODFRouteCont::get(), RandomDistributor< T >::get(), OutputDevice::getDevice(), RODFDetectorFlows::getFlowDefs(), getID(), RandomDistributor< T >::getOverallProb(), getType(), RODFDetectorFlows::knows(), myID, myLaneID, myPosition, myRoutes, OutputDevice::openTag(), SOURCE_DETECTOR, SUMO_ATTR_DEPART, SUMO_ATTR_DEPARTLANE, SUMO_ATTR_DEPARTPOS, SUMO_ATTR_DEPARTSPEED, SUMO_ATTR_ID, SUMO_ATTR_PROB, SUMO_ATTR_REFID, SUMO_ATTR_ROUTE, SUMO_TAG_ROUTE, SUMO_TAG_ROUTE_DISTRIBUTION, SUMO_TAG_VEHICLE, SUMOReal, time2string(), toString(), WRITE_ERROR, OutputDevice::writeAttr(), 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 346 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 356 of file RODFDetector.cpp.
References OutputDevice::close(), OutputDevice::closeTag(), OutputDevice::getDevice(), RODFDetectorFlows::getFlowDefs(), MAX2(), myID, OutputDevice::openTag(), SUMO_ATTR_SPEED, SUMO_ATTR_TIME, SUMO_TAG_STEP, SUMOReal, time2string(), OutputDevice::writeAttr(), and OutputDevice::writeXMLHeader().
Referenced by RODFDetectorCon::writeSpeedTrigger().
|
protected |
Definition at line 215 of file RODFDetector.h.
Referenced by addFollowingDetector(), and getFollowerDetectors().
|
protected |
Definition at line 210 of file RODFDetector.h.
Referenced by buildDestinationDistribution(), getID(), writeEmitterDefinition(), and writeSingleSpeedTrigger().
|
protected |
Definition at line 211 of file RODFDetector.h.
Referenced by getEdgeID(), getLaneID(), and writeEmitterDefinition().
|
protected |
Definition at line 212 of file RODFDetector.h.
Referenced by getPos(), and writeEmitterDefinition().
|
protected |
Definition at line 215 of file RODFDetector.h.
Referenced by addPriorDetector(), and getPriorDetectors().
|
protected |
Definition at line 217 of file RODFDetector.h.
Referenced by computeSplitProbabilities().
|
protected |
Definition at line 214 of file RODFDetector.h.
Referenced by addRoute(), addRoutes(), buildDestinationDistribution(), computeSplitProbabilities(), getRouteVector(), hasRoutes(), RODFDetector(), writeEmitterDefinition(), writeRoutes(), and ~RODFDetector().
Definition at line 216 of file RODFDetector.h.
Referenced by computeSplitProbabilities(), and getSplitProbabilities().
|
protected |
Definition at line 213 of file RODFDetector.h.
Referenced by buildDestinationDistribution(), getType(), and setType().