41 #define FAR_AWAY 1000.0 57 std::vector<std::string>
60 std::vector<std::string> ids;
63 ids.push_back(i->first);
71 Person::getIDCount() {
98 const MSLane* lane = getSidewalk<MSEdge, MSLane>(person->
getEdge());
99 if (lane ==
nullptr) {
130 std::vector<TraCIReservation>
132 std::vector<TraCIReservation> result;
134 if (dispatcher !=
nullptr) {
136 if (traciDispatcher ==
nullptr) {
137 throw TraCIException(
"device.taxi.dispatch-algorithm 'traci' has not been loaded");
147 std::vector<std::string> personIDs;
149 personIDs.push_back(p->
getID());
168 Person::getColor(
const std::string& personID) {
197 std::vector<std::string>
201 throw TraCIException(
"The stage index must be lower than the number of remaining stages.");
204 throw TraCIException(
"The negative stage index must refer to a valid previous stage.");
206 std::vector<std::string> edgeIDs;
207 for (
auto& e : p->
getEdges(nextStageIndex)) {
209 edgeIDs.push_back(e->getID());
221 throw TraCIException(
"The stage index must be lower than the number of remaining stages.");
224 throw TraCIException(
"The negative stage index " +
toString(nextStageIndex) +
" must refer to a valid previous stage.");
232 result.
edges.push_back(e->getID());
236 if (destinationStop !=
nullptr) {
241 if (result.
length == -1.) {
258 const std::set<std::string> lines = drivingStage->
getLines();
259 for (
auto line = lines.begin(); line != lines.end(); line++) {
260 if (line != lines.begin()) {
263 result.
line += *line;
269 result.
departPos = walkingStage->getDepartPos();
288 if (veh ==
nullptr) {
297 Person::getParameter(
const std::string& personID,
const std::string& param) {
306 Person::getEmissionClass(
const std::string& personID) {
312 Person::getShapeClass(
const std::string& personID) {
318 Person::getLength(
const std::string& personID) {
324 Person::getSpeedFactor(
const std::string& personID) {
330 Person::getAccel(
const std::string& personID) {
336 Person::getDecel(
const std::string& personID) {
341 double Person::getEmergencyDecel(
const std::string& personID) {
346 double Person::getApparentDecel(
const std::string& personID) {
351 double Person::getActionStepLength(
const std::string& personID) {
357 Person::getTau(
const std::string& personID) {
363 Person::getImperfection(
const std::string& personID) {
369 Person::getSpeedDeviation(
const std::string& personID) {
375 Person::getVehicleClass(
const std::string& personID) {
381 Person::getMinGap(
const std::string& personID) {
387 Person::getMinGapLat(
const std::string& personID) {
393 Person::getMaxSpeed(
const std::string& personID) {
399 Person::getMaxSpeedLat(
const std::string& personID) {
405 Person::getLateralAlignment(
const std::string& personID) {
406 return toString(
getPerson(personID)->getVehicleType().getPreferredLateralAlignment());
411 Person::getWidth(
const std::string& personID) {
417 Person::getHeight(
const std::string& personID) {
423 Person::getPersonCapacity(
const std::string& personID) {
437 if (vehicleType ==
nullptr) {
438 throw TraCIException(
"The vehicle type '" + typeID +
"' is not known.");
445 Person::add(
const std::string& personID,
const std::string& edgeID,
double pos,
double departInSecs,
const std::string typeID) {
454 throw TraCIException(
"The person " + personID +
" to add already exists.");
459 vehicleParams.
id = personID;
463 throw TraCIException(
"Invalid type '" + typeID +
"' for person '" + personID +
"'");
468 throw TraCIException(
"Invalid edge '" + edgeID +
"' for person: '" + personID +
"'");
471 if (departInSecs < 0.) {
472 const int proc = (int) - departInSecs;
481 +
"' is in the past; using current time " +
time2string(vehicleParams.
depart) +
" instead.");
483 vehicleParams.
depart = depart;
497 plan->push_back(
new MSStageWaiting(edge,
nullptr, 0, depart, pos,
"awaiting departure",
true));
517 throw TraCIException(
"Invalid stopping place id '" + stage.
destStop +
"' for person: '" + personID +
"'");
524 switch (stage.
type) {
526 if (stage.
edges.empty()) {
529 std::string toId = stage.
edges.back();
532 throw TraCIException(
"Invalid edge '" + toId +
"' for person: '" + personID +
"'");
539 if (stage.
line.empty()) {
540 throw TraCIException(
"Empty lines parameter for person: '" + personID +
"'");
562 throw TraCIException(
"Empty edge list for walking stage of person '" + personID +
"'.");
565 if (fabs(arrivalPos) > edges.back()->getLength()) {
566 throw TraCIException(
"Invalid arrivalPos for walking stage of person '" + personID +
"'.");
568 if (arrivalPos < 0) {
569 arrivalPos += edges.back()->getLength();
578 throw TraCIException(
"Duration for person: '" + personID +
"' must not be negative");
600 throw TraCIException(
"Specified stage index: is not valid for person " + personID);
615 throw TraCIException(
"Invalid edge '" + toEdge +
"' for person: '" + personID +
"'");
617 if (lines.size() == 0) {
618 return throw TraCIException(
"Empty lines parameter for person: '" + personID +
"'");
624 throw TraCIException(
"Invalid stopping place id '" + stopID +
"' for person: '" + personID +
"'");
635 throw TraCIException(
"Duration for person: '" + personID +
"' must not be negative");
641 throw TraCIException(
"Invalid stopping place id '" + stopID +
"' for person: '" + personID +
"'");
649 Person::appendWalkingStage(
const std::string& personID,
const std::vector<std::string>& edgeIDs,
double arrivalPos,
double duration,
double speed,
const std::string& stopID) {
658 throw TraCIException(
"Empty edge list for walking stage of person '" + personID +
"'.");
660 if (fabs(arrivalPos) > edges.back()->getLength()) {
661 throw TraCIException(
"Invalid arrivalPos for walking stage of person '" + personID +
"'.");
663 if (arrivalPos < 0) {
664 arrivalPos += edges.back()->getLength();
673 throw TraCIException(
"Invalid stopping place id '" + stopID +
"' for person: '" + personID +
"'");
684 throw TraCIException(
"The stage index must be lower than the number of remaining stages.");
686 if (nextStageIndex < 0) {
697 throw TraCIException(
"Person '" + personID +
"' has no remaining stages.");
707 throw TraCIException(
"Person '" + personID +
"' cannot reroute after the current stop.");
713 int nextIndex = firstIndex + 1;
725 if (newEdges.empty()) {
726 throw TraCIException(
"Could not find new route for person '" + personID +
"'.");
729 assert(!oldEdges.empty());
731 oldEdges.erase(oldEdges.begin());
734 if (newEdges == oldEdges && (firstIndex + 1 == nextIndex)) {
737 if (newEdges.front() != from) {
739 newEdges.insert(newEdges.begin(), from);
741 p->
reroute(newEdges, departPos, firstIndex, nextIndex);
746 Person::moveTo(
const std::string& personID,
const std::string& edgeID,
double ) {
771 Person::moveToXY(
const std::string& personID,
const std::string& edgeID,
const double x,
const double y,
double angle,
const int keepRoute) {
773 const bool doKeepRoute = (keepRoute & 1) != 0;
774 const bool mayLeaveNetwork = (keepRoute & 2) != 0;
775 const bool ignorePermissions = (keepRoute & 4) != 0;
779 const double origAngle = angle;
784 while (angle >= 360.) {
794 std::cout <<
" want pos:" << pos <<
" edgeID:" << edgeID <<
" origAngle:" << origAngle <<
" angle:" << angle <<
" keepRoute:" << keepRoute << std::endl;
800 double lanePosLat = 0;
801 double bestDistance = std::numeric_limits<double>::max();
804 double maxRouteDistance = 100;
826 ev, routeIndex, vClass,
true,
827 bestDistance, &lane, lanePos, routeOffset);
831 speed, ev, routeIndex, currentLane, p->
getEdgePos(), currentLane !=
nullptr,
833 bestDistance, &lane, lanePos, routeOffset, edges);
834 if (edges.size() != 0 && ev.size() > 1) {
837 assert(lane !=
nullptr);
840 if (routeIndex == 0) {
847 if (origEdge->
getToJunction() == ev[routeIndex - 1]->getToJunction() || origEdge->
getToJunction() == ev[routeIndex - 1]->getFromJunction()) {
857 const MSEdge* newEdge = edges[0];
858 if (edges[0]->getFromJunction() == originalTarget || edges[0]->getToJunction() == originalTarget) {
860 edges[routeIndex] = newEdge;
864 if ((found && bestDistance <= maxRouteDistance) || mayLeaveNetwork) {
869 lanePosLat = perpDist;
870 if (!mayLeaveNetwork) {
878 WRITE_WARNING(
"Could not determine position on lane '" + lane->
getID() +
" at lateral position " +
toString(-lanePosLat) +
".");
882 lanePosLat = -lanePosLat;
890 assert((found && lane != 0) || (!found && lane == 0));
927 if (lane ==
nullptr) {
928 throw TraCIException(
"Could not map person '" + personID +
"' no road found within " +
toString(maxRouteDistance) +
"m.");
930 throw TraCIException(
"Could not map person '" + personID +
"' distance to road is " +
toString(bestDistance) +
".");
939 Person::setParameter(
const std::string& personID,
const std::string& key,
const std::string& value) {
945 Person::setLength(
const std::string& personID,
double length) {
951 Person::setMaxSpeed(
const std::string& personID,
double speed) {
957 Person::setVehicleClass(
const std::string& personID,
const std::string& clazz) {
963 Person::setShapeClass(
const std::string& personID,
const std::string& clazz) {
969 Person::setEmissionClass(
const std::string& personID,
const std::string& clazz) {
975 Person::setWidth(
const std::string& personID,
double width) {
981 Person::setHeight(
const std::string& personID,
double height) {
987 Person::setMinGap(
const std::string& personID,
double minGap) {
993 Person::setAccel(
const std::string& personID,
double accel) {
999 Person::setDecel(
const std::string& personID,
double decel) {
1005 Person::setEmergencyDecel(
const std::string& personID,
double decel) {
1011 Person::setApparentDecel(
const std::string& personID,
double decel) {
1017 Person::setImperfection(
const std::string& personID,
double imperfection) {
1023 Person::setTau(
const std::string& personID,
double tau) {
1029 Person::setMinGapLat(
const std::string& personID,
double minGapLat) {
1035 Person::setMaxSpeedLat(
const std::string& personID,
double speed) {
1041 Person::setLateralAlignment(
const std::string& personID,
const std::string& latAlignment) {
1047 Person::setSpeedFactor(
const std::string& personID,
double factor) {
1053 Person::setActionStepLength(
const std::string& personID,
double actionStepLength,
bool resetActionOffset) {
1059 Person::setColor(
const std::string& personID,
const TraCIColor& c) {
1061 p.
color.
set((
unsigned char)c.
r, (
unsigned char)c.
g, (
unsigned char)c.
b, (
unsigned char)c.
a);
1081 std::shared_ptr<VariableWrapper>
1093 return wrapper->
wrapInt(objID, variable, getIDCount());
1111 return wrapper->
wrapColor(objID, variable, getColor(objID));
1125 return libsumo::VehicleType::handleVariable(
getTypeID(objID), variable, wrapper);
TRACI_CONST int STAGE_WAITING
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
SUMOVehicle * getVehicle() const
The vehicle associated with this transportable.
double getApparentDecel() const
Get the vehicle type's apparent deceleration [m/s^2] (the one regarded by its followers.
virtual double getDistance() const =0
get travel distance in this stage
void setMinGap(const double &minGap)
Set a new value for this type's minimum gap.
std::map< std::string, TraCIResults > SubscriptionResults
{object->{variable->value}}
static double gLateralResolution
static void rerouteTraveltime(const std::string &personID)
void appendStage(MSStage *stage, int next=-1)
Appends the given stage to the current plan.
virtual std::string getStageDescription(const bool isPerson) const =0
return (brief) string representation of the current stage
TRACI_CONST int VAR_LANE_ID
RGBColor color
The vehicle's color, TraCI may change this.
MSEdge & getEdge() const
Returns the lane's edge.
int type
The type of stage (walking, driving, ...)
virtual bool wrapInt(const std::string &objID, const int variable, const int value)=0
static void moveTo(const std::string &personID, const std::string &edgeID, double position)
std::map< std::string, MSTransportable * >::const_iterator constVehIt
Definition of the internal transportables map iterator.
std::string line
The line or the id of the vehicle type.
static std::vector< std::string > getEdges(const std::string &personID, int nextStageIndex=0)
double getArrivalPos() const
returns the final arrival pos
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) ...
#define LIBSUMO_GET_PARAMETER_WITH_KEY_IMPLEMENTATION(CLASS)
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
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="")
TRACI_CONST int VAR_COLOR
const MSEdge * getEdge() const
Returns the current edge.
MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag category) const
Returns the named stopping place of the given category.
TRACI_CONST int VAR_VEHICLE
A lane area vehicles can halt at.
TRACI_CONST int VAR_WAITING_TIME
void setSpeed(double speed)
sets the walking speed (ignored in other stages)
void setTau(double tau)
Set a new value for this type's headway.
static void setType(const std::string &personID, const std::string &typeID)
void setShape(SUMOVehicleShape shape)
Set a new value for this type's shape.
virtual double getEdgePos() const
Return the position on the edge.
double arrivalPos
position on the lane when ending the stage
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
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.
TRACI_CONST int VAR_ROAD_ID
unsigned char alpha() const
Returns the alpha-amount of the color.
SUMOTime getDeparted() const
get departure time of stage
static TraCIPosition makeTraCIPosition(const Position &position, const bool includeZ=false)
virtual double getImperfection() const
Get the driver's imperfection.
The base class for an intersection.
static double getSpeed(const std::string &personID)
std::string destStop
The id of the destination stop.
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.
void setDecel(double decel)
Set a new value for this type's deceleration.
const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
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 MSPerson * getPerson(const std::string &id)
int parametersSet
Information for the router which parameter were set, TraCI may modify this (when changing color) ...
std::string time2string(SUMOTime t)
convert SUMOTime to string
A dispatch algorithm that services customers in reservation order and always sends the closest availa...
static SUMOTime processActionStepLength(double given)
Checks and converts given value for the action step length from seconds to miliseconds assuring it be...
TRACI_CONST int VAR_POSITION
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
static void replaceStage(const std::string &personID, const int stageIndex, const TraCIStage &stage)
double angleTo2D(const Position &other) const
returns the angle in the plane of the vector pointing from here to the other position ...
int size() const
Returns the number of known transportables.
std::vector< Reservation * > getReservations()
retrieve all reservations
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
const std::string & getNextEdge() const
return the list of internal edges if this person is walking and the pedestrian model allows it ...
MSStage * getCurrentStage() const
Return the current stage.
std::vector< double > & getParameter()
Returns the parameters of this distribution.
const PositionVector & getShape() const
Returns this lane's shape.
static std::string getIDSecure(const T *obj, const std::string &fallBack="NULL")
get an identifier for Named-like object which may be Null
double getMinGapLat() const
Get the minimum lateral gap that vehicles of this type maintain.
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...
TRACI_CONST int VAR_STAGES_REMAINING
double rotationAtOffset(double pos) const
Returns the rotation at the given length.
void setApparentDecel(double apparentDecel)
Set a new value for this type's apparent deceleration.
unsigned char blue() const
Returns the blue-amount of the color.
std::map< std::string, SubscriptionResults > ContextSubscriptionResults
TRACI_CONST int VAR_ANGLE
static void appendStage(const std::string &personID, const TraCIStage &stage)
static double getSlope(const std::string &personID)
void setLength(const double &length)
Set a new value for this type's length.
MSPedestrianRouter & getPedestrianRouter(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
std::vector< const MSEdge * > ConstMSEdgeVector
const std::string & getID() const
Returns the id.
virtual bool wrapString(const std::string &objID, const int variable, const std::string &value)=0
virtual double getSpeed() const
the current speed of the transportable
double depart
intended depart time for public transport ride or INVALID_DOUBLE_VALUE
ConstMSEdgeVector getEdges(int next) const
Return the edges of the nth next stage.
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
void setMaxSpeed(const double &maxSpeed)
Set a new value for this type's maximum speed.
double getLength() const
return the length of the edge
const MSJunction * getToJunction() const
void setImperfection(double imperfection)
Set a new value for this type's imperfection.
SUMOVehicleClass getVClass() const
Returns the object's access class.
Tag for the last element in the enum for safe int casting.
int getPersonCapacity() const
Get this vehicle type's person capacity.
double departPos
position on the lane when starting the stage
std::string getIntendedVehicleID() const
double getWidth() const
Returns the lane's width.
int getNumRemainingStages() const
Return the number of remaining stages (including the current)
std::string description
arbitrary description string
#define WRITE_WARNING(msg)
The car-following model and parameter.
static void setSpeed(const std::string &personID, double speed)
std::string getVehicleShapeName(SUMOVehicleShape id)
Returns the class name of the shape class given by its id.
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)
void removeStage(int next)
removes the nth next stage
double getMaxAccel() const
Get the vehicle type's maximum acceleration [m/s^2].
static MSStage * convertTraCIStage(const TraCIStage &stage, const std::string personID)
void setMinGapLat(const double &minGapLat)
Set a new value for this type's minimum lataral gap.
static SubscriptionResults mySubscriptionResults
TRACI_CONST int TRACI_ID_LIST
MSVehicleType & getSingularType()
Replaces the current vehicle type with a new one used by this vehicle only.
A road/street connecting two junctions.
double getEndLanePosition() const
Returns the end position of this stop.
static double naviDegree(const double angle)
static MSDispatch * getDispatchAlgorithm()
const MSCFModel & getCarFollowModel() const
Returns the vehicle type's car following model definition (const version)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
LIBSUMO_ID_PARAMETER_API 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")
virtual double getArrivalPos() const
void setAccel(double accel)
Set a new value for this type's acceleration.
Representation of a vehicle.
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
static std::string getTypeID(const std::string &personID)
static void appendDrivingStage(const std::string &personID, const std::string &toEdge, const std::string &lines, const std::string &stopID="")
virtual MSTransportableControl & getPersonControl()
Returns the person control.
static std::vector< TraCIReservation > getTaxiReservations(int onlyNew=false)
static double getAngle(const std::string &personID)
MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
A point in 2D or 3D with translation and scaling methods.
TRACI_CONST int VAR_NEXT_EDGE
void set(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
assigns new values
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...
std::vector< std::string > edges
The sequence of edges to travel.
double getEmergencyDecel() const
Get the vehicle type's maximal phisically possible deceleration [m/s^2].
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
void setHeight(const double &height)
Set a new value for this type's height.
MSStageType getCurrentStageType() const
the current stage type of the transportable
static TraCIStage getStage(const std::string &personID, int nextStageIndex=0)
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
SUMOTime getArrived() const
get arrival time of stage
constVehIt loadedBegin() const
Returns the begin of the internal transportables map.
static std::string getNextEdge(const std::string &personID)
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
static ContextSubscriptionResults myContextSubscriptionResults
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
TRACI_CONST int VAR_SLOPE
static double getWaitingTime(const std::string &personID)
void forceDeparture()
register forced (traci) departure
static int getRemainingStages(const std::string &personID)
static std::string getVehicle(const std::string &personID)
static std::string getLaneID(const std::string &personID)
void setEmissionClass(SUMOEmissionClass eclass)
Set a new value for this type's emission class.
double getMinGap() const
Get the free space in front of vehicles of this class.
static std::string getName(const SUMOEmissionClass c)
Checks whether the string describes a known vehicle class.
double getMaxDecel() const
Get the vehicle type's maximal comfortable deceleration [m/s^2].
#define LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOMAIN)
TRACI_CONST int VAR_POSITION3D
const std::vector< const MSEdge * > & getRoute() const
static const double INVALID_OFFSET
a value to signify offsets outside the range of [0, Line.length()]
static void removeStage(const std::string &personID, int nextStageIndex)
const int VEHPARS_COLOR_SET
MSStageType getStageType(int next) const
the stage type for the nth next stage
void setSpeedFactor(const double &factor)
Set a new value for this type's speed factor.
TRACI_CONST int STAGE_WALKING
const std::vector< const MSEdge * >::iterator getRouteStep() const
static MSPerson * getPerson(const std::string &id)
std::string vType
The vehicle type when using a private car or bike.
void setActionStepLength(const SUMOTime actionStepLength, bool resetActionOffset)
Set a new value for this type's action step length.
virtual bool wrapDouble(const std::string &objID, const int variable, const double value)=0
std::vector< std::string > getVector()
return vector of strings
double slopeDegreeAtOffset(double pos) const
Returns the slope at the given length.
virtual bool wrapPosition(const std::string &objID, const int variable, const TraCIPosition &value)=0
double getMaxSpeedLat() const
Get vehicle's maximum lateral speed [m/s].
static void setRemoteControlled(MSVehicle *v, Position xyPos, MSLane *l, double pos, double posLat, double angle, int edgeOffset, ConstMSEdgeVector route, SUMOTime t)
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
std::string getCurrentStageDescription() const
Returns the current stage description as a string.
static TraCIPosition getPosition(const std::string &personID, const bool includeZ=false)
static StringBijection< LateralAlignment > LateralAlignments
lateral alignments
TRACI_CONST int VAR_SPEED
double departPos
(optional) The position the vehicle shall depart from
An algorithm that performs distpach for a taxi fleet.
Structure representing possible vehicle parameter.
void setEmergencyDecel(double emergencyDecel)
Set a new value for this type's emergency deceleration.
static SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc=SVC_IGNORING)
Checks whether the string describes a known vehicle class.
MSStageType getStageType() const
TRACI_CONST int VAR_LANEPOSITION
SUMOTime getIntendedDepart() const
void reroute(ConstMSEdgeVector &newEdges, double departPos, int firstIndex, int nextIndex)
set new walk and replace the stages with relative indices in the interval [firstIndex, nextIndex[
bool isPerson() const
Whether it is a person.
virtual bool wrapColor(const std::string &objID, const int variable, const TraCIColor &value)=0
virtual double getHeadwayTime() const
Get the driver's desired headway [s].
unsigned char green() const
Returns the green-amount of the color.
ConstMSEdgeVector getEdges() const
the edges of the current stage
const MSJunction * getFromJunction() const
static TraCIPosition getPosition3D(const std::string &personID)
bool add(MSTransportable *transportable)
Adds a single transportable, returns false if an id clash occurred.
TRACI_CONST int STAGE_DRIVING
double interpolateLanePosToGeometryPos(double lanePos) const
const std::string & getID() const
Returns the name of the vehicle type.
double travelTime
duration of the stage in seconds
void setWidth(const double &width)
Set a new value for this type's width.
double getActionStepLengthSecs() const
Returns this type's default action step length in seconds.
static void appendWaitingStage(const std::string &personID, double duration, const std::string &description="waiting", const std::string &stopID="")
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
constVehIt loadedEnd() const
Returns the end of the internal transportables map.
void replaceVehicleType(MSVehicleType *type)
Replaces the current vehicle type by the one given.
double getLength() const
Get vehicle's length [m].
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper)
void setVClass(SUMOVehicleClass vclass)
Set a new value for this type's vehicle class.
const MSEdge * getArrivalEdge() const
returns the final arrival edge
std::vector< MSStage * > MSTransportablePlan
the structure holding the plan of a transportable
MSStage * getNextStage(int next) const
Return the current stage.
unsigned char red() const
Returns the red-amount of the color.
bool isWalkingArea() const
return whether this edge is walking area
const MSVehicleType & getVehicleType() const
Returns the object's "vehicle" type.
const std::set< std::string > & getLines() const
virtual double getWaitingSeconds() const
the time this transportable spent waiting in seconds
SUMOVehicleShape getVehicleShapeID(const std::string &name)
Returns the class id of the shape class given by its name.
Position getPosition(const double) const
Return current position (x/y, cartesian)
static std::shared_ptr< VariableWrapper > makeWrapper()
virtual MSTransportable * buildPerson(const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan, std::mt19937 *rng) const
Builds a new person.
bool isNormal() const
return whether this edge is an internal edge
std::string getVehicleType() const
std::string intended
id of the intended vehicle for public transport ride
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)
virtual bool wrapStringList(const std::string &objID, const int variable, const std::vector< std::string > &value)=0
void setMaxSpeedLat(const double &maxSpeedLat)
Set a new value for this type's maximum lateral speed.
void setPreferredLateralAlignment(LateralAlignment latAlignment)
Set vehicle's preferred lateral alignment.
TRACI_CONST double INVALID_DOUBLE_VALUE
TRACI_CONST int VAR_TAXI_RESERVATIONS
virtual ConstMSEdgeVector getEdges() const
the edges of the current stage
static std::string getRoadID(const std::string &personID)
static double getLanePosition(const std::string &personID)
Representation of a lane in the micro simulation.
const Distribution_Parameterized & getSpeedFactor() const
Returns this type's speed factor.
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.
DepartDefinition
Possible ways to depart.
vehicles ignoring classes
std::string getReservationID(Reservation *res)
int getNumStages() const
Return the total number stages in this persons plan.
std::string id
The vehicle's id.