207 myParent->stopTrack();
255 if (microVeh !=
nullptr) {
257 if (lane !=
nullptr) {
262 if (lane !=
nullptr) {
270 myParent->destroyPopup();
280 if (microVeh !=
nullptr) {
284 std::string errorOut;
287 if (stopPos.first !=
nullptr) {
289 stop.
lane = stopPos.first->getID();
291 stop.
endPos = stopPos.second + POSITION_EPS;
294 if (errorOut !=
"") {
326 if (i->first->getTrackedID() ==
getGlID()) {
327 i->first->stopTrack();
329 while (i->first->removeAdditionalGLVisualisation(
this));
365 showLoops->setCheck(
false);
368 showLoops->setCheck(
true);
380 new FXMenuSeparator(ret);
393 new FXMenuSeparator(ret);
436 const double degAngle =
RAD2DEG(angle +
M_PI / 2.);
439 glRotated(degAngle, 0, 0, 1);
451 double upscaleLength = upscale;
454 const double widthLengthFactor = length / 5;
455 const double shrinkFactor =
MIN2(widthLengthFactor, sqrt(upscaleLength));
456 upscaleLength /= shrinkFactor;
458 glScaled(upscale, upscaleLength, 1);
470 bool drawCarriages =
false;
476 double scaledLength = length * geometryFactor;
477 if (col.
alpha() != 0) {
489 glTranslated(0, 0, .1);
498 const double w = 1.8 * sqrt(
getVType().getWidth() / 1.8);
509 glColor3d(0., 1., 0.);
512 glVertex2d(0., minGap);
513 glVertex2d(-.5, minGap);
514 glVertex2d(.5, minGap);
520 glColor3d(1., 0., 0.);
523 glVertex2d(0., brakeGap);
524 glVertex2d(-.5, brakeGap);
525 glVertex2d(.5, brakeGap);
530 if (dev !=
nullptr) {
531 glColor3d(1., 0., 0.);
537 glTranslated(0, 0, .1);
556 if (!drawCarriages) {
589 glTranslated(0,
MIN2(scaledLength / 2,
double(5)), -
getType());
590 glScaled(1 / upscale, 1 / upscaleLength, 1);
591 glRotated(-degAngle, 0, 0, 1);
594 glRotated(-s.
angle, 0, 0, 1);
596 glRotated(s.
angle, 0, 0, 1);
600 glRotated(-s.
angle, 0, 0, 1);
602 glRotated(s.
angle, 0, 0, 1);
607 glRotated(-s.
angle, 0, 0, 1);
609 glRotated(s.
angle, 0, 0, 1);
618 glRotated(-s.
angle, 0, 0, 1);
620 glRotated(s.
angle, 0, 0, 1);
621 for (std::string& line : lines) {
623 glRotated(-s.
angle, 0, 0, 1);
625 glRotated(s.
angle, 0, 0, 1);
631 glRotated(-s.
angle, 0, 0, 1);
633 glRotated(s.
angle, 0, 0, 1);
638 if (!drawCarriages) {
643 const Position back = (p1 +
Position(-scaledLength * upscaleLength, 0)).rotateAround2D(angle, p1);
667 glTranslated(0, 0,
getType() - .1);
681 for (
int i = noReroutePlus1 - 1; i >= 0; i--) {
682 double darken = double(0.4) / double(noReroutePlus1) * double(i);
699 glTranslated(pos.
x(), pos.
y(), -.1);
703 glTranslated(-pos.
x(), -pos.
y(), .1);
721 switch (activeScheme) {
777 double hue = 180. + atan2(center.
x() - p.
x(), center.
y() - p.
y()) * 180. /
M_PI;
786 double hue = 180. + atan2(center.
x() - p.
x(), center.
y() - p.
y()) * 180. /
M_PI;
795 double hue = 180. + atan2(pb.
x() - pe.
x(), pb.
y() - pe.
y()) * 180. /
M_PI;
803 std::hash<const MSBaseVehicle*> ptr_hash;
804 const double hue = (double)(ptr_hash(veh) % 360);
805 const double sat = (double)((ptr_hash(veh) / 360) % 67) / 100.0 + 0.33;
821 switch (activeScheme) {
845 return (microVeh !=
nullptr
876 WRITE_WARNINGF(
TL(
"Vehicle parameter '%' key '%' is not a number for vehicle '%'."),
920 darker = vehColor.
multiply(1 - darken);
928 if (route !=
nullptr) {
937 std::map<const MSLane*, int> repeat;
941 if (stop.getSpeed() > 0) {
942 stopLanePos = stop.reached ? stop.pars.endPos : stop.pars.startPos;
946 if (stop.isOpposite && !stop.reached) {
947 stopLanePos = stop.lane->getLength() - stopLanePos;
949 Position pos = stop.lane->geometryPositionAtOffset(stopLanePos);
952 std::string label = (stop.getSpeed() > 0
953 ? (stop.reached ?
"passing waypoint" :
"waypoint ")
954 : (stop.reached ?
"stopped" :
"stop "));
959 if (stop.isOpposite) {
960 label +=
" (opposite)";
966 label +=
" triggered:";
967 if (stop.triggered) {
969 if (stop.numExpectedPerson > 0) {
970 label +=
"(" +
toString(stop.numExpectedPerson) +
")";
973 if (stop.containerTriggered) {
974 label +=
"container";
975 if (stop.numExpectedContainer > 0) {
976 label +=
"(" +
toString(stop.numExpectedContainer) +
")";
979 if (stop.joinTriggered) {
981 if (stop.pars.join !=
"") {
982 label +=
"(" + stop.pars.join +
")";
988 }
else if (stop.pars.until >= 0) {
991 if (stop.duration >= 0 || stop.pars.duration > 0) {
993 label +=
" duration:1day+";
995 label +=
" duration:" +
time2string(stop.duration);
998 if (stop.getSpeed() > 0) {
999 if (stop.skipOnDemand) {
1000 label +=
" onDemand (skipped)";
1002 label +=
" speed:" +
toString(stop.getSpeed());
1005 if (stop.pars.actType !=
"") {
1006 label +=
" actType:" + stop.pars.actType;
1010 if (noLoop && repeat[stop.lane] > 0) {
1014 repeat[stop.lane]++;
1036 if (pm !=
nullptr) {
1037 for (
auto item : *pm) {
1039 if (item.second.blockedAtTime >= 0) {
1046 if (item.second.score !=
"") {
1073 int personIndex = 0;
1074 for (std::vector<MSTransportable*>::const_iterator i = ps.begin(); i != ps.end(); ++i) {
1076 assert(person != 0);
1083 int containerIndex = 0;
1084 for (std::vector<MSTransportable*>::const_iterator i = cs.begin(); i != cs.end(); ++i) {
1086 assert(container != 0);
1091#ifdef DRAW_BOUNDING_BOX
1096 glTranslated(0, 0,
getType());
1098 glColor3d(0.5, .8, 0);
1100 glTranslated(0, 0, 0.1);
1102 boundingBox.push_back(boundingBox.front());
1118 if (
getVType().getParameter().carriageLength > 0) {
1151 std::vector<std::string> devs;
1153 devs.push_back(d->deviceName());
1161 if (requiredSeats <= 0) {
1164 maxSeats =
MAX2(maxSeats, 1);
1165 seatOffset *= exaggeration;
1168 const int rowSize =
MAX2(1, (
int)floor(vehWidth / seatOffset));
1169 const double rowOffset =
MAX2(1.0, (length -
getVType().getFrontSeatPos() - 1)) / ceil((
double)maxSeats / rowSize);
1170 const double sideOffset = (rowSize - 1) / 2.0 * seatOffset;
1175 for (
int i = 0; requiredSeats > 0 && i < maxSeats; i++) {
1176 int seat = (i % rowSize);
1178 rowPos += rowOffset;
@ MID_HIDE_ALLROUTES
Hide all vehicle's routes.
@ MID_HIDE_BEST_LANES
Hide vehicle's best lanes.
@ MID_HIDE_CURRENTROUTE
Hide vehicle's current route.
@ MID_SHOW_FOES
select foes of a vehicle
@ MID_SHOW_BEST_LANES
Show vehicle's best lanes.
@ MID_START_TRACK
Start to track a vehicle.
@ MID_SHOW_ALLROUTES
Show all vehicle's routes.
@ MID_SHOW_ROUTE_NOLOOPS
Show vehicle's future route (without loops)
@ MID_HIDE_ROUTE_NOLOOPS
Hide vehicle's future route (without loops)
@ MID_TOGGLE_STOP
toggle stop state of a vehicle or person
@ MID_REMOVE_OBJECT
remove a vehicle or person
@ MID_SHOW_FUTUREROUTE
Show vehicle's future route.
@ MID_HIDE_FUTUREROUTE
Hide vehicle's future route.
@ MID_SHOW_CURRENTROUTE
Show vehicle's current route.
@ MID_STOP_TRACK
Stop to track a vehicle.
@ MID_SELECT_TRANSPORTED
select transportables of a vehicle
FXDEFMAP(GUIBaseVehicle::GUIBaseVehiclePopupMenu) GUIBaseVehiclePopupMenuMap[]
GUISelectedStorage gSelected
A global holder of selected objects.
GUIIcon
An enumeration of icons used by the gui applications.
#define WRITE_WARNINGF(...)
#define WRITE_WARNING(msg)
std::shared_ptr< const MSRoute > ConstMSRoutePtr
std::string time2string(SUMOTime t)
convert SUMOTime to string
const long long int VTYPEPARS_COLOR_SET
@ RAIL_CARGO
render as a cargo train
@ EMERGENCY
render as an emergency vehicle
@ SCOOTER
render as a scooter
@ RAIL_CAR
render as a (city) rail without locomotive
@ SHIP
render as a arbitrary ship
@ BICYCLE
render as a bicycle
@ MOTORCYCLE
render as a motorcycle
@ ANT
render as a giant ant
@ AIRCRAFT
render as aircraft
@ FIREBRIGADE
render as a fire brigade
@ POLICE
render as a police car
@ PEDESTRIAN
render as a pedestrian
const int VEHPARS_COLOR_SET
const int VEHPARS_ARRIVALPOS_SET
const double SUMO_const_waitingContainerWidth
const double SUMO_const_waitingPersonWidth
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
Position getCenter() const
Returns the center of the boundary.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
double ymin() const
Returns minimum y-coordinate.
double xmin() const
Returns minimum x-coordinate.
Boundary & grow(double by)
extends the boundary by the given amount
double ymax() const
Returns maximum y-coordinate.
double xmax() const
Returns maximum x-coordinate.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
static void pushName(unsigned int name)
push Name
static void drawOutlineCircle(double width, double iwidth, int steps=8)
Draws an unfilled circle around (0,0)
static void popMatrix()
pop matrix
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
static void popName()
pop Name
static void pushMatrix()
push matrix
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, const int align=0, double width=-1)
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048, const int align=0)
static bool drawAction_drawVehicleAsImage(const GUIVisualizationSettings &s, const std::string &file, const GUIGlObject *o, const double width, double length)
try to draw vehicle as raster image and return true if successful
static void drawAction_drawVehicleAsCircle(const double width, double detail)
draw vehicle as a circle
static void drawAction_drawVehicleAsTrianglePlus(const double width, const double length, bool amReversed=false)
draw vehicle as a triangle
static void drawAction_drawVehicleAsPoly(const GUIVisualizationSettings &s, const SUMOVehicleShape shape, const double width, const double length, int carriageIndex=-1, bool isStopped=false, bool amReversed=false)
draw vehicle as a polygon
static void drawAction_drawVehicleAsBoxPlus(const double width, const double length, bool amReversed=false)
draw vehicle as a Box
A MSVehicle extended by some values for usage within the gui.
void drawParkingInfo(const GUIVisualizationSettings &s, const RGBColor &col) const
const Seat & getContainerPosition(int containerIndex) const
static bool setFunctionalColor(int activeScheme, const MSBaseVehicle *veh, RGBColor &col)
sets the color according to the current scheme index and some vehicle function
const std::string getOptionalName() const
Returns the value for generic parameter 'name' or ''.
virtual void drawAction_drawLinkItems(const GUIVisualizationSettings &) const
const Seat & getSeatPosition(int personIndex) const
returns the seat position for the person with the given index
RGBColor setColor(const GUIVisualizationSettings &s) const
sets the color according to the current settings
int getNumContainers() const
return the number of passengers
void drawOnPos(const GUIVisualizationSettings &s, const Position &pos, const double angle) const
Draws the object on the specified position with the specified angle.
GUIGLObjectPopupMenu * myPopup
current popup (to clean up in destructor). GUIBaseVehicle is not responsible for removal
GUIBaseVehicle(MSBaseVehicle &vehicle)
MSDevice_Vehroutes * myRoutes
virtual void drawAction_drawPersonsAndContainers(const GUIVisualizationSettings &s) const
bool hasActiveAddVisualisation(GUISUMOAbstractView *const parent, int which) const
Returns whether the named feature is enabled in the given view.
virtual void drawRouteHelper(const GUIVisualizationSettings &s, ConstMSRoutePtr r, bool future, bool noLoop, const RGBColor &col) const =0
Draws the route.
void removeActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
void drawRoute(const GUIVisualizationSettings &s, int routeNo, double darken, bool future=false, bool noLoop=false) const
Chooses the route to draw and draws it, darkening it as given.
virtual Position getVisualPosition(bool s2, const double offset=0) const =0
Return current position taking into account secondary shape.
std::vector< Seat > Seats
MSBaseVehicle & myVehicle
The vehicle to which all calls should be delegated.
virtual void drawAction_drawVehicleBlinker(double) const
void removedPopupMenu()
notify object about popup menu removal
void addActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
static void drawLinkItem(const Position &pos, SUMOTime arrivalTime, SUMOTime leaveTime, double exagerate)
double getScaleValue(const GUIVisualizationSettings &s, int activeScheme) const
gets the size multiplier value according to the current scheme index
virtual void drawBestLanes() const
Draws the vehicle's best lanes.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
void computeSeats(const Position &front, const Position &back, double seatOffset, int maxSeats, double exaggeration, int &requiredSeats, Seats &into) const
add seats to mySeatPositions and update requiredSeats
virtual Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
@ VO_SHOW_LFLINKITEMS
LFLinkItems.
@ VO_SHOW_ALL_ROUTES
show all vehicle's routes
@ VO_TRACK
track the vehicle (only needed for cleaning up)
@ VO_SHOW_ROUTE_NOLOOP
show vehicle's routes without loops
@ VO_SHOW_FUTURE_ROUTE
show vehicle's current continued from the current position
@ VO_SHOW_ROUTE
show vehicle's current route
@ VO_SHOW_BEST_LANES
show vehicle's best lanes
virtual void drawAction_drawCarriageClass(const GUIVisualizationSettings &s, bool asImage) const =0
draws the given guiShape with distinct carriages/modules
virtual void drawGLAdditional(GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
Draws additionally triggered visualisations.
Seats myContainerPositions
bool drawReversed(const GUIVisualizationSettings &s) const
whether to reverse trains in their reversed state
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
FXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
virtual void drawAction_drawVehicleBrakeLight(double length, bool onlyOne=false) const
virtual double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const =0
gets the color value according to the current scheme index
int getNumPassengers() const
return the number of passengers
bool drawAction_drawVehicleAsPolyWithCarriagges(const GUIVisualizationSettings &s, double scaledLength, bool asImage=false) const
draw vehicle body and return whether carriages are being drawn
~GUIBaseVehicle()
destructor
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
virtual void drawAction_drawVehicleBlueLight() const
std::map< GUISUMOAbstractView *, int > myAdditionalVisualizations
Enabled visualisations, per view.
virtual void selectBlockingFoes() const =0
adds the blocking foes to the current selection
void drawStopLabels(const GUIVisualizationSettings &s, bool noLoop, const RGBColor &col) const
Seats mySeatPositions
positions of seats in the vehicle (updated at every drawing step)
const MSBaseVehicle & getVehicle()
std::string getDeviceDescription()
lists equipped device (types) for the current vehicle
virtual double getVisualAngle(bool s2) const =0
Returns the vehicle's direction in radians taking into account secondary shape.
const MSVehicleType & getVType() const
A shortcut to myVehicle.myType.
void setPositionInVehicle(const GUIBaseVehicle::Seat &pos)
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
void buildShowTypeParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the type parameter window.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, const GUIMainWindow &app) const
Builds an entry which allows to copy the cursor position if geo projection is used,...
GUIGlID getGlID() const
Returns the numerical id of the object.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0, bool forceShow=false) const
draw name of item
static bool gSecondaryShape
whether secondary shapes are currently being drawn
A MSNet extended by some values for usage within the gui.
A lane area vehicles can halt at (gui-version)
const Position & getSignPos() const
void setPositionInVehicle(const GUIBaseVehicle::Seat &pos)
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
const T getColor(const double value) const
bool removeAdditionalGLVisualisation(GUIGlObject *const which)
Removes an object from the list of objects that show additional things.
void destroyPopup()
destroys the popup
bool addAdditionalGLVisualisation(GUIGlObject *const which)
Adds an object to call its additional visualisation method.
virtual GUIGlID getTrackedID() const
get tracked id
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
Stores the information about how to visualize structures.
GUIVisualizationTextSettings vehicleName
GUIVisualizationSizeSettings vehicleSize
bool showBlinker
Information whether vehicle blinkers shall be drawn.
GUIColorer vehicleColorer
The vehicle colorer.
GUIVisualizationTextSettings vehicleScaleValue
std::string vehicleScaleParam
key for scaling by vehicle parameter
bool showParkingInfo
Set whether parking related information should be shown.
GUIVisualizationTextSettings vehicleValue
int vehicleQuality
The quality of vehicle drawing.
double laneWidthExaggeration
The lane exaggeration (upscale thickness)
std::string vehicleTextParam
key for rendering vehicle textual parameter
bool scaleLength
Whether vehicle length shall be scaled with length/geometry factor.
GUIScaler vehicleScaler
The size scaling settings for vehicles.
double scale
information about a lane's width (temporary, used for a single view)
bool secondaryShape
whether secondary lane shape shall be drawn
bool drawMinGap
Information whether the minimum gap shall be drawn.
GUIVisualizationTextSettings vehicleText
bool showBTRange
Information whether the communication range shall be drawn.
bool drawReversed
Whether to draw reversed vehicles in their reversed state.
bool drawBrakeGap
Information whether the brake gap shall be drawn.
bool drawLaneChangePreference
Information whether the lane change preference shall be drawn.
double angle
The current view rotation angle.
static double naviDegree(const double angle)
void vaporizeCar(MEVehicle *v, MSMoveReminder::Notification reason)
remove the given car and clean up the relevant data structures
A vehicle from the mesoscopic point of view.
The base class for microscopic and mesoscopic vehicles.
MSVehicleDevice * getDevice(const std::type_info &type) const
Returns a device of the given type if it exists, nullptr otherwise.
ConstMSRoutePtr getRoutePtr() const
Returns the current route.
virtual bool isSelected() const
whether this vehicle is selected in the GUI
const std::vector< MSTransportable * > & getPersons() const
retrieve riding persons
std::map< const MSParkingArea *, PaMemory, ComparatorIdLess > ParkingMemory
const std::vector< MSVehicleDevice * > & getDevices() const
Returns this vehicle's devices.
virtual double getArrivalPos() const
Returns this vehicle's desired arrivalPos for its current route (may change on reroute)
virtual double getStopDelay() const
Returns the estimated public transport stop (departure) delay in seconds.
MoveReminderCont myMoveReminders
Currently relevant move reminders.
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
int getNumberParkingReroutes() const
std::vector< MSVehicleDevice * > myDevices
The devices this vehicle has.
virtual const MSEdge * getCurrentEdge() const
Returns the edge the vehicle is currently at (possibly an internal edge)
bool isReversed() const
Returns whether the logical state of the vehicle is reversed - for drawing.
virtual double getTimeLossSeconds() const
Returns the time loss in seconds.
const MSRouteIterator & getCurrentRouteEdge() const
Returns an iterator pointing to the current edge in this vehicles route.
bool isParking() const
Returns whether the vehicle is parking.
const MSEdge * getEdge() const
Returns the edge the vehicle is currently at.
virtual int getArrivalLane() const
MSDevice_Transportable * myContainerDevice
The containers this vehicle may have.
const std::list< MSStop > & getStops() const
double getWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s)
const MSDevice_Transportable * getPersonDevice() const
MSDevice_Transportable * myPersonDevice
The passengers this vehicle may have.
std::string getPrefixedParameter(const std::string &key, std::string &error) const
retrieve parameters of devices, models and the vehicle itself
virtual double getStopArrivalDelay() const
Returns the estimated public transport stop arrival delay in seconds.
bool isStoppedTriggered() const
Returns whether the vehicle is on a triggered stop.
virtual double getAcceleration() const
Returns the vehicle's acceleration.
virtual double getRightSideOnEdge(const MSLane *lane=0) const
Get the vehicle's lateral position on the edge of the given lane (or its current edge if lane == 0)
const MSRoute & getRoute() const
Returns the current route.
const MSDevice_Transportable * getContainerDevice() const
SUMOTime getDepartDelay() const
Returns the depart delay.
int getNumberReroutes() const
Returns the number of new routes this vehicle got.
virtual bool isOnRoad() const
Returns the information whether the vehicle is on a road (is simulated)
const std::vector< MSTransportable * > & getContainers() const
retrieve riding containers
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
bool isStopped() const
Returns whether the vehicle is at a stop.
const ParkingMemory * getParkingMemory() const
double brakeGap(const double speed) const
Returns the distance the vehicle needs to halt including driver's reaction time tau (i....
static double getRange()
Returns the configured range.
const std::vector< MSTransportable * > & getTransportables() const
Returns the list of transportables using this vehicle.
int size() const
Return the number of passengers / containers.
ConstMSRoutePtr getRoute(int index) const
Called on route retrieval.
static MSDevice_Vehroutes * buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into, int maxRoutes=std::numeric_limits< int >::max())
Build devices for the given vehicle, if needed.
Abstract in-vehicle / in-person device.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
double getWidth() const
Returns the edges's width (sum over all lanes)
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the maximum speed the vehicle may use on this edge.
static MELoop * gMesoNet
mesoscopic simulation infrastructure
static bool gLefthand
Whether lefthand-drive is being simulated.
static bool gUseStopEnded
whether the simulation should replay previous stop times
Representation of a lane in the micro simulation.
virtual MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify=true)
virtual double getLengthGeometryFactor(bool) const
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
virtual const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
virtual void releaseVehicles() const
Allows to use the container for microsimulation again.
virtual const PositionVector & getShape(bool) const
double getWidth() const
Returns the lane's width.
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
@ NOTIFICATION_VAPORIZED_GUI
The vehicle got removed via the GUI.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
const ConstMSEdgeVector & getEdges() const
const RGBColor & getColor() const
Returns the color.
void scheduleVehicleRemoval(SUMOVehicle *veh, bool checkDuplicate=false)
Removes a vehicle after it has ended.
Representation of a vehicle in the micro simulation.
double getTimeGapOnLane() const
Returns the time gap in seconds to the leader of the vehicle on the same lane.
PositionVector getBoundingPoly(double offset=0) const
get bounding polygon
double getAccumulatedWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s) within the last millisecs.
MSAbstractLaneChangeModel & getLaneChangeModel()
bool addTraciStop(SUMOVehicleParameter::Stop stop, std::string &errorMsg)
PositionVector getBoundingBox(double offset=0) const
get bounding rectangle
void onRemovalFromNet(const MSMoveReminder::Notification reason)
Called when the vehicle is removed from the network.
bool resumeFromStopping()
int getBestLaneOffset() const
const MSLane * getLane() const
Returns the lane the vehicle is on.
MSLane * getMutableLane() const
Returns the lane the vehicle is on Non const version indicates that something volatile is going on.
std::pair< const MSLane *, double > getLanePosAfterDist(double distance) const
return lane and position along bestlanes at the given distance
double getSpeed() const
Returns the vehicle's current speed.
const MSCFModel & getCarFollowModel() const
Returns the vehicle's car following model definition.
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
double getSeatingWidth() const
Get the width of the passenger compartment when being drawn.
double getMinGap() const
Get the free space in front of vehicles of this class.
double getFrontSeatPos() const
Get offset of first seat from vehicle front.
double getLength() const
Get vehicle's length [m].
SUMOVehicleShape getGuiShape() const
Get this vehicle type's shape.
bool wasSet(int what) const
Returns whether the given parameter was set.
const RGBColor & getColor() const
Returns this type's color.
const std::string & getID() const
Returns the id.
virtual const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
A point in 2D or 3D with translation and scaling methods.
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
double x() const
Returns the x-position.
double angleTo2D(const Position &other) const
returns the angle in the plane of the vector pointing from here to the other position
double y() const
Returns the y-position.
PositionVector getOrthogonal(const Position &p, double extend, bool before, double length=1.0, double deg=90) const
return orthogonal through p (extending this vector if necessary)
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
static const RGBColor WHITE
static const RGBColor BLUE
unsigned char alpha() const
Returns the alpha-amount of the color.
RGBColor multiply(double factor) const
Returns a new color with altered brightness.
static const RGBColor GREEN
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
static const RGBColor BLACK
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
static const RGBColor DEFAULT_COLOR
The default color (for vehicle types and vehicles)
static const RGBColor RED
named colors
virtual const MSLane * getLane() const =0
Returns the lane the object is currently at.
virtual double getSpeed() const =0
Returns the object's current speed.
virtual double getPositionOnLane() const =0
Get the object's position along the lane.
virtual double getAngle() const =0
Get the vehicle's angle.
Definition of vehicle stop (position and duration)
std::string lane
The lane to stop at.
double startPos
The stopping position start.
double endPos
The stopping position end.
SUMOTime duration
The stopping duration.
RGBColor color
The vehicle's color, TraCI may change this.
bool wasSet(int what) const
Returns whether the given parameter was set.
int arrivalEdge
(optional) The final edge within the route of the vehicle
std::string line
The vehicle's line (mainly for public transport)
static const int NEWLINE
identifier for splitting the given string at all newline characters
std::vector< std::string > getVector()
return vector of strings
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
bool constantSizeSelected
whether only selected objects shall be drawn with constant
bool show(const GUIGlObject *o) const
whether to show the text
double scaledSize(double scale, double constFactor=0.1) const
get scale size