41 const std::string& vTypes,
42 const std::string& nextEdges,
43 const int detectPersons) :
45 myDetectPersons(detectPersons) {
48 for (
const std::string& edgeID :
StringTokenizer(nextEdges).getVector()) {
53 throw ProcessError(
"Unknown edge '" + edgeID +
"' given as nextEdges in detector '" +
id +
"'");
66 bool typeMatches =
false;
67 for (
auto vTypeDist : vTypeDists) {
92 it = std::find(it, end, e);
108 const int dirCode = dir < 0 ? 2 : dir;
std::vector< const MSEdge * > ConstMSEdgeVector
ConstMSEdgeVector::const_iterator MSRouteIterator
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_PUBLIC_CLASSES
public transport
@ SVC_TAXI
vehicle is a taxi
bool detectPersons() const
bool vehicleApplies(const SUMOTrafficObject &veh) const
Checks whether the detector measures vehicles of the given type.
std::vector< const MSEdge * > myNextEdges
The upcoming edges to filter by (empty means no filtering)
const int myDetectPersons
Whether pedestrians shall be detected instead of vehicles.
MSDetectorFileOutput(const std::string &id, const std::string &vTypes, const std::string &nextEdges="", const int detectPersons=false)
Constructor.
bool personApplies(const MSTransportable &p, int dir) const
std::set< std::string > myVehicleTypes
The vehicle types to look for (empty means all)
A road/street connecting two junctions.
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn't already in the dictionary....
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
MSRouteIterator end() const
Returns the end of the list of edges to pass.
virtual ConstMSEdgeVector getEdges() const
the edges of the current stage
int getRoutePosition() const
return the index of the edge within the route
MSStage * getCurrentStage() const
Return the current stage.
SUMOVehicle * getVehicle() const
The vehicle associated with this transportable.
const std::set< std::string > getVTypeDistributionMembership(const std::string &id) const
Return the distribution IDs the vehicle type is a member of.
const std::string & getOriginalID() const
Returns the id of the original vehicle type if this is a vehicle specific type, the id otherwise.
Base class for objects which have an id.
Representation of a vehicle, person, or container.
virtual const MSEdge * getNextEdgePtr() const =0
returns the next edge (possibly an internal edge)
virtual bool isVehicle() const
Whether it is a vehicle.
virtual bool isPerson() const
Whether it is a person.
virtual const MSVehicleType & getVehicleType() const =0
Returns the object's "vehicle" type.
virtual SUMOVehicleClass getVClass() const =0
Returns the object's access class.
Representation of a vehicle.
virtual const MSRoute & getRoute() const =0
Returns the current route.
virtual const ConstMSEdgeVector::const_iterator & getCurrentRouteEdge() const =0
Returns an iterator pointing to the current edge in this vehicles route.
std::vector< std::string > getVector()
return vector of strings