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

#include <Helper.h>

Collaboration diagram for libsumo::Helper:
Collaboration graph

Data Structures

class  LaneUtility
 

Public Types

typedef std::map< std::string, SubscribedValuesSubscribedContextValues
 
typedef std::map< std::string, TraCIValuesSubscribedValues
 
typedef std::map< int, TraCIValueTraCIValues
 {object->{variable->value}} More...
 

Public Member Functions

void close ()
 Connects to the specified SUMO server. More...
 
const SubscribedContextValuesgetContextSubscriptionResults () const
 
const SubscribedValuesgetContextSubscriptionResults (const std::string &objID) const
 
const SubscribedValuesgetSubscriptionResults () const
 
const TraCIValuesgetSubscriptionResults (const std::string &objID) const
 

Static Public Member Functions

static void cleanup ()
 
static void collectObjectsInRange (int domain, const PositionVector &shape, double range, std::set< std::string > &into)
 
static std::pair< MSLane *, double > convertCartesianToRoadMap (Position pos)
 
static std::vector< TraCIStagefindIntermodalRoute (const std::string &from, const std::string &to, const std::string &modes, const SUMOTime depart, const int routingMode, const double speed, const double walkFactor, const double departPos, const double arrivalPos, const double departPosLat, const std::string &pType, const std::string &vehType)
 
static TraCIStage findRoute (const std::string &from, const std::string &to, const std::string &typeID, const SUMOTime depart, const int routingMode)
 
static SUMOTime getCurrentTime ()
 
static SUMOTime getDeltaT ()
 
static MSEdgegetEdge (const std::string &edgeID)
 
static const MSLanegetLaneChecking (const std::string &edgeID, int laneIndex, double pos)
 
static int getMinExpectedNumber ()
 
static TraCIBoundary getNetBoundary ()
 
static std::string getParameter (const std::string &objectID, const std::string &key)
 
static void HelperStep (const SUMOTime time=0)
 Advances by one step (or up to the given time) More...
 
static void load (const std::vector< std::string > &args)
 load a Helper with the given arguments More...
 
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)
 
static TraCIPositionVector makeTraCIPositionVector (const PositionVector &positionVector)
 helper functions More...
 
static void postProcessRemoteControl ()
 
static void setRemoteControlled (MSVehicle *v, Position xyPos, MSLane *l, double pos, double posLat, double angle, int edgeOffset, ConstMSEdgeVector route, SUMOTime t)
 
static void setRemoteControlled (MSPerson *p, Position xyPos, MSLane *l, double pos, double posLat, double angle, int edgeOffset, ConstMSEdgeVector route, SUMOTime t)
 
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, MSLane *currentLane, double currentLanePos, bool onRoad, 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, double &bestDistance, MSLane **lane, double &lanePos, int &routeOffset)
 
static bool findCloserLane (const MSEdge *edge, const Position &pos, double &bestDistance, MSLane **lane)
 

Private Member Functions

 Helper ()
 invalidated standard constructor More...
 
 Helper (const Helper &src)
 invalidated copy constructor More...
 
Helperoperator= (const Helper &src)
 invalidated assignment operator More...
 

Private Attributes

SubscribedContextValues mySubscribedContextValues
 
SubscribedValues mySubscribedValues
 

Static Private Attributes

static LANE_RTREE_QUALmyLaneTree
 A storage of lanes. More...
 
static std::map< int, NamedRTree * > myObjects
 A storage of objects. More...
 
static std::map< std::string, MSPerson * > myRemoteControlledPersons
 
static std::map< std::string, MSVehicle * > myRemoteControlledVehicles
 

Detailed Description

Definition at line 108 of file Helper.h.

Member Typedef Documentation

◆ SubscribedContextValues

Definition at line 131 of file Helper.h.

◆ SubscribedValues

typedef std::map<std::string, TraCIValues> libsumo::Helper::SubscribedValues

Definition at line 130 of file Helper.h.

◆ TraCIValues

typedef std::map<int, TraCIValue> libsumo::Helper::TraCIValues

{object->{variable->value}}

Definition at line 129 of file Helper.h.

Constructor & Destructor Documentation

◆ Helper() [1/2]

libsumo::Helper::Helper ( )
private

invalidated standard constructor

◆ Helper() [2/2]

libsumo::Helper::Helper ( const Helper src)
private

invalidated copy constructor

Member Function Documentation

◆ cleanup()

void Helper::cleanup ( )
static

Definition at line 215 of file Helper.cpp.

Referenced by MSNet::clearAll().

◆ close()

void libsumo::Helper::close ( )

