![]() |
SUMO - Simulation of Urban MObility
|
#include <Helper.h>
Data Structures | |
class | LaneUtility |
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 | |
void | close () |
Connects to the specified SUMO server. More... | |
const SubscribedContextValues & | getContextSubscriptionResults () const |
const SubscribedValues & | getContextSubscriptionResults (const std::string &objID) const |
const SubscribedValues & | getSubscriptionResults () const |
const TraCIValues & | getSubscriptionResults (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< TraCIStage > | 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 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 MSEdge * | getEdge (const std::string &edgeID) |
static const MSLane * | getLaneChecking (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 ¤tRoute, 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 ¤tRoute, 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... | |
Helper & | operator= (const Helper &src) |
invalidated assignment operator More... | |
Private Attributes | |
SubscribedContextValues | mySubscribedContextValues |
SubscribedValues | mySubscribedValues |
Static Private Attributes | |
static LANE_RTREE_QUAL * | myLaneTree |
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 |
typedef std::map<std::string, SubscribedValues> libsumo::Helper::SubscribedContextValues |
typedef std::map<std::string, TraCIValues> libsumo::Helper::SubscribedValues |
typedef std::map<int, TraCIValue> libsumo::Helper::TraCIValues |
|
private |
invalidated standard constructor
|
private |
invalidated copy constructor
|
static |
Definition at line 215 of file Helper.cpp.
Referenced by MSNet::clearAll().
void libsumo::Helper::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 Helper and closes the connection |
|
static |
Definition at line 226 of file Helper.cpp.
References CMD_GET_EDGE_VARIABLE, CMD_GET_INDUCTIONLOOP_VARIABLE, CMD_GET_JUNCTION_VARIABLE, CMD_GET_LANE_VARIABLE, CMD_GET_PERSON_VARIABLE, CMD_GET_POI_VARIABLE, CMD_GET_POLYGON_VARIABLE, CMD_GET_VEHICLE_VARIABLE, MSLane::fill(), PositionVector::getBoxBoundary(), Boundary::grow(), LANE_RTREE_QUAL, MSLane::visit(), Boundary::xmax(), Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().
Referenced by TraCIServer::processSingleSubscription().
XXX use rtree instead
Definition at line 192 of file Helper.cpp.
References MSEdge::dictionary(), MSNet::getEdgeControl(), MSEdgeControl::getEdgeNames(), and MSNet::getInstance().
Referenced by libsumo::Vehicle::getDrivingDistance2D().
|
static |
Definition at line 506 of file Helper.cpp.
References PositionVector::distance2D(), Named::getID(), MSEdge::getLanes(), MSLane::getShape(), and POSITION_EPS.
|
static |
|
static |
const SubscribedContextValues& libsumo::Helper::getContextSubscriptionResults | ( | ) | const |
const SubscribedValues& libsumo::Helper::getContextSubscriptionResults | ( | const std::string & | objID | ) | const |
|
static |
|
static |
|
static |
Definition at line 165 of file Helper.cpp.
References MSEdge::dictionary().
Referenced by libsumo::Vehicle::getAdaptedTraveltime(), libsumo::Vehicle::getDrivingDistance(), and libsumo::Vehicle::getEffort().
|
static |
Definition at line 175 of file Helper.cpp.
References MSEdge::dictionary(), MSEdge::getLanes(), and MSLane::getLength().
Referenced by TraCIServerAPI_Simulation::commandDistanceRequest(), and TraCIServerAPI_Simulation::commandPositionConversion().
|
static |
|
static |
|
static |
const SubscribedValues& libsumo::Helper::getSubscriptionResults | ( | ) | const |
const TraCIValues& libsumo::Helper::getSubscriptionResults | ( | const std::string & | objID | ) | const |
|
static |
Advances by one step (or up to the given time)
|
static |
load a Helper with the given arguments
|
static |
Definition at line 157 of file Helper.cpp.
References Position::set(), libsumo::TraCIPosition::x, libsumo::TraCIPosition::y, and libsumo::TraCIPosition::z.
Referenced by libsumo::POI::add(), and libsumo::POI::setPosition().
|
static |
Definition at line 120 of file Helper.cpp.
Referenced by libsumo::Polygon::add(), and libsumo::Polygon::setShape().
|
static |
Definition at line 141 of file Helper.cpp.
References libsumo::TraCIColor::a, libsumo::TraCIColor::b, libsumo::TraCIColor::g, and libsumo::TraCIColor::r.
Referenced by libsumo::Polygon::add(), libsumo::POI::add(), libsumo::Polygon::setColor(), libsumo::POI::setColor(), and libsumo::VehicleType::setColor().
|
static |
Definition at line 130 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::Polygon::getColor(), libsumo::POI::getColor(), libsumo::VehicleType::getColor(), and libsumo::Vehicle::getColor().
|
static |
Definition at line 147 of file Helper.cpp.
References Position::x(), libsumo::TraCIPosition::x, Position::y(), libsumo::TraCIPosition::y, Position::z(), and libsumo::TraCIPosition::z.
Referenced by libsumo::Junction::getPosition(), and libsumo::Vehicle::getPosition().
|
static |
helper functions
Definition at line 110 of file Helper.cpp.
Referenced by libsumo::Polygon::getShape(), libsumo::Junction::getShape(), and TraCIServerAPI_Polygon::processSet().
|
static |
Definition at line 319 of file Helper.cpp.
References libsumo::Helper::LaneUtility::angleDiff, CMD_GET_EDGE_VARIABLE, MSEdge::dictionary(), libsumo::Helper::LaneUtility::dist, PositionVector::distance2D(), FAR_AWAY, MSLane::getEdge(), Named::getID(), Named::getIDSecure(), MSEdge::getLanes(), MSLane::getLength(), MSEdge::getLength(), MSLane::getLogicalPredecessorLane(), GeomHelper::getMinAngleDiff(), Parameterised::getParameter(), MSLane::getShape(), MSEdge::getSuccessors(), libsumo::Helper::LaneUtility::ID, INVALID_DOUBLE_VALUE, GeomHelper::INVALID_OFFSET, MSEdge::isInternal(), MAX2(), MIN2(), GeomHelper::naviDegree(), PositionVector::nearest_offset_to_point2D(), libsumo::Helper::LaneUtility::nextEdge, libsumo::Helper::LaneUtility::onRoute, libsumo::Helper::LaneUtility::prevEdge, PositionVector::rotationAtOffset(), libsumo::Helper::LaneUtility::sameEdge, SPEED2DIST, SUMO_const_laneWidth, and SUMO_PARAM_ORIGID.
Referenced by libsumo::Person::moveToXY(), and libsumo::Vehicle::moveToXY().
|
static |
Definition at line 529 of file Helper.cpp.
References MSEdge::getInternalFollowingEdge(), MAX2(), MIN2(), POSITION_EPS, and SUMO_PARAM_ORIGID.
Referenced by libsumo::Person::moveToXY(), and libsumo::Vehicle::moveToXY().
|
static |
Definition at line 298 of file Helper.cpp.
References MSNet::getInstance(), and WRITE_WARNING.
Referenced by MSNet::simulationStep().
|
static |
Definition at line 283 of file Helper.cpp.
References MSBaseVehicle::getID(), MSVehicle::getInfluencer(), and MSVehicle::Influencer::setRemoteControlled().
Referenced by libsumo::Person::moveToXY(), and libsumo::Vehicle::moveToXY().
|
static |
Definition at line 290 of file Helper.cpp.
References MSTransportable::getID(), MSPerson::getInfluencer(), and MSPerson::Influencer::setRemoteControlled().
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |
|
private |