58 static void subscribe(
const int commandId,
const std::string&
id,
const std::vector<int>& variables,
60 const int contextDomain = 0,
const double range = 0.);
82 static double getDrivingDistance(std::pair<const MSLane*, double>& roadPos1, std::pair<const MSLane*, double>& roadPos2);
92 double pos,
int laneIndex,
double startPos,
int flags,
double duration,
double until);
123 double downstreamDist,
double upstreamDist,
bool disregardOppositeDirection);
146 double upstreamDist,
double lateralDist);
149 std::set<std::string>& objIDs,
150 std::set<const SUMOTrafficObject*>& vehs,
151 const std::vector<const MSLane*>& lanes,
152 double posOnLane,
double posLat,
bool isDownstream);
177 static bool moveToXYMap(
const Position& pos,
double maxRouteDistance,
bool mayLeaveNetwork,
const std::string& origID,
178 const double angle,
double speed,
const ConstMSEdgeVector& currentRoute,
const int routePosition,
179 const MSLane* currentLane,
double currentLanePos,
bool onRoad,
SUMOVehicleClass vClass,
bool setLateralPos,
185 double& bestDistance,
MSLane** lane,
double& lanePos,
int& routeOffset);
191 LaneUtility(
double dist_,
double perpendicularDist_,
double lanePos_,
double angleDiff_,
bool ID_,
192 bool onRoute_,
bool sameEdge_,
const MSEdge* prevEdge_,
const MSEdge* nextEdge_) :
212 void setContext(
const std::string*
const refID);
214 bool wrapDouble(
const std::string& objID,
const int variable,
const double value);
215 bool wrapInt(
const std::string& objID,
const int variable,
const int value);
216 bool wrapString(
const std::string& objID,
const int variable,
const std::string& value);
217 bool wrapStringList(
const std::string& objID,
const int variable,
const std::vector<std::string>& value);
218 bool wrapDoubleList(
const std::string& objID,
const int variable,
const std::vector<double>& value);
222 bool wrapStringDoublePair(
const std::string& objID,
const int variable,
const std::pair<std::string, double>& value);
223 bool wrapStringPair(
const std::string& objID,
const int variable,
const std::pair<std::string, std::string>& value);
224 void empty(
const std::string& objID);
242 static void fuseLaneCoverage(std::shared_ptr<LaneCoverageInfo> aggregatedLaneCoverage,
const std::shared_ptr<LaneCoverageInfo> newLaneCoverage);
268 static std::map<int, std::shared_ptr<VariableWrapper> >
myWrapper;
std::vector< const MSEdge * > ConstMSEdgeVector
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
SumoXMLTag
Numbers representing SUMO-XML - element names.
The base class for microscopic and mesoscopic vehicles.
Calibrates the flow on a segment to a specified one.
A road/street connecting two junctions.
Representation of a lane in the micro simulation.
Interface for objects listening to transportable state changes.
Interface for objects listening to vehicle state changes.
VehicleState
Definition of a vehicle state.
TransportableState
Definition of a transportable state.
A lane area vehicles can halt at.
Storage for all programs of a single tls.
Representation of a vehicle in the micro simulation.
The car-following model and parameter.
A point in 2D or 3D with translation and scaling methods.
Representation of a vehicle, person, or container.
Representation of a vehicle.
Definition of vehicle stop (position and duration)
LaneUtility(double dist_, double perpendicularDist_, double lanePos_, double angleDiff_, bool ID_, bool onRoute_, bool sameEdge_, const MSEdge *prevEdge_, const MSEdge *nextEdge_)
SubscriptionResults & myResults
bool wrapDouble(const std::string &objID, const int variable, const double value)
void empty(const std::string &objID)
bool wrapPositionVector(const std::string &objID, const int variable, const TraCIPositionVector &value)
bool wrapColor(const std::string &objID, const int variable, const TraCIColor &value)
bool wrapInt(const std::string &objID, const int variable, const int value)
bool wrapStringList(const std::string &objID, const int variable, const std::vector< std::string > &value)
SubscriptionWrapper & operator=(const SubscriptionWrapper &s)=delete
Invalidated assignment operator.
bool wrapPosition(const std::string &objID, const int variable, const TraCIPosition &value)
bool wrapString(const std::string &objID, const int variable, const std::string &value)
bool wrapStringPair(const std::string &objID, const int variable, const std::pair< std::string, std::string > &value)
bool wrapStringDoublePair(const std::string &objID, const int variable, const std::pair< std::string, double > &value)
ContextSubscriptionResults & myContextResults
SubscriptionResults * myActiveResults
void setContext(const std::string *const refID)
bool wrapDoubleList(const std::string &objID, const int variable, const std::vector< double > &value)
void transportableStateChanged(const MSTransportable *const transportable, MSNet::TransportableState to, const std::string &info="")
Called if a transportable changes its state.
std::map< MSNet::TransportableState, std::vector< std::string > > myTransportableStateChanges
Changes in the states of simulated transportables.
std::map< MSNet::VehicleState, std::vector< std::string > > myVehicleStateChanges
Changes in the states of simulated vehicles.
void vehicleStateChanged(const SUMOVehicle *const vehicle, MSNet::VehicleState to, const std::string &info="")
Called if a vehicle changes its state.
C++ TraCI client API implementation.
static Position makePosition(const TraCIPosition &position)
static MSEdge * getEdge(const std::string &edgeID)
static double getDrivingDistance(std::pair< const MSLane *, double > &roadPos1, std::pair< const MSLane *, double > &roadPos2)
static void collectObjectsInRange(int domain, const PositionVector &shape, double range, std::set< const Named * > &into)
static MSCalibrator::AspiredState getCalibratorState(const MSCalibrator *c)
static TraCIPosition makeTraCIPosition(const Position &position, const bool includeZ=false)
static LANE_RTREE_QUAL * myLaneTree
A lookup tree of lanes.
static void applySubscriptionFilterTurn(const Subscription &s, std::set< const SUMOTrafficObject * > &vehs)
Apply the subscription filter "turn": Gather upcoming junctions and vialanes within downstream distan...
static void findObjectShape(int domain, const std::string &id, PositionVector &shape)
static void clearStateChanges()
static PositionVector makePositionVector(const TraCIPositionVector &vector)
static void fuseLaneCoverage(std::shared_ptr< LaneCoverageInfo > aggregatedLaneCoverage, const std::shared_ptr< LaneCoverageInfo > newLaneCoverage)
Adds lane coverage information from newLaneCoverage into aggregatedLaneCoverage.
static bool moveToXYMap_matchingRoutePosition(const Position &pos, const std::string &origID, const ConstMSEdgeVector ¤tRoute, int routeIndex, SUMOVehicleClass vClass, bool setLateralPos, double &bestDistance, MSLane **lane, double &lanePos, int &routeOffset)
static void debugPrint(const SUMOTrafficObject *veh)
static MSPerson * getPerson(const std::string &id)
static void subscribe(const int commandId, const std::string &id, const std::vector< int > &variables, const double beginTime, const double endTime, const libsumo::TraCIResults ¶ms, const int contextDomain=0, const double range=0.)
Helper()=delete
invalidated standard constructor
static TraCIPositionVector makeTraCIPositionVector(const PositionVector &positionVector)
helper functions
static const std::vector< std::string > & getTransportableStateChanges(const MSNet::TransportableState state)
static std::map< int, std::shared_ptr< VariableWrapper > > myWrapper
Map of commandIds -> their executors; applicable if the executor applies to the method footprint.
static void clearSubscriptions()
static MSBaseVehicle * getVehicle(const std::string &id)
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 MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag type)
static TraCIColor makeTraCIColor(const RGBColor &color)
static void applySubscriptionFilterFieldOfVision(const Subscription &s, std::set< std::string > &objIDs)
static Subscription * myLastContextSubscription
The last context subscription.
static TraCINextStopData buildStopData(const SUMOVehicleParameter::Stop &stopPar)
static void registerStateListener()
static TransportableStateListener myTransportableStateListener
Changes in the states of simulated transportables.
static void setRemoteControlled(MSVehicle *v, Position xyPos, MSLane *l, double pos, double posLat, double angle, int edgeOffset, ConstMSEdgeVector route, SUMOTime t)
static int postProcessRemoteControl()
return number of remote-controlled entities
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 th...
static std::map< std::string, MSVehicle * > myRemoteControlledVehicles
static const MSVehicleType & getVehicleType(const std::string &vehicleID)
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, const MSLane *currentLane, double currentLanePos, bool onRoad, SUMOVehicleClass vClass, bool setLateralPos, double &bestDistance, MSLane **lane, double &lanePos, int &routeOffset, ConstMSEdgeVector &edges)
static std::pair< MSLane *, double > convertCartesianToRoadMap(const Position &pos, const SUMOVehicleClass vClass)
static MSTLLogicControl::TLSLogicVariants & getTLS(const std::string &id)
static SUMOTrafficObject * getTrafficObject(int domain, const std::string &id)
static VehicleStateListener myVehicleStateListener
Changes in the states of simulated vehicles.
static std::vector< Subscription > mySubscriptions
The list of known, still valid subscriptions.
static SUMOVehicleParameter::Stop buildStopParameters(const std::string &edgeOrStoppingPlaceID, double pos, int laneIndex, double startPos, int flags, double duration, double until)
static void handleSingleSubscription(const Subscription &s)
static void applySubscriptionFilterLateralDistance(const Subscription &s, std::set< const SUMOTrafficObject * > &vehs, double downstreamDist, double upstreamDist, double lateralDist)
Apply the subscription filter "lateral distance": Only return vehicles within the given lateral dista...
static const std::vector< std::string > & getVehicleStateChanges(const MSNet::VehicleState state)
static void collectObjectIDsInRange(int domain, const PositionVector &shape, double range, std::set< std::string > &into)
static void handleSubscriptions(const SUMOTime t)
static Subscription * addSubscriptionFilter(SubscriptionFilterType filter)
static const MSLane * getLaneChecking(const std::string &edgeID, int laneIndex, double pos)
static RGBColor makeRGBColor(const TraCIColor &color)
static void applySubscriptionFilterLanes(const Subscription &s, std::set< const SUMOTrafficObject * > &vehs, std::vector< int > &filterLanes, double downstreamDist, double upstreamDist, bool disregardOppositeDirection)
Apply the subscription filter "lanes": Only return vehicles on list of lanes relative to ego vehicle....
static std::map< std::string, MSPerson * > myRemoteControlledPersons
static bool needNewSubscription(libsumo::Subscription &s, std::vector< Subscription > &subscriptions, libsumo::Subscription *&modifiedSubscription)
static bool findCloserLane(const MSEdge *edge, const Position &pos, SUMOVehicleClass vClass, double &bestDistance, MSLane **lane)
Representation of a subscription.
bool(* SubscriptionHandler)(const std::string &objID, const int variable, VariableWrapper *wrapper, tcpip::Storage *paramData)
Definition of a method to be called for serving an associated commandID.
std::map< std::string, libsumo::SubscriptionResults > ContextSubscriptionResults
std::map< std::string, libsumo::TraCIResults > SubscriptionResults
{object->{variable->value}}
SubscriptionFilterType
Filter types for context subscriptions.
std::map< int, std::shared_ptr< libsumo::TraCIResult > > TraCIResults
{variable->value}
A 2D or 3D-position, for 2D positions z == INVALID_DOUBLE_VALUE.