![]() |
SUMO - Simulation of Urban MObility
|
C++ TraCI client API implementation. More...
#include <TraCI.h>
Public Types | |
typedef std::map< std::string, SubscribedValues > | SubscribedContextValues |
typedef std::map< std::string, TraCIValues > | SubscribedValues |
typedef std::map< int, TraCIValue > | TraCIValues |
{object->{variable->value}} More... | |
Public Member Functions | |
const SubscribedContextValues & | getContextSubscriptionResults () const |
const SubscribedValues & | getContextSubscriptionResults (const std::string &objID) const |
const SubscribedValues & | getSubscriptionResults () const |
const TraCIValues & | getSubscriptionResults (const std::string &objID) const |
void | simulationStep (SUMOTime time=0) |
Advances by one step (or up to the given time) More... | |
Connection handling | |
void | close () |
Connects to the specified SUMO server. More... | |
Static Public Member Functions | |
static std::pair< MSLane *, double > | convertCartesianToRoadMap (Position pos) |
static MSEdge * | getEdge (const std::string &edgeID) |
static const MSLane * | getLaneChecking (const std::string &edgeID, int laneIndex, double pos) |
static std::vector< std::string > & | getLoadArgs () |
static void | load (const std::vector< std::string > &args) |
load a simulation 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... | |
Private Member Functions | |
TraCI & | operator= (const TraCI &src) |
invalidated assignment operator More... | |
TraCI (const TraCI &src) | |
invalidated copy constructor More... | |
Private Attributes | |
SubscribedContextValues | mySubscribedContextValues |
SubscribedValues | mySubscribedValues |
Static Private Attributes | |
static std::vector< std::string > | myLoadArgs |
typedef std::map<std::string, SubscribedValues> TraCI::SubscribedContextValues |
typedef std::map<std::string, TraCIValues> TraCI::SubscribedValues |
typedef std::map<int, TraCIValue> TraCI::TraCIValues |
|
private |
invalidated copy constructor
Referenced by getLoadArgs().
void TraCI::close | ( | ) |
Connects to the specified SUMO server.
[in] | host | The name of the host to connect to |
[in] | port | The port to connect to |
tcpip::SocketException | if the connection failsends the simulation and closes the connection |
XXX use rtree instead
Definition at line 185 of file TraCI.cpp.
References MSEdge::dictionary(), MSNet::getEdgeControl(), MSEdgeControl::getEdgeNames(), MSNet::getInstance(), and max.
Referenced by TraCI_Vehicle::getDrivingDistance2D().
const TraCI::SubscribedContextValues & TraCI::getContextSubscriptionResults | ( | ) | const |
Definition at line 93 of file TraCI.cpp.
References mySubscribedContextValues.
const TraCI::SubscribedValues & TraCI::getContextSubscriptionResults | ( | const std::string & | objID | ) | const |
Definition at line 98 of file TraCI.cpp.
References mySubscribedContextValues.
|
static |
Definition at line 160 of file TraCI.cpp.
References MSEdge::dictionary().
Referenced by TraCI_Vehicle::getAdaptedTraveltime(), TraCI_Vehicle::getDrivingDistance(), and TraCI_Vehicle::getEffort().
|
static |
Definition at line 169 of file TraCI.cpp.
References MSEdge::dictionary(), MSEdge::getLanes(), and MSLane::getLength().
Referenced by TraCIServerAPI_Simulation::commandDistanceRequest(), and TraCIServerAPI_Simulation::commandPositionConversion().
|
inlinestatic |
Definition at line 103 of file TraCI.h.
References myLoadArgs, operator=(), and TraCI().
Referenced by GUIRunThread::makeStep(), MSNet::simulate(), and MSNet::simulationState().
const TraCI::SubscribedValues & TraCI::getSubscriptionResults | ( | ) | const |
Definition at line 79 of file TraCI.cpp.
References mySubscribedValues.
const TraCI::TraCIValues & TraCI::getSubscriptionResults | ( | const std::string & | objID | ) | const |
Definition at line 84 of file TraCI.cpp.
References mySubscribedValues.
|
static |
load a simulation with the given arguments
Definition at line 61 of file TraCI.cpp.
References myLoadArgs.
Referenced by TraCIServer::dispatchCommand().
|
static |
Definition at line 153 of file TraCI.cpp.
References Position::set(), TraCIPosition::x, TraCIPosition::y, and TraCIPosition::z.
Referenced by TraCI_POI::add(), and TraCI_POI::setPosition().
|
static |
Definition at line 118 of file TraCI.cpp.
Referenced by TraCI_Polygon::add(), and TraCI_Polygon::setShape().
|
static |
Definition at line 138 of file TraCI.cpp.
References TraCIColor::a, TraCIColor::b, TraCIColor::g, and TraCIColor::r.
Referenced by TraCI_Polygon::add(), TraCI_POI::add(), TraCI_Polygon::setColor(), TraCI_POI::setColor(), and TraCI_VehicleType::setColor().
|
static |
Definition at line 128 of file TraCI.cpp.
References TraCIColor::a, RGBColor::alpha(), TraCIColor::b, RGBColor::blue(), TraCIColor::g, RGBColor::green(), TraCIColor::r, and RGBColor::red().
Referenced by TraCI_Polygon::getColor(), TraCI_VehicleType::getColor(), TraCI_POI::getColor(), and TraCI_Vehicle::getColor().
|
static |
Definition at line 144 of file TraCI.cpp.
References Position::x(), TraCIPosition::x, Position::y(), TraCIPosition::y, TraCIPosition::z, and Position::z().
Referenced by TraCI_Junction::getPosition(), TraCI_Vehicle::getPosition(), and makeTraCIPositionVector().
|
static |
helper functions
Definition at line 108 of file TraCI.cpp.
References makeTraCIPosition().
Referenced by TraCI_Polygon::getShape(), TraCI_Junction::getShape(), and TraCIServerAPI_Polygon::processSet().
invalidated assignment operator
Referenced by getLoadArgs().
void TraCI::simulationStep | ( | SUMOTime | time = 0 | ) |
Advances by one step (or up to the given time)
|
staticprivate |
Definition at line 117 of file TraCI.h.
Referenced by getLoadArgs(), and load().
|
private |
Definition at line 115 of file TraCI.h.
Referenced by getContextSubscriptionResults().
|
private |
Definition at line 114 of file TraCI.h.
Referenced by getSubscriptionResults().