Connects to the specified SUMO server.

Parameters
[in]hostThe name of the host to connect to
[in]portThe port to connect to
Exceptions
tcpip::SocketExceptionif the connection failsends the Helper and closes the connection

◆ collectObjectsInRange()

◆ convertCartesianToRoadMap()

std::pair< MSLane *, double > Helper::convertCartesianToRoadMap ( Position  pos)
static

◆ findCloserLane()

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

◆ findIntermodalRoute()

static std::vector<TraCIStage> libsumo::Helper::findIntermodalRoute ( const std::string &  from,
const std::string &  to,
const std::string &  modes,
const SUMOTime  depart,
const int  routingMode,
const double  speed,
const double  walkFactor,
const double  departPos,
const double  arrivalPos,
const double  departPosLat,
const std::string &  pType,
const std::string &  vehType 
)
static

◆ findRoute()

static TraCIStage libsumo::Helper::findRoute ( const std::string &  from,
const std::string &  to,
const std::string &  typeID,
const SUMOTime  depart,
const int  routingMode 
)
static

◆ getContextSubscriptionResults() [1/2]

const SubscribedContextValues& libsumo::Helper::getContextSubscriptionResults ( ) const

◆ getContextSubscriptionResults() [2/2]

const SubscribedValues& libsumo::Helper::getContextSubscriptionResults ( const std::string &  objID) const

◆ getCurrentTime()

static SUMOTime libsumo::Helper::getCurrentTime ( )
static

◆ getDeltaT()

static SUMOTime libsumo::Helper::getDeltaT ( )
static

◆ getEdge()

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

◆ getLaneChecking()

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

◆ getMinExpectedNumber()

static int libsumo::Helper::getMinExpectedNumber ( )
static

◆ getNetBoundary()

static TraCIBoundary libsumo::Helper::getNetBoundary ( )
static

◆ getParameter()

static std::string libsumo::Helper::getParameter ( const std::string &  objectID,
const std::string &  key 
)
static

◆ getSubscriptionResults() [1/2]

const SubscribedValues& libsumo::Helper::getSubscriptionResults ( ) const

◆ getSubscriptionResults() [2/2]

const TraCIValues& libsumo::Helper::getSubscriptionResults ( const std::string &  objID) const

◆ HelperStep()

static void libsumo::Helper::HelperStep ( const SUMOTime  time = 0)
static

Advances by one step (or up to the given time)

◆ load()

static void libsumo::Helper::load ( const std::vector< std::string > &  args)
static

load a Helper with the given arguments

◆ makePosition()

Position Helper::makePosition ( const TraCIPosition position)
static

◆ makePositionVector()

PositionVector Helper::makePositionVector ( const TraCIPositionVector vector)
static

Definition at line 120 of file Helper.cpp.

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

◆ makeRGBColor()

◆ makeTraCIColor()

◆ makeTraCIPosition()

◆ makeTraCIPositionVector()

TraCIPositionVector Helper::makeTraCIPositionVector ( const PositionVector positionVector)
static

helper functions

Definition at line 110 of file Helper.cpp.

Referenced by libsumo::Polygon::getShape(), libsumo::Junction::getShape(), and TraCIServerAPI_Polygon::processSet().

◆ moveToXYMap()

◆ moveToXYMap_matchingRoutePosition()

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

◆ operator=()

Helper& libsumo::Helper::operator= ( const Helper src)
private

invalidated assignment operator

◆ postProcessRemoteControl()

void Helper::postProcessRemoteControl ( )
static

Definition at line 298 of file Helper.cpp.

References MSNet::getInstance(), and WRITE_WARNING.

Referenced by MSNet::simulationStep().

◆ setRemoteControlled() [1/2]

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

◆ setRemoteControlled() [2/2]

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

Field Documentation

◆ myLaneTree

LANE_RTREE_QUAL * Helper::myLaneTree
staticprivate

A storage of lanes.

Definition at line 226 of file Helper.h.

◆ myObjects

std::map< int, NamedRTree * > Helper::myObjects
staticprivate

A storage of objects.

Definition at line 223 of file Helper.h.

◆ myRemoteControlledPersons

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

Definition at line 229 of file Helper.h.

◆ myRemoteControlledVehicles

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

Definition at line 228 of file Helper.h.

◆ mySubscribedContextValues

SubscribedContextValues libsumo::Helper::mySubscribedContextValues
private

Definition at line 220 of file Helper.h.

◆ mySubscribedValues

SubscribedValues libsumo::Helper::mySubscribedValues
private

Definition at line 219 of file Helper.h.


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