Eclipse SUMO - Simulation of Urban MObility
libsumo::Helper Class Reference

C++ TraCI client API implementation. More...

#include <Helper.h>

Collaboration diagram for libsumo::Helper:
[legend]

Data Structures

class  LaneUtility
 
class  SubscriptionWrapper
 
class  VehicleStateListener
 

Static Public Member Functions

static SubscriptionaddSubscriptionFilter (SubscriptionFilterType filter)
 
static void addSubscriptionParam (const std::string &param)
 
static void addSubscriptionParam (double param)
 
static void applySubscriptionFilterFieldOfVision (const Subscription &s, std::set< std::string > &objIDs)
 
static void applySubscriptionFilterLateralDistanceSinglePass (const Subscription &s, std::set< std::string > &objIDs, std::set< const SUMOTrafficObject * > &vehs, const std::vector< const MSLane * > &lanes, double posOnLane, double posLat, bool isDownstream)
 
static void applySubscriptionFilters (const Subscription &s, std::set< std::string > &objIDs)
 Filter the given ID-Set (which was obtained from an R-Tree search) according to the filters set by the subscription or firstly build the object ID list if the filters rather demand searching along the road network than considering a geometric range. More...
 
static void cleanup ()
 
static void clearSubscriptions ()
 
static void clearVehicleStates ()
 
static void collectObjectIDsInRange (int domain, const PositionVector &shape, double range, std::set< std::string > &into)
 
static void collectObjectsInRange (int domain, const PositionVector &shape, double range, std::set< const Named * > &into)
 
static std::pair< MSLane *, double > convertCartesianToRoadMap (const Position &pos, const SUMOVehicleClass vClass)
 
static void findObjectShape (int domain, const std::string &id, PositionVector &shape)
 
static double getDrivingDistance (std::pair< const MSLane *, double > &roadPos1, std::pair< const MSLane *, double > &roadPos2)
 
static MSEdgegetEdge (const std::string &edgeID)
 
static const MSLanegetLaneChecking (const std::string &edgeID, int laneIndex, double pos)
 
static MSPersongetPerson (const std::string &id)
 
static SUMOTrafficObjectgetTrafficObject (int domain, const std::string &id)
 
static MSBaseVehiclegetVehicle (const std::string &id)
 
static const std::vector< std::string > & getVehicleStateChanges (const MSNet::VehicleState state)
 
static const MSVehicleTypegetVehicleType (const std::string &vehicleID)
 
static void handleSubscriptions (const SUMOTime t)
 
static Position makePosition (const TraCIPosition &position)
 
static PositionVector makePositionVector (const TraCIPositionVector &vector)
 
static RGBColor makeRGBColor (const TraCIColor &color)
 
static TraCIColor makeTraCIColor (const RGBColor &color)
 
static TraCIPosition makeTraCIPosition (const Position &position, const bool includeZ=false)
 
static TraCIPositionVector makeTraCIPositionVector (const PositionVector &positionVector)
 helper functions More...
 
static bool needNewSubscription (libsumo::Subscription &s, std::vector< Subscription > &subscriptions, libsumo::Subscription *&modifiedSubscription)
 
static void postProcessRemoteControl ()
 
static void registerVehicleStateListener ()
 
static void setRemoteControlled (MSPerson *p, Position xyPos, MSLane *l, double pos, double posLat, double angle, int edgeOffset, ConstMSEdgeVector route, SUMOTime t)
 
static void setRemoteControlled (MSVehicle *v, Position xyPos, MSLane *l, double pos, double posLat, double angle, int edgeOffset, ConstMSEdgeVector route, SUMOTime t)
 
static void subscribe (const int commandId, const std::string &id, const std::vector< int > &variables, const double beginTime, const double endTime, const libsumo::TraCIResults &params, const int contextDomain=0, const double range=0.)
 
functions for moveToXY
static bool moveToXYMap (const Position &pos, double maxRouteDistance, bool mayLeaveNetwork, const std::string &origID, const double angle, double speed, const ConstMSEdgeVector &currentRoute, const int routePosition, const MSLane *currentLane, double currentLanePos, bool onRoad, SUMOVehicleClass vClass, bool setLateralPos, double &bestDistance, MSLane **lane, double &lanePos, int &routeOffset, ConstMSEdgeVector &edges)
 
static bool moveToXYMap_matchingRoutePosition (const Position &pos, const std::string &origID, const ConstMSEdgeVector &currentRoute, int routeIndex, SUMOVehicleClass vClass, bool setLateralPos, double &bestDistance, MSLane **lane, double &lanePos, int &routeOffset)
 
static bool findCloserLane (const MSEdge *edge, const Position &pos, SUMOVehicleClass vClass, double &bestDistance, MSLane **lane)
 

Private Member Functions

 Helper ()=delete
 invalidated standard constructor More...
 

Static Private Member Functions

static void debugPrint (const SUMOTrafficObject *veh)
 
static void fuseLaneCoverage (std::shared_ptr< LaneCoverageInfo > aggregatedLaneCoverage, const std::shared_ptr< LaneCoverageInfo > newLaneCoverage)
 Adds lane coverage information from newLaneCoverage into aggregatedLaneCoverage. More...
 
static void handleSingleSubscription (const Subscription &s)
 

Static Private Attributes

static LANE_RTREE_QUALmyLaneTree
 A storage of lanes. More...
 
static SubscriptionmyLastContextSubscription = nullptr
 The last context subscription. More...
 
static std::map< std::string, MSPerson * > myRemoteControlledPersons
 
static std::map< std::string, MSVehicle * > myRemoteControlledVehicles
 
static std::vector< SubscriptionmySubscriptions
 The list of known, still valid subscriptions. More...
 
static VehicleStateListener myVehicleStateListener
 Changes in the states of simulated vehicles. More...
 
static std::map< int, std::shared_ptr< VariableWrapper > > myWrapper
 Map of commandIds -> their executors; applicable if the executor applies to the method footprint. More...
 

Detailed Description

C++ TraCI client API implementation.

Definition at line 106 of file Helper.h.

Constructor & Destructor Documentation

◆ Helper()

libsumo::Helper::Helper ( )
privatedelete

invalidated standard constructor

Member Function Documentation

◆ addSubscriptionFilter()

◆ addSubscriptionParam() [1/2]

void libsumo::Helper::addSubscriptionParam ( const std::string &  param)
static

Definition at line 179 of file Helper.cpp.

References mySubscriptions.

◆ addSubscriptionParam() [2/2]

void libsumo::Helper::addSubscriptionParam ( double  param)
static

Definition at line 170 of file Helper.cpp.

References mySubscriptions.

Referenced by LIBSUMO_NAMESPACE::Vehicle::subscribeLeader().

Here is the caller graph for this function:

◆ applySubscriptionFilterFieldOfVision()

void libsumo::Helper::applySubscriptionFilterFieldOfVision ( const Subscription s,
std::set< std::string > &  objIDs 
)
static

◆ applySubscriptionFilterLateralDistanceSinglePass()

void libsumo::Helper::applySubscriptionFilterLateralDistanceSinglePass ( const Subscription s,
std::set< std::string > &  objIDs,
std::set< const SUMOTrafficObject * > &  vehs,
const std::vector< const MSLane * > &  lanes,
double  posOnLane,
double  posLat,
bool  isDownstream 
)
static

◆ applySubscriptionFilters()

void libsumo::Helper::applySubscriptionFilters ( const Subscription s,
std::set< std::string > &  objIDs 
)
static

Filter the given ID-Set (which was obtained from an R-Tree search) according to the filters set by the subscription or firstly build the object ID list if the filters rather demand searching along the road network than considering a geometric range.

Parameters
[in]sSubscription which holds the filter specification to be applied
[in/out]objIDs Set of object IDs that is to be filtered. Result is stored in place.
Note
Currently this assumes that the objects are vehicles.

Definition at line 641 of file Helper.cpp.

References libsumo::Subscription::activeFilters, applySubscriptionFilterFieldOfVision(), applySubscriptionFilterLateralDistanceSinglePass(), collectObjectIDsInRange(), libsumo::Subscription::commandId, libsumo::Subscription::contextDomain, debugPrint(), libsumo::Subscription::filterDownstreamDist, libsumo::Subscription::filterLanes, libsumo::Subscription::filterLateralDist, libsumo::Subscription::filterUpstreamDist, libsumo::Subscription::filterVClasses, libsumo::Subscription::filterVTypes, findObjectShape(), fuseLaneCoverage(), MSLink::getApproaching(), MSVehicle::getBestLanesContinuation(), MSLane::getEdge(), MSLane::getFollower(), MSVehicleType::getID(), Named::getID(), MSLane::getIndex(), MSVehicle::getLane(), SUMOTrafficObject::getLane(), MSEdge::getLanes(), MSVehicle::getLateralPositionOnLane(), MSLane::getLeader(), MSBaseVehicle::getLength(), MSEdge::getLength(), MSLane::getLength(), MSVehicleType::getLength(), MSEdge::getOppositeEdge(), MSLane::getParallelLane(), MSVehicle::getPastLanesUntil(), MSVehicle::getPositionOnLane(), MSLane::getSurroundingVehicles(), MSVehicle::getUpcomingLanesUntil(), MSLane::getUpcomingLinks(), getVehicle(), MSVehicleType::getVehicleClass(), MSLane::getVehiclesInRange(), MSBaseVehicle::getVehicleType(), libsumo::Subscription::id, MSVehicle::isOnRoad(), MAX2(), MAX3(), libsumo::Subscription::range, SIMTIME, libsumo::SUBS_FILTER_DOWNSTREAM_DIST, libsumo::SUBS_FILTER_FIELD_OF_VISION, libsumo::SUBS_FILTER_LANES, libsumo::SUBS_FILTER_LATERAL_DIST, libsumo::SUBS_FILTER_LEAD_FOLLOW, libsumo::SUBS_FILTER_MANEUVER, libsumo::SUBS_FILTER_NO_RTREE, libsumo::SUBS_FILTER_NOOPPOSITE, libsumo::SUBS_FILTER_TURN, libsumo::SUBS_FILTER_UPSTREAM_DIST, libsumo::SUBS_FILTER_VCLASS, libsumo::SUBS_FILTER_VTYPE, toString(), and WRITE_WARNING.

Referenced by handleSingleSubscription(), and TraCIServer::processSingleSubscription().

Here is the caller graph for this function:

◆ cleanup()

void libsumo::Helper::cleanup ( )
static

Definition at line 526 of file Helper.cpp.

References libsumo::POI::cleanup(), libsumo::Polygon::cleanup(), and myLaneTree.

Referenced by MSNet::clearAll().

Here is the caller graph for this function:

◆ clearSubscriptions()

void libsumo::Helper::clearSubscriptions ( )
static

Definition at line 238 of file Helper.cpp.

References myLastContextSubscription, and mySubscriptions.

Referenced by LIBSUMO_NAMESPACE::Simulation::close().

Here is the caller graph for this function:

◆ clearVehicleStates()

void libsumo::Helper::clearVehicleStates ( )
static

Definition at line 552 of file Helper.cpp.

References libsumo::Helper::VehicleStateListener::myVehicleStateChanges, and myVehicleStateListener.

Referenced by LIBSUMO_NAMESPACE::Simulation::loadState(), and LIBSUMO_NAMESPACE::Simulation::step().

Here is the caller graph for this function:

◆ collectObjectIDsInRange()

void libsumo::Helper::collectObjectIDsInRange ( int  domain,
const PositionVector shape,
double  range,
std::set< std::string > &  into 
)
static

Definition at line 593 of file Helper.cpp.

References collectObjectsInRange().

Referenced by applySubscriptionFilters(), handleSingleSubscription(), and TraCIServer::processSingleSubscription().

Here is the caller graph for this function:

◆ collectObjectsInRange()

◆ convertCartesianToRoadMap()

◆ debugPrint()

void libsumo::Helper::debugPrint ( const SUMOTrafficObject veh)
staticprivate

Definition at line 125 of file Helper.cpp.

References SUMOTrafficObject::getEdge(), Named::getID(), and SUMOTrafficObject::isVehicle().

Referenced by applySubscriptionFilters().

Here is the caller graph for this function:

◆ findCloserLane()

bool libsumo::Helper::findCloserLane ( const MSEdge edge,
const Position pos,
SUMOVehicleClass  vClass,
double &  bestDistance,
MSLane **  lane 
)
static

Definition at line 1382 of file Helper.cpp.

References MSLane::allowsVehicleClass(), PositionVector::distance2D(), Named::getID(), MSEdge::getLanes(), MSLane::getShape(), and PositionVector::length().

Referenced by moveToXYMap_matchingRoutePosition().

Here is the caller graph for this function:

◆ findObjectShape()

void libsumo::Helper::findObjectShape ( int  domain,
const std::string &  id,
PositionVector shape 
)
static

◆ fuseLaneCoverage()

void libsumo::Helper::fuseLaneCoverage ( std::shared_ptr< LaneCoverageInfo aggregatedLaneCoverage,
const std::shared_ptr< LaneCoverageInfo newLaneCoverage 
)
staticprivate

Adds lane coverage information from newLaneCoverage into aggregatedLaneCoverage.

Parameters
[in/out]aggregatedLaneCoverage - aggregated lane coverage info, to which the new will be added
[in]newLaneCoverage- new lane coverage to be added
Todo:
Disjunct ranges are not handled (LaneCoverageInfo definition would need to allow several intervals per lane) but the intermediate range is simply assimilated.

Definition at line 330 of file Helper.cpp.

References MAX2(), and MIN2().

Referenced by applySubscriptionFilters().

Here is the caller graph for this function:

◆ getDrivingDistance()

double libsumo::Helper::getDrivingDistance ( std::pair< const MSLane *, double > &  roadPos1,
std::pair< const MSLane *, double > &  roadPos2 
)
static

Definition at line 463 of file Helper.cpp.

References SUMOAbstractRouter< E, V >::compute(), MSRoute::getDistanceBetween(), MSNet::getInstance(), MSNet::getRouterTT(), libsumo::INVALID_DOUBLE_VALUE, and SIMSTEP.

Referenced by TraCIServerAPI_Simulation::commandDistanceRequest(), LIBSUMO_NAMESPACE::Simulation::getDistance2D(), and LIBSUMO_NAMESPACE::Simulation::getDistanceRoad().

Here is the caller graph for this function:

◆ getEdge()

MSEdge * libsumo::Helper::getEdge ( const std::string &  edgeID)
static

Definition at line 404 of file Helper.cpp.

References MSEdge::dictionary().

Referenced by LIBSUMO_NAMESPACE::Vehicle::getAdaptedTraveltime(), LIBSUMO_NAMESPACE::Vehicle::getDrivingDistance(), and LIBSUMO_NAMESPACE::Vehicle::getEffort().

Here is the caller graph for this function:

◆ getLaneChecking()

const MSLane * libsumo::Helper::getLaneChecking ( const std::string &  edgeID,
int  laneIndex,
double  pos 
)
static

Definition at line 414 of file Helper.cpp.

References MSEdge::dictionary(), MSEdge::getLanes(), and MSLane::getLength().

Referenced by TraCIServerAPI_Simulation::commandDistanceRequest(), TraCIServerAPI_Simulation::commandPositionConversion(), LIBSUMO_NAMESPACE::Simulation::convert2D(), LIBSUMO_NAMESPACE::Simulation::convert3D(), and LIBSUMO_NAMESPACE::Simulation::getDistanceRoad().

Here is the caller graph for this function:

◆ getPerson()

MSPerson * libsumo::Helper::getPerson ( const std::string &  id)
static

Definition at line 499 of file Helper.cpp.

References MSTransportableControl::get(), MSNet::getInstance(), and MSNet::getPersonControl().

Referenced by LIBSUMO_NAMESPACE::Person::getPerson(), and getTrafficObject().

Here is the caller graph for this function:

◆ getTrafficObject()

SUMOTrafficObject * libsumo::Helper::getTrafficObject ( int  domain,
const std::string &  id 
)
static

Definition at line 509 of file Helper.cpp.

References libsumo::CMD_GET_PERSON_VARIABLE, libsumo::CMD_GET_VEHICLE_VARIABLE, getPerson(), getVehicle(), and toString().

Referenced by applySubscriptionFilterFieldOfVision(), and applySubscriptionFilterLateralDistanceSinglePass().

Here is the caller graph for this function:

◆ getVehicle()

MSBaseVehicle * libsumo::Helper::getVehicle ( const std::string &  id)
static

Definition at line 485 of file Helper.cpp.

References MSNet::getInstance(), MSVehicleControl::getVehicle(), and MSNet::getVehicleControl().

Referenced by applySubscriptionFilterFieldOfVision(), applySubscriptionFilters(), LIBSUMO_NAMESPACE::Vehicle::changeLane(), LIBSUMO_NAMESPACE::Vehicle::changeLaneRelative(), LIBSUMO_NAMESPACE::Vehicle::changeSublane(), LIBSUMO_NAMESPACE::Vehicle::changeTarget(), LIBSUMO_NAMESPACE::Vehicle::deactivateGapControl(), LIBSUMO_NAMESPACE::Vehicle::dispatchTaxi(), LIBSUMO_NAMESPACE::Vehicle::getAcceleration(), LIBSUMO_NAMESPACE::Vehicle::getAccumulatedWaitingTime(), LIBSUMO_NAMESPACE::Vehicle::getAdaptedTraveltime(), LIBSUMO_NAMESPACE::Vehicle::getAllowedSpeed(), LIBSUMO_NAMESPACE::Vehicle::getAngle(), LIBSUMO_NAMESPACE::Vehicle::getBestLanes(), LIBSUMO_NAMESPACE::Vehicle::getCO2Emission(), LIBSUMO_NAMESPACE::Vehicle::getCOEmission(), LIBSUMO_NAMESPACE::Vehicle::getDistance(), LIBSUMO_NAMESPACE::Vehicle::getDrivingDistance(), LIBSUMO_NAMESPACE::Vehicle::getDrivingDistance2D(), LIBSUMO_NAMESPACE::Vehicle::getEffort(), LIBSUMO_NAMESPACE::Vehicle::getElectricityConsumption(), LIBSUMO_NAMESPACE::Vehicle::getFollower(), LIBSUMO_NAMESPACE::Vehicle::getFollowSpeed(), LIBSUMO_NAMESPACE::Vehicle::getFuelConsumption(), LIBSUMO_NAMESPACE::Vehicle::getHCEmission(), LIBSUMO_NAMESPACE::Vehicle::getLaneChangeMode(), LIBSUMO_NAMESPACE::Vehicle::getLaneChangeState(), LIBSUMO_NAMESPACE::Vehicle::getLaneID(), LIBSUMO_NAMESPACE::Vehicle::getLaneIndex(), LIBSUMO_NAMESPACE::Vehicle::getLanePosition(), LIBSUMO_NAMESPACE::Vehicle::getLastActionTime(), LIBSUMO_NAMESPACE::Vehicle::getLateralLanePosition(), LIBSUMO_NAMESPACE::Vehicle::getLateralSpeed(), LIBSUMO_NAMESPACE::Vehicle::getLeader(), LIBSUMO_NAMESPACE::Vehicle::getLine(), LIBSUMO_NAMESPACE::Vehicle::getNeighbors(), LIBSUMO_NAMESPACE::Vehicle::getNextTLS(), LIBSUMO_NAMESPACE::Vehicle::getNoiseEmission(), LIBSUMO_NAMESPACE::Vehicle::getNOxEmission(), LIBSUMO_NAMESPACE::Vehicle::getPersonIDList(), LIBSUMO_NAMESPACE::Vehicle::getPersonNumber(), LIBSUMO_NAMESPACE::Vehicle::getPMxEmission(), LIBSUMO_NAMESPACE::Vehicle::getPosition(), LIBSUMO_NAMESPACE::Vehicle::getRoadID(), LIBSUMO_NAMESPACE::Vehicle::getRoute(), LIBSUMO_NAMESPACE::Vehicle::getRouteID(), LIBSUMO_NAMESPACE::Vehicle::getRouteIndex(), LIBSUMO_NAMESPACE::Vehicle::getRoutingMode(), LIBSUMO_NAMESPACE::Vehicle::getSecureGap(), LIBSUMO_NAMESPACE::Vehicle::getSignals(), LIBSUMO_NAMESPACE::Vehicle::getSlope(), LIBSUMO_NAMESPACE::Vehicle::getSpeed(), LIBSUMO_NAMESPACE::Vehicle::getSpeedMode(), LIBSUMO_NAMESPACE::Vehicle::getSpeedWithoutTraCI(), LIBSUMO_NAMESPACE::Vehicle::getStopArrivalDelay(), LIBSUMO_NAMESPACE::Vehicle::getStopDelay(), LIBSUMO_NAMESPACE::Vehicle::getStops(), LIBSUMO_NAMESPACE::Vehicle::getStopSpeed(), LIBSUMO_NAMESPACE::Vehicle::getStopState(), getTrafficObject(), getVehicleType(), LIBSUMO_NAMESPACE::Vehicle::getVia(), LIBSUMO_NAMESPACE::Vehicle::getWaitingTime(), LIBSUMO_NAMESPACE::Vehicle::highlight(), LIBSUMO_NAMESPACE::Vehicle::isRouteValid(), LIBSUMO_NAMESPACE::Vehicle::moveTo(), LIBSUMO_NAMESPACE::Vehicle::moveToXY(), LIBSUMO_NAMESPACE::Vehicle::openGap(), postProcessRemoteControl(), LIBSUMO_NAMESPACE::Vehicle::remove(), LIBSUMO_NAMESPACE::Vehicle::replaceStop(), LIBSUMO_NAMESPACE::Vehicle::rerouteEffort(), LIBSUMO_NAMESPACE::Vehicle::rerouteParkingArea(), LIBSUMO_NAMESPACE::Vehicle::rerouteTraveltime(), LIBSUMO_NAMESPACE::Vehicle::resume(), LIBSUMO_NAMESPACE::Vehicle::setAdaptedTraveltime(), LIBSUMO_NAMESPACE::Vehicle::setEffort(), LIBSUMO_NAMESPACE::Vehicle::setLaneChangeMode(), LIBSUMO_NAMESPACE::Vehicle::setLine(), LIBSUMO_NAMESPACE::Vehicle::setPreviousSpeed(), LIBSUMO_NAMESPACE::Vehicle::setRoute(), LIBSUMO_NAMESPACE::Vehicle::setRouteID(), LIBSUMO_NAMESPACE::Vehicle::setRoutingMode(), LIBSUMO_NAMESPACE::Vehicle::setSignals(), LIBSUMO_NAMESPACE::Vehicle::setSpeed(), LIBSUMO_NAMESPACE::Vehicle::setSpeedMode(), LIBSUMO_NAMESPACE::Vehicle::setStop(), LIBSUMO_NAMESPACE::Vehicle::setType(), LIBSUMO_NAMESPACE::Vehicle::setVia(), LIBSUMO_NAMESPACE::Vehicle::slowDown(), LIBSUMO_NAMESPACE::Vehicle::storeShape(), and LIBSUMO_NAMESPACE::Vehicle::updateBestLanes().

◆ getVehicleStateChanges()

const std::vector< std::string > & libsumo::Helper::getVehicleStateChanges ( const MSNet::VehicleState  state)
static

Definition at line 546 of file Helper.cpp.

References libsumo::Helper::VehicleStateListener::myVehicleStateChanges, and myVehicleStateListener.

Referenced by LIBSUMO_NAMESPACE::Simulation::getArrivedIDList(), LIBSUMO_NAMESPACE::Simulation::getArrivedNumber(), LIBSUMO_NAMESPACE::Simulation::getCollidingVehiclesIDList(), LIBSUMO_NAMESPACE::Simulation::getCollidingVehiclesNumber(), LIBSUMO_NAMESPACE::Simulation::getDepartedIDList(), LIBSUMO_NAMESPACE::Simulation::getDepartedNumber(), LIBSUMO_NAMESPACE::Simulation::getEmergencyStoppingVehiclesIDList(), LIBSUMO_NAMESPACE::Simulation::getEmergencyStoppingVehiclesNumber(), LIBSUMO_NAMESPACE::Simulation::getEndingTeleportIDList(), LIBSUMO_NAMESPACE::Simulation::getEndingTeleportNumber(), LIBSUMO_NAMESPACE::Simulation::getLoadedIDList(), LIBSUMO_NAMESPACE::Simulation::getLoadedNumber(), LIBSUMO_NAMESPACE::Simulation::getParkingEndingVehiclesIDList(), LIBSUMO_NAMESPACE::Simulation::getParkingEndingVehiclesNumber(), LIBSUMO_NAMESPACE::Simulation::getParkingStartingVehiclesIDList(), LIBSUMO_NAMESPACE::Simulation::getParkingStartingVehiclesNumber(), LIBSUMO_NAMESPACE::Simulation::getStartingTeleportIDList(), LIBSUMO_NAMESPACE::Simulation::getStartingTeleportNumber(), LIBSUMO_NAMESPACE::Simulation::getStopEndingVehiclesIDList(), LIBSUMO_NAMESPACE::Simulation::getStopEndingVehiclesNumber(), LIBSUMO_NAMESPACE::Simulation::getStopStartingVehiclesIDList(), LIBSUMO_NAMESPACE::Simulation::getStopStartingVehiclesNumber(), and handleSubscriptions().

Here is the caller graph for this function:

◆ getVehicleType()

const MSVehicleType & libsumo::Helper::getVehicleType ( const std::string &  vehicleID)
static

Definition at line 520 of file Helper.cpp.

References getVehicle(), and MSBaseVehicle::getVehicleType().

Referenced by LIBSUMO_NAMESPACE::Vehicle::getTypeID().

Here is the caller graph for this function:

◆ handleSingleSubscription()

◆ handleSubscriptions()

◆ makePosition()

Position libsumo::Helper::makePosition ( const TraCIPosition position)
static

◆ makePositionVector()

PositionVector libsumo::Helper::makePositionVector ( const TraCIPositionVector vector)
static

Definition at line 358 of file Helper.cpp.

Referenced by libsumo::Polygon::add(), and libsumo::Polygon::setShape().

Here is the caller graph for this function:

◆ makeRGBColor()

RGBColor libsumo::Helper::makeRGBColor ( const TraCIColor color)
static

Definition at line 382 of file Helper.cpp.

References libsumo::TraCIColor::a, libsumo::TraCIColor::b, libsumo::TraCIColor::g, and libsumo::TraCIColor::r.

Referenced by libsumo::POI::add(), libsumo::Polygon::add(), libsumo::POI::setColor(), and libsumo::Polygon::setColor().

Here is the caller graph for this function:

◆ makeTraCIColor()

TraCIColor libsumo::Helper::makeTraCIColor ( const RGBColor color)
static

Definition at line 371 of file Helper.cpp.

References libsumo::TraCIColor::a, RGBColor::alpha(), libsumo::TraCIColor::b, RGBColor::blue(), libsumo::TraCIColor::g, RGBColor::green(), libsumo::TraCIColor::r, and RGBColor::red().

Referenced by libsumo::POI::getColor(), and libsumo::Polygon::getColor().

Here is the caller graph for this function:

◆ makeTraCIPosition()

◆ makeTraCIPositionVector()

TraCIPositionVector libsumo::Helper::makeTraCIPositionVector ( const PositionVector positionVector)
static

helper functions

Definition at line 348 of file Helper.cpp.

References makeTraCIPosition().

Referenced by LIBSUMO_NAMESPACE::Junction::getShape(), libsumo::Polygon::getShape(), libsumo::POI::highlight(), LIBSUMO_NAMESPACE::Vehicle::highlight(), and TraCIServerAPI_Polygon::processSet().

Here is the caller graph for this function:

◆ moveToXYMap()

bool libsumo::Helper::moveToXYMap ( const Position pos,
double  maxRouteDistance,
bool  mayLeaveNetwork,
const std::string &  origID,
const double  angle,
double  speed,
const ConstMSEdgeVector currentRoute,
const int  routePosition,
const MSLane currentLane,
double  currentLanePos,
bool  onRoad,
SUMOVehicleClass  vClass,
bool  setLateralPos,
double &  bestDistance,
MSLane **  lane,
double &  lanePos,
int &  routeOffset,
ConstMSEdgeVector edges 
)
static

◆ moveToXYMap_matchingRoutePosition()

bool libsumo::Helper::moveToXYMap_matchingRoutePosition ( const Position pos,
const std::string &  origID,
const ConstMSEdgeVector currentRoute,
int  routeIndex,
SUMOVehicleClass  vClass,
bool  setLateralPos,
double &  bestDistance,
MSLane **  lane,
double &  lanePos,
int &  routeOffset 
)
static

Definition at line 1413 of file Helper.cpp.

References libsumo::CMD_GET_LANE_VARIABLE, collectObjectsInRange(), findCloserLane(), MSLane::getEdge(), MSEdge::getInternalFollowingEdge(), MSEdge::getToJunction(), MSEdge::isCrossing(), MSEdge::isWalkingArea(), MAX2(), MIN2(), SIMTIME, SUMO_PARAM_ORIGID, SVC_PEDESTRIAN, and toString().

Referenced by LIBSUMO_NAMESPACE::Person::moveToXY(), and LIBSUMO_NAMESPACE::Vehicle::moveToXY().

Here is the caller graph for this function:

◆ needNewSubscription()

bool libsumo::Helper::needNewSubscription ( libsumo::Subscription s,
std::vector< Subscription > &  subscriptions,
libsumo::Subscription *&  modifiedSubscription 
)
static

Definition at line 213 of file Helper.cpp.

References libsumo::Subscription::beginTime, libsumo::Subscription::commandId, libsumo::Subscription::contextDomain, libsumo::Subscription::endTime, libsumo::Subscription::id, libsumo::Subscription::parameters, libsumo::Subscription::range, and libsumo::Subscription::variables.

Referenced by TraCIServer::initialiseSubscription(), and subscribe().

Here is the caller graph for this function:

◆ postProcessRemoteControl()

void libsumo::Helper::postProcessRemoteControl ( )
static

Definition at line 1102 of file Helper.cpp.

References MSNet::getInstance(), getVehicle(), myRemoteControlledPersons, myRemoteControlledVehicles, and WRITE_WARNING.

Referenced by MSNet::simulationStep().

Here is the caller graph for this function:

◆ registerVehicleStateListener()

void libsumo::Helper::registerVehicleStateListener ( )
static

Definition at line 538 of file Helper.cpp.

References MSNet::addVehicleStateListener(), MSNet::getInstance(), MSNet::hasInstance(), and myVehicleStateListener.

Referenced by NLBuilder::init().

Here is the caller graph for this function:

◆ setRemoteControlled() [1/2]

void libsumo::Helper::setRemoteControlled ( MSPerson p,
Position  xyPos,
MSLane l,
double  pos,
double  posLat,
double  angle,
int  edgeOffset,
ConstMSEdgeVector  route,
SUMOTime  t 
)
static

◆ setRemoteControlled() [2/2]

void libsumo::Helper::setRemoteControlled ( MSVehicle v,
Position  xyPos,
MSLane l,
double  pos,
double  posLat,
double  angle,
int  edgeOffset,
ConstMSEdgeVector  route,
SUMOTime  t 
)
static

Definition at line 1087 of file Helper.cpp.

References Named::getID(), MSVehicle::getInfluencer(), myRemoteControlledVehicles, and MSVehicle::Influencer::setRemoteControlled().

Referenced by LIBSUMO_NAMESPACE::Person::moveToXY(), and LIBSUMO_NAMESPACE::Vehicle::moveToXY().

Here is the caller graph for this function:

◆ subscribe()

void libsumo::Helper::subscribe ( const int  commandId,
const std::string &  id,
const std::vector< int > &  variables,
const double  beginTime,
const double  endTime,
const libsumo::TraCIResults params,
const int  contextDomain = 0,
const double  range = 0. 
)
static

Field Documentation

◆ myLaneTree

LANE_RTREE_QUAL * libsumo::Helper::myLaneTree
staticprivate

A storage of lanes.

Definition at line 275 of file Helper.h.

Referenced by cleanup(), and collectObjectsInRange().

◆ myLastContextSubscription

Subscription * libsumo::Helper::myLastContextSubscription = nullptr
staticprivate

The last context subscription.

Definition at line 266 of file Helper.h.

Referenced by addSubscriptionFilter(), clearSubscriptions(), and subscribe().

◆ myRemoteControlledPersons

std::map< std::string, MSPerson * > libsumo::Helper::myRemoteControlledPersons
staticprivate

Definition at line 278 of file Helper.h.

Referenced by postProcessRemoteControl(), and setRemoteControlled().

◆ myRemoteControlledVehicles

std::map< std::string, MSVehicle * > libsumo::Helper::myRemoteControlledVehicles
staticprivate

Definition at line 277 of file Helper.h.

Referenced by postProcessRemoteControl(), and setRemoteControlled().

◆ mySubscriptions

std::vector< Subscription > libsumo::Helper::mySubscriptions
staticprivate

The list of known, still valid subscriptions.

Definition at line 263 of file Helper.h.

Referenced by addSubscriptionParam(), clearSubscriptions(), handleSubscriptions(), and subscribe().

◆ myVehicleStateListener

Helper::VehicleStateListener libsumo::Helper::myVehicleStateListener
staticprivate

Changes in the states of simulated vehicles.

Definition at line 272 of file Helper.h.

Referenced by clearVehicleStates(), getVehicleStateChanges(), and registerVehicleStateListener().

◆ myWrapper

std::map< int, std::shared_ptr< VariableWrapper > > libsumo::Helper::myWrapper
staticprivate

Map of commandIds -> their executors; applicable if the executor applies to the method footprint.

Definition at line 269 of file Helper.h.

Referenced by handleSingleSubscription(), and handleSubscriptions().


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