 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
38 #define FAR_AWAY 1000.0
54 std::vector<std::string>
57 std::vector<std::string> ids;
60 ids.push_back(i->first);
95 const MSLane* lane = getSidewalk<MSEdge, MSLane>(person->
getEdge());
96 if (lane ==
nullptr) {
123 Person::getColor(
const std::string& personID) {
152 std::vector<std::string>
156 throw TraCIException(
"The stage index must be lower than the number of remaining stages.");
159 throw TraCIException(
"The negative stage index must refer to a valid previous stage.");
161 std::vector<std::string> edgeIDs;
162 for (
auto& e : p->
getEdges(nextStageIndex)) {
164 edgeIDs.push_back(e->getID());
176 throw TraCIException(
"The stage index must be lower than the number of remaining stages.");
179 throw TraCIException(
"The negative stage index must refer to a valid previous stage.");
187 result.
edges.push_back(e->getID());
191 if (destinationStop !=
nullptr) {
195 if (vehicle !=
nullptr) {
207 result.
intended = drivingStage->getIntendedVehicleID();
209 const std::set<std::string> lines = drivingStage->getLines();
210 for (
auto line = lines.begin(); line != lines.end(); line++) {
211 if (line != lines.begin()) {
214 result.
line += *line;
220 result.
departPos = walkingStage->getDepartPos();
239 if (veh ==
nullptr) {
254 Person::getEmissionClass(
const std::string& personID) {
260 Person::getShapeClass(
const std::string& personID) {
266 Person::getLength(
const std::string& personID) {
272 Person::getSpeedFactor(
const std::string& personID) {
278 Person::getAccel(
const std::string& personID) {
284 Person::getDecel(
const std::string& personID) {
289 double Person::getEmergencyDecel(
const std::string& personID) {
294 double Person::getApparentDecel(
const std::string& personID) {
299 double Person::getActionStepLength(
const std::string& personID) {
305 Person::getTau(
const std::string& personID) {
311 Person::getImperfection(
const std::string& personID) {
317 Person::getSpeedDeviation(
const std::string& personID) {
323 Person::getVehicleClass(
const std::string& personID) {
329 Person::getMinGap(
const std::string& personID) {
335 Person::getMinGapLat(
const std::string& personID) {
341 Person::getMaxSpeed(
const std::string& personID) {
347 Person::getMaxSpeedLat(
const std::string& personID) {
353 Person::getLateralAlignment(
const std::string& personID) {
354 return toString(
getPerson(personID)->getVehicleType().getPreferredLateralAlignment());
359 Person::getWidth(
const std::string& personID) {
365 Person::getHeight(
const std::string& personID) {
371 Person::getPersonCapacity(
const std::string& personID) {
385 if (vehicleType ==
nullptr) {
386 throw TraCIException(
"The vehicle type '" + typeID +
"' is not known.");
393 Person::add(
const std::string& personID,
const std::string& edgeID,
double pos,
double departInSecs,
const std::string typeID) {
402 throw TraCIException(
"The person " + personID +
" to add already exists.");
407 vehicleParams.
id = personID;
411 throw TraCIException(
"Invalid type '" + typeID +
"' for person '" + personID +
"'");
416 throw TraCIException(
"Invalid edge '" + edgeID +
"' for person: '" + personID +
"'");
419 if (departInSecs < 0.) {
420 const int proc = (int) - departInSecs;
429 +
"' is in the past; using current time " +
time2string(vehicleParams.
depart) +
" instead.");
431 vehicleParams.
depart = depart;
459 switch (stage.
type) {
460 case MSTransportable::StageType::DRIVING: {
461 if (stage.
edges.empty()) {
464 std::string edgeId = stage.
edges.back();
467 throw TraCIException(
"Invalid edge '" + edgeId +
"' for person: '" + personID +
"'");
473 throw TraCIException(
"Invalid stopping place id '" + stage.
destStop +
"' for person: '" + personID +
"'");
476 if (stage.
line.empty()) {
477 throw TraCIException(
"Empty lines parameter for person: '" + personID +
"'");
482 case MSTransportable::StageType::MOVING_WITHOUT_VEHICLE: {
491 throw TraCIException(
"Empty edge list for walking stage of person '" + personID +
"'.");
494 if (fabs(arrivalPos) > edges.back()->getLength()) {
495 throw TraCIException(
"Invalid arrivalPos for walking stage of person '" + personID +
"'.");
497 if (arrivalPos < 0) {
498 arrivalPos += edges.back()->getLength();
505 throw TraCIException(
"Invalid stopping place id '" + stage.
destStop +
"' for person: '" + personID +
"'");
511 case MSTransportable::StageType::WAITING: {
514 throw TraCIException(
"Duration for person: '" + personID +
"' must not be negative");
520 throw TraCIException(
"Invalid stopping place id '" + stage.
destStop +
"' for person: '" + personID +
"'");
542 throw TraCIException(
"Specified stage index: is not valid for person " + personID);
557 throw TraCIException(
"Invalid edge '" + toEdge +
"' for person: '" + personID +
"'");
559 if (lines.size() == 0) {
560 return throw TraCIException(
"Empty lines parameter for person: '" + personID +
"'");
566 throw TraCIException(
"Invalid stopping place id '" + stopID +
"' for person: '" + personID +
"'");
577 throw TraCIException(
"Duration for person: '" + personID +
"' must not be negative");
583 throw TraCIException(
"Invalid stopping place id '" + stopID +
"' for person: '" + personID +
"'");
591 Person::appendWalkingStage(
const std::string& personID,
const std::vector<std::string>& edgeIDs,
double arrivalPos,
double duration,
double speed,
const std::string& stopID) {
600 throw TraCIException(
"Empty edge list for walking stage of person '" + personID +
"'.");
602 if (fabs(arrivalPos) > edges.back()->getLength()) {
603 throw TraCIException(
"Invalid arrivalPos for walking stage of person '" + personID +
"'.");
605 if (arrivalPos < 0) {
606 arrivalPos += edges.back()->getLength();
615 throw TraCIException(
"Invalid stopping place id '" + stopID +
"' for person: '" + personID +
"'");
626 throw TraCIException(
"The stage index must be lower than the number of remaining stages.");
628 if (nextStageIndex < 0) {
639 throw TraCIException(
"Person '" + personID +
"' has no remaining stages.");
649 throw TraCIException(
"Person '" + personID +
"' cannot reroute after the current stop.");
655 int nextIndex = firstIndex + 1;
667 if (newEdges.empty()) {
668 throw TraCIException(
"Could not find new route for person '" + personID +
"'.");
671 assert(!oldEdges.empty());
673 oldEdges.erase(oldEdges.begin());
676 if (newEdges == oldEdges && (firstIndex + 1 == nextIndex)) {
679 if (newEdges.front() != from) {
681 newEdges.insert(newEdges.begin(), from);
683 p->
reroute(newEdges, departPos, firstIndex, nextIndex);
688 Person::moveTo(
const std::string& personID,
const std::string& edgeID,
double ) {
713 Person::moveToXY(
const std::string& personID,
const std::string& edgeID,
const double x,
const double y,
double angle,
const int keepRoute) {
715 const bool doKeepRoute = (keepRoute & 1) != 0;
716 const bool mayLeaveNetwork = (keepRoute & 2) != 0;
717 const bool ignorePermissions = (keepRoute & 4) != 0;
721 const double origAngle = angle;
726 while (angle >= 360.) {
736 std::cout <<
" want pos:" << pos <<
" edgeID:" << edgeID <<
" origAngle:" << origAngle <<
" angle:" << angle <<
" keepRoute:" << keepRoute << std::endl;
742 double lanePosLat = 0;
743 double bestDistance = std::numeric_limits<double>::max();
746 double maxRouteDistance = 100;
768 ev, routeIndex, vClass,
769 bestDistance, &lane, lanePos, routeOffset);
773 speed, ev, routeIndex, currentLane, p->
getEdgePos(),
true,
775 bestDistance, &lane, lanePos, routeOffset, edges);
777 if ((found && bestDistance <= maxRouteDistance) || mayLeaveNetwork) {
782 lanePosLat = perpDist;
783 if (!mayLeaveNetwork) {
791 WRITE_WARNING(
"Could not determine position on lane '" + lane->
getID() +
" at lateral position " +
toString(-lanePosLat) +
".");
795 lanePosLat = -lanePosLat;
803 assert((found && lane != 0) || (!found && lane == 0));
805 if (lane !=
nullptr) {
821 if (lane ==
nullptr) {
822 throw TraCIException(
"Could not map person '" + personID +
"' no road found within " +
toString(maxRouteDistance) +
"m.");
824 throw TraCIException(
"Could not map person '" + personID +
"' distance to road is " +
toString(bestDistance) +
".");
839 Person::setLength(
const std::string& personID,
double length) {
845 Person::setMaxSpeed(
const std::string& personID,
double speed) {
851 Person::setVehicleClass(
const std::string& personID,
const std::string& clazz) {
857 Person::setShapeClass(
const std::string& personID,
const std::string& clazz) {
863 Person::setEmissionClass(
const std::string& personID,
const std::string& clazz) {
869 Person::setWidth(
const std::string& personID,
double width) {
875 Person::setHeight(
const std::string& personID,
double height) {
881 Person::setMinGap(
const std::string& personID,
double minGap) {
887 Person::setAccel(
const std::string& personID,
double accel) {
893 Person::setDecel(
const std::string& personID,
double decel) {
899 Person::setEmergencyDecel(
const std::string& personID,
double decel) {
905 Person::setApparentDecel(
const std::string& personID,
double decel) {
911 Person::setImperfection(
const std::string& personID,
double imperfection) {
917 Person::setTau(
const std::string& personID,
double tau) {
923 Person::setMinGapLat(
const std::string& personID,
double minGapLat) {
929 Person::setMaxSpeedLat(
const std::string& personID,
double speed) {
935 Person::setLateralAlignment(
const std::string& personID,
const std::string& latAlignment) {
941 Person::setSpeedFactor(
const std::string& personID,
double factor) {
947 Person::setActionStepLength(
const std::string& personID,
double actionStepLength,
bool resetActionOffset) {
953 Person::setColor(
const std::string& personID,
const TraCIColor& c) {
955 p.
color.
set((
unsigned char)c.r, (
unsigned char)c.g, (
unsigned char)c.b, (
unsigned char)c.a);
980 std::shared_ptr<VariableWrapper>
1008 return wrapper->
wrapColor(objID, variable, getColor(objID));
unsigned char alpha() const
Returns the alpha-amount of the color.
std::map< std::string, MSTransportable * >::const_iterator constVehIt
Definition of the internal transportables map iterator.
The car-following model and parameter.
void setHeight(const double &height)
Set a new value for this type's height.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag category) const
Returns the named stopping place of the given category.
const std::string & getID() const
Returns the name of the vehicle type.
A lane area vehicles can halt at.
double getMaxAccel() const
Get the vehicle type's maximum acceleration [m/s^2].
C++ TraCI client API implementation.
static double getLanePosition(const std::string &personID)
void setPreferredLateralAlignment(LateralAlignment latAlignment)
Set vehicle's preferred lateral alignment.
int parametersSet
Information for the router which parameter were set, TraCI may modify this (whe changing color)
double getMaxDecel() const
Get the vehicle type's maximal comfortable deceleration [m/s^2].
void setMinGapLat(const double &minGapLat)
Set a new value for this type's minimum lataral gap.
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
void setAccel(double accel)
Set a new value for this type's acceleration.
#define WRITE_WARNING(msg)
Representation of a lane in the micro simulation.
TRACI_CONST double INVALID_DOUBLE_VALUE
virtual double getImperfection() const
Get the driver's imperfection.
static void setSpeed(const std::string &personID, double speed)
TRACI_CONST int VAR_POSITION
const std::string & getNextEdge() const
return the list of internal edges if this person is walking and the pedestrian model allows it
virtual bool wrapString(const std::string &objID, const int variable, const std::string &value)=0
RGBColor color
The vehicle's color, TraCI may change this.
MSVehicleType * getVType(const std::string &id=DEFAULT_VTYPE_ID, std::mt19937 *rng=nullptr)
Returns the named vehicle type or a sample from the named distribution.
TRACI_CONST int VAR_STAGES_REMAINING
double compute(const E *from, const E *to, double departPos, double arrivalPos, double speed, SUMOTime msTime, const N *onlyNode, std::vector< const E * > &into, bool allEdges=false)
Builds the route between the given edges using the minimum effort at the given time The definition of...
void appendStage(Stage *stage, int next=-1)
Appends the given stage to the current plan.
TRACI_CONST int VAR_ROAD_ID
static TraCIPosition getPosition(const std::string &personID, const bool includeZ=false)
const MSEdge * getArrivalEdge() const
returns the final arrival edge
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
ConstMSEdgeVector getEdges(int next) const
Return the edges of the nth next stage.
static std::string getVehicle(const std::string &personID)
TRACI_CONST int VAR_COLOR
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
virtual const std::string & getID() const =0
Get the vehicle's ID.
virtual double getDistance() const =0
get travel distance in this stage
void setVClass(SUMOVehicleClass vclass)
Set a new value for this type's vehicle class.
double getApparentDecel() const
Get the vehicle type's apparent deceleration [m/s^2] (the one regarded by its followers.
double getMaxSpeedLat() const
Get vehicle's maximum lateral speed [m/s].
TRACI_CONST int VAR_WAITING_TIME
void setEmergencyDecel(double emergencyDecel)
Set a new value for this type's emergency deceleration.
Representation of a vehicle.
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, SUMOVehicleClass vClass, double &bestDistance, MSLane **lane, double &lanePos, int &routeOffset, ConstMSEdgeVector &edges)
static double naviDegree(const double angle)
DepartDefinition
Possible ways to depart.
double slopeDegreeAtOffset(double pos) const
Returns the slope at the given length.
std::vector< const MSEdge * > ConstMSEdgeVector
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
std::map< std::string, SubscriptionResults > ContextSubscriptionResults
int size() const
Returns the number of known transportables.
static void moveTo(const std::string &personID, const std::string &edgeID, double position)
virtual ConstMSEdgeVector getEdges() const
the edges of the current stage
Structure representing possible vehicle parameter.
unsigned char red() const
Returns the red-amount of the color.
std::string intended
id of the intended vehicle for public transport ride
static TraCIPosition makeTraCIPosition(const Position &position, const bool includeZ=false)
void setMinGap(const double &minGap)
Set a new value for this type's minimum gap.
TRACI_CONST int VAR_VEHICLE
void setWidth(const double &width)
Set a new value for this type's width.
static std::string getName(const SUMOEmissionClass c)
Checks whether the string describes a known vehicle class.
bool add(MSTransportable *transportable)
Adds a single transportable, returns false if an id clash occurred.
static std::vector< std::string > getEdges(const std::string &personID, int nextStageIndex=0)
int getPersonCapacity() const
Get this vehicle type's person capacity.
static void appendWalkingStage(const std::string &personID, const std::vector< std::string > &edgeIDs, double arrivalPos, double duration=-1, double speed=-1, const std::string &stopID="")
double getLength() const
return the length of the edge
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
double getMinGapLat() const
Get the minimum lateral gap that vehicles of this type maintain.
StageType getStageType(int next) const
the stage type for the nth next stage
StageType getCurrentStageType() const
the current stage type of the transportable
const std::vector< const MSEdge * >::iterator getRouteStep() const
double arrivalPos
position on the lane when ending the stage
virtual bool wrapColor(const std::string &objID, const int variable, const TraCIColor &value)=0
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
static double gLateralResolution
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
static std::string getRoadID(const std::string &personID)
MSTransportable * get(const std::string &id) const
Returns the named transportable, if existing.
static SUMOTime processActionStepLength(double given)
Checks and converts given value for the action step length from seconds to miliseconds assuring it be...
const MSEdge * getEdge() const
Returns the current edge.
virtual bool wrapDouble(const std::string &objID, const int variable, const double value)=0
LIBSUMO_VEHICLE_TYPE_SETTER static LIBSUMO_SUBSCRIPTION_API void storeShape(const std::string &id, PositionVector &shape)
Saves the shape of the requested object in the given container.
double travelTime
duration of the stage in seconds
std::vector< double > & getParameter()
Returns the parameters of this distribution.
static double getSpeed(const std::string &personID)
static double getSlope(const std::string &personID)
MSTransportable::Stage * getCurrentStage() const
Return the current stage.
virtual std::string getStageDescription() const =0
return (brief) string representation of the current stage
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version)
std::string description
arbitrary description string
TRACI_CONST int VAR_ANGLE
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
TRACI_CONST int VAR_NEXT_EDGE
static const double INVALID_OFFSET
a value to signify offsets outside the range of [0, Line.length()]
int getNumStages() const
Return the total number stages in this persons plan.
virtual bool wrapStringList(const std::string &objID, const int variable, const std::vector< std::string > &value)=0
virtual double getWaitingSeconds() const
the time this transportable spent waiting in seconds
const int VEHPARS_COLOR_SET
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn't already in the dictionary....
virtual MSTransportable * buildPerson(const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan, std::mt19937 *rng) const
Builds a new person.
std::string line
The line or the id of the vehicle type.
TRACI_CONST int VAR_SLOPE
TRACI_CONST int STAGE_WALKING
std::string id
The vehicle's id.
SUMOVehicle * getVehicle() const
The vehicle associated with this transportable.
double interpolateLanePosToGeometryPos(double lanePos) const
MSPedestrianRouter & getPedestrianRouter(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper)
void setActionStepLength(const SUMOTime actionStepLength, bool resetActionOffset)
Set a new value for this type's action step length.
static bool moveToXYMap_matchingRoutePosition(const Position &pos, const std::string &origID, const ConstMSEdgeVector ¤tRoute, int routeIndex, SUMOVehicleClass vClass, double &bestDistance, MSLane **lane, double &lanePos, int &routeOffset)
A point in 2D or 3D with translation and scaling methods.
constVehIt loadedBegin() const
Returns the begin of the internal transportables map.
static MSPerson * getPerson(const std::string &id)
std::string time2string(SUMOTime t)
TRACI_CONST int TRACI_ID_LIST
void setLength(const double &length)
Set a new value for this type's length.
double getMinGap() const
Get the free space in front of vehicles of this class.
A road/street connecting two junctions.
#define LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOMAIN)
virtual SUMOVehicle * getVehicle() const
Whether the transportable waits for a vehicle.
void setDecel(double decel)
Set a new value for this type's deceleration.
Position getPosition(const double) const
Return current position (x/y, cartesian)
@ DEPART_DEF_MAX
Tag for the last element in the enum for safe int casting.
static TraCIPosition getPosition3D(const std::string &personID)
unsigned char green() const
Returns the green-amount of the color.
StageType getStageType() const
static void moveToXY(const std::string &personID, const std::string &edgeID, const double x, const double y, double angle=INVALID_DOUBLE_VALUE, const int keepRoute=1)
static TraCIStage getStage(const std::string &personID, int nextStageIndex=0)
double depart
intended depart time for public transport ride or INVALID_DOUBLE_VALUE
const Distribution_Parameterized & getSpeedFactor() const
Returns this type's speed factor.
double getArrivalPos() const
virtual double getEdgePos() const
Return the position on the edge.
void setShape(SUMOVehicleShape shape)
Set a new value for this type's shape.
double distance2D(const Position &p, bool perpendicular=false) const
closest 2D-distance to point p (or -1 if perpendicular is true and the point is beyond this vector)
static std::shared_ptr< VariableWrapper > makeWrapper()
static double getWaitingTime(const std::string &personID)
void setMaxSpeedLat(const double &maxSpeedLat)
Set a new value for this type's maximum lateral speed.
double angleTo2D(const Position &other) const
returns the angle in the plane of the vector pointing from here to the other position
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
static SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc=SVC_IGNORING)
Checks whether the string describes a known vehicle class.
static std::string getTypeID(const std::string &personID)
static SubscriptionResults mySubscriptionResults
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
@ SUMO_TAG_BUS_STOP
A bus stop.
const PositionVector & getShape() const
Returns this lane's shape.
static LIBSUMO_VEHICLE_TYPE_GETTER void add(const std::string &personID, const std::string &edgeID, double pos, double depart=DEPARTFLAG_NOW, const std::string typeID="DEFAULT_PEDTYPE")
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
int getNumRemainingStages() const
Return the number of remaining stages (including the current)
constVehIt loadedEnd() const
Returns the end of the internal transportables map.
virtual MSTransportableControl & getPersonControl()
Returns the person control.
int type
The type of stage (walking, driving, ...)
unsigned char blue() const
Returns the blue-amount of the color.
virtual double getHeadwayTime() const
Get the driver's desired headway [s].
static void setType(const std::string &personID, const std::string &typeID)
static std::string getNextEdge(const std::string &personID)
double getActionStepLengthSecs() const
Returns this type's default action step length in seconds.
virtual double getSpeed() const
the current speed of the transportable
double getArrivalPos() const
returns the final arrival pos
const ConstMSEdgeVector & getRoute() const
double rotationAtOffset(double pos) const
Returns the rotation at the given length.
static void setRemoteControlled(MSVehicle *v, Position xyPos, MSLane *l, double pos, double posLat, double angle, int edgeOffset, ConstMSEdgeVector route, SUMOTime t)
static int getRemainingStages(const std::string &personID)
const MSVehicleType & getVehicleType() const
Returns the vehicle's type.
double getLength() const
Get vehicle's length [m].
MSTransportable::Stage * getNextStage(int next) const
Return the current stage.
std::vector< std::string > edges
The sequence of edges to travel.
void setApparentDecel(double apparentDecel)
Set a new value for this type's apparent deceleration.
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
virtual bool wrapInt(const std::string &objID, const int variable, const int value)=0
static void removeStage(const std::string &personID, int nextStageIndex)
static void appendStage(const TraCIStage &stage, const std::string &personID)
TRACI_CONST int VAR_LANEPOSITION
TRACI_CONST int VAR_POSITION3D
void setSpeed(double speed)
sets the walking speed (ignored in other stages)
const std::string & getID() const
returns the id of the transportable
static void parseEdgesList(const std::string &desc, ConstMSEdgeVector &into, const std::string &rid)
Parses the given string assuming it contains a list of edge ids divided by spaces.
double getEmergencyDecel() const
Get the vehicle type's maximal phisically possible deceleration [m/s^2].
static void rerouteTraveltime(const std::string &personID)
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
double getWidth() const
Returns the lane's width.
static void replaceStage(const std::string &personID, const int stageIndex, const TraCIStage &stage)
TRACI_CONST int STAGE_DRIVING
SUMOVehicleShape getVehicleShapeID(const std::string &name)
Returns the class id of the shape class given by its name.
std::vector< std::string > getVector()
return vector of strings
void setMaxSpeed(const double &maxSpeed)
Set a new value for this type's maximum speed.
static std::string getIDSecure(const T *obj, const std::string &fallBack="NULL")
get an identifier for Named-like object which may be Null
MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
void removeStage(int next)
removes the nth next stage
TRACI_CONST int VAR_SPEED
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
double departPos
position on the lane when starting the stage
static StringBijection< LateralAlignment > LateralAlignments
lateral alignments
@ DEPART_POS_GIVEN
The position is given.
void setSpeedFactor(const double &factor)
Set a new value for this type's speed factor.
std::string vType
The vehicle type when using a private car or bike.
static std::vector< std::string > getIDList()
void reroute(ConstMSEdgeVector &newEdges, double departPos, int firstIndex, int nextIndex)
set new walk and replace the stages with relative indices in the interval [firstIndex,...
virtual bool wrapPosition(const std::string &objID, const int variable, const TraCIPosition &value)=0
std::string destStop
The id of the destination stop.
ConstMSEdgeVector getEdges() const
the edges of the current stage
static void appendWaitingStage(const std::string &personID, double duration, const std::string &description="waiting", const std::string &stopID="")
@ SVC_IGNORING
vehicles ignoring classes
const SUMOVehicleParameter & getParameter() const
static ContextSubscriptionResults myContextSubscriptionResults
const std::string & getID() const
Returns the id.
static void setParameter(const std::string &personID, const std::string &key, const std::string &value)
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
static void appendDrivingStage(const std::string &personID, const std::string &toEdge, const std::string &lines, const std::string &stopID="")
std::map< std::string, TraCIResults > SubscriptionResults
{object->{variable->value}}
static MSTransportable::Stage * convertTraCIStage(const TraCIStage &stage, const std::string personID)
double departPos
(optional) The position the vehicle shall depart from
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
void setTau(double tau)
Set a new value for this type's headway.
void set(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
assigns new values
void setEmissionClass(SUMOEmissionClass eclass)
Set a new value for this type's emission class.
void setImperfection(double imperfection)
Set a new value for this type's imperfection.
static std::string getParameter(const std::string &routeID, const std::string ¶m)
MSVehicleType & getSingularType()
Replaces the current vehicle type with a new one used by this vehicle only.
std::string getCurrentStageDescription() const
Returns the current stage description as a string.
static double getAngle(const std::string &personID)