SUMO - Simulation of Urban MObility
MSVehicleType Class Reference

The car-following model and parameter. More...

#include <MSVehicleType.h>

Collaboration diagram for MSVehicleType:
Collaboration graph

Public Member Functions

void check ()
 Checks whether vehicle type parameters may be problematic (Currently, only the value for the action step length is compared with the value for the desired headway time.) More...
 
const SUMOVTypeParametergetParameter () const
 
bool isVehicleSpecific () const
 Returns whether this type belongs to a single vehicle only (was modified) More...
 
 MSVehicleType (const SUMOVTypeParameter &parameter)
 Constructor. More...
 
bool wasSet (int what) const
 Returns whether the given parameter was set. More...
 
virtual ~MSVehicleType ()
 Destructor. More...
 
Atomar getter for simulation
const std::string & getID () const
 Returns the name of the vehicle type. More...
 
int getNumericalID () const
 Returns the running index of the vehicle type. More...
 
double getLength () const
 Get vehicle's length [m]. More...
 
double getLengthWithGap () const
 Get vehicle's length including the minimum gap [m]. More...
 
double getMinGap () const
 Get the free space in front of vehicles of this class. More...
 
double getMinGapLat () const
 Get the minimum lateral gap that vehicles of this type maintain. More...
 
const MSCFModelgetCarFollowModel () const
 Returns the vehicle type's car following model definition (const version) More...
 
MSCFModelgetCarFollowModel ()
 Returns the vehicle type's car following model definition (non-const version) More...
 
LaneChangeModel getLaneChangeModel () const
 
double getMaxSpeed () const
 Get vehicle's maximum speed [m/s]. More...
 
double computeChosenSpeedDeviation (std::mt19937 *rng, const double minDev=-1.) const
 Computes and returns the speed deviation. More...
 
double getDefaultProbability () const
 Get the default probability of this vehicle type. More...
 
SUMOVehicleClass getVehicleClass () const
 Get this vehicle type's vehicle class. More...
 
SUMOEmissionClass getEmissionClass () const
 Get this vehicle type's emission class. More...
 
const RGBColorgetColor () const
 Returns this type's color. More...
 
const Distribution_ParameterizedgetSpeedFactor () const
 Returns this type's speed factor. More...
 
SUMOTime getActionStepLength () const
 Returns this type's default action step length. More...
 
double getActionStepLengthSecs () const
 Returns this type's default action step length in seconds. More...
 
double getImpatience () const
 Returns this type's impatience. More...
 
Atomar getter for visualization
double getWidth () const
 Get the width which vehicles of this class shall have when being drawn. More...
 
double getHeight () const
 Get the height which vehicles of this class shall have when being drawn. More...
 
SUMOVehicleShape getGuiShape () const
 Get this vehicle type's shape. More...
 
std::string getOSGFile () const
 Get this vehicle type's 3D model file name. More...
 
std::string getImgFile () const
 Get this vehicle type's raster model file name. More...
 
int getPersonCapacity () const
 Get this vehicle type's person capacity. More...
 
int getContainerCapacity () const
 Get this vehicle type's container capacity. More...
 
SUMOTime getBoardingDuration () const
 Get this vehicle type's boarding duration. More...
 
SUMOTime getLoadingDuration () const
 Get this vehicle type's loading duration. More...
 
double getMaxSpeedLat () const
 Get vehicle's maximum lateral speed [m/s]. More...
 
LateralAlignment getPreferredLateralAlignment () const
 Get vehicle's preferred lateral alignment. More...
 
Setter methods
void setLength (const double &length)
 Set a new value for this type's length. More...
 
void setHeight (const double &height)
 Set a new value for this type's height. More...
 
void setMinGap (const double &minGap)
 Set a new value for this type's minimum gap. More...
 
void setMinGapLat (const double &minGapLat)
 Set a new value for this type's minimum lataral gap. More...
 
void setMaxSpeed (const double &maxSpeed)
 Set a new value for this type's maximum speed. More...
 
void setMaxSpeedLat (const double &maxSpeedLat)
 Set a new value for this type's maximum lateral speed. More...
 
void setVClass (SUMOVehicleClass vclass)
 Set a new value for this type's vehicle class. More...
 
void setDefaultProbability (const double &prob)
 Set a new value for this type's default probability. More...
 
void setSpeedFactor (const double &factor)
 Set a new value for this type's speed factor. More...
 
void setSpeedDeviation (const double &dev)
 Set a new value for this type's speed deviation. More...
 
void setActionStepLength (const SUMOTime actionStepLength, bool resetActionOffset)
 Set a new value for this type's action step length. More...
 
void setEmissionClass (SUMOEmissionClass eclass)
 Set a new value for this type's emission class. More...
 
void setColor (const RGBColor &color)
 Set a new value for this type's color. More...
 
void setWidth (const double &width)
 Set a new value for this type's width. More...
 
void setShape (SUMOVehicleShape shape)
 Set a new value for this type's shape. More...
 
void setImpatience (const double impatience)
 Set a new value for this type's impatience. More...
 
void setPreferredLateralAlignment (LateralAlignment latAlignment)
 Set vehicle's preferred lateral alignment. More...
 

Private Member Functions

 MSVehicleType (const MSVehicleType &)
 Invalidated copy constructor. More...
 
MSVehicleTypeoperator= (const MSVehicleType &)
 Invalidated assignment operator. More...
 

Private Attributes

double myCachedActionStepLengthSecs
 the vtypes actionsStepLength in seconds (cached because needed very often) More...
 
MSCFModelmyCarFollowModel
 instance of the car following model. More...
 
const int myIndex
 the running index More...
 
const MSVehicleTypemyOriginalType
 The original type. More...
 
SUMOVTypeParameter myParameter
 the parameter container More...
 
bool myWarnedActionStepLengthTauOnce
 Indicator whether the user was already warned once about an action step length larger than the desired time headway. More...
 

Static Private Attributes

static int myNextIndex = 0
 next value for the running index More...
 

methods for building vehicle types

MSVehicleTypebuildSingularType (const std::string &id) const
 Duplicates the microsim vehicle type giving the newly created type the given id, marking it as vehicle specific. More...
 
MSVehicleTypeduplicateType (const std::string &id, bool persistent) const
 Duplicates the microsim vehicle type giving the newly created type the given id. More...
 
static MSVehicleTypebuild (SUMOVTypeParameter &from)
 Builds the microsim vehicle type described by the given parameter. More...
 

Detailed Description

The car-following model and parameter.

MSVehicleType stores the parameter of a single vehicle type and methods that use these for computing the vehicle's car-following behavior

It is assumed that within the simulation many vehicles are using the same vehicle type, quite common is using only one vehicle type for all vehicles.

You can think of it like of having a vehicle type for each VW Golf or Ford Mustang in your simulation while the car instances just refer to it.

Definition at line 72 of file MSVehicleType.h.

Constructor & Destructor Documentation

◆ MSVehicleType() [1/2]

MSVehicleType::MSVehicleType ( const SUMOVTypeParameter parameter)

◆ ~MSVehicleType()

MSVehicleType::~MSVehicleType ( )
virtual

Destructor.

Definition at line 77 of file MSVehicleType.cpp.

References myCarFollowModel.

◆ MSVehicleType() [2/2]

MSVehicleType::MSVehicleType ( const MSVehicleType )
private

Invalidated copy constructor.

Member Function Documentation

◆ build()

MSVehicleType * MSVehicleType::build ( SUMOVTypeParameter from)
static

◆ buildSingularType()

MSVehicleType * MSVehicleType::buildSingularType ( const std::string &  id) const

Duplicates the microsim vehicle type giving the newly created type the given id, marking it as vehicle specific.

Parameters
[in]idThe new id of the type
Returns
The built vehicle type
Note
This method is used in case that a vType is meant to be used only for a specific vehicle The created vType will be removed with the vehicle or if it is assigned a new type.

Definition at line 370 of file MSVehicleType.cpp.

References duplicateType().

Referenced by getPreferredLateralAlignment(), MSBaseVehicle::getSingularType(), and MSTransportable::getSingularType().

◆ check()

void MSVehicleType::check ( )

Checks whether vehicle type parameters may be problematic (Currently, only the value for the action step length is compared with the value for the desired headway time.)

Definition at line 391 of file MSVehicleType.cpp.

References SUMOVTypeParameter::actionStepLength, getCarFollowModel(), MSCFModel::getHeadwayTime(), getID(), myParameter, myWarnedActionStepLengthTauOnce, STEPS2TIME, VTYPEPARS_ACTIONSTEPLENGTH_SET, SUMOVTypeParameter::wasSet(), and WRITE_WARNING.

Referenced by build(), getParameter(), and setActionStepLength().

◆ computeChosenSpeedDeviation()

double MSVehicleType::computeChosenSpeedDeviation ( std::mt19937 *  rng,
const double  minDev = -1. 
) const

◆ duplicateType()

MSVehicleType * MSVehicleType::duplicateType ( const std::string &  id,
bool  persistent 
) const

Duplicates the microsim vehicle type giving the newly created type the given id.

Parameters
[in]idThe new id of the type
[in]persistentIf true the created vType will be persistent and can be used by several vehicles, otherwise it may be removed before simulation end,
See also
buildSingularType()
Returns
The built vehicle type

Definition at line 376 of file MSVehicleType.cpp.

References MSCFModel::duplicate(), getID(), MSNet::getInstance(), SUMOVTypeParameter::id, MSVehicleType(), myCarFollowModel, myOriginalType, and myParameter.

Referenced by buildSingularType(), libsumo::VehicleType::copy(), and getPreferredLateralAlignment().

◆ getActionStepLength()

SUMOTime MSVehicleType::getActionStepLength ( ) const
inline

Returns this type's default action step length.

Returns
The default action step length of this type (in ms.)

Definition at line 224 of file MSVehicleType.h.

References SUMOVTypeParameter::actionStepLength, and myParameter.

Referenced by MSVehicle::getActionStepLength().

◆ getActionStepLengthSecs()

double MSVehicleType::getActionStepLengthSecs ( ) const
inline

Returns this type's default action step length in seconds.

Returns
The default action step length of this type (in s.)

Definition at line 232 of file MSVehicleType.h.

References myCachedActionStepLengthSecs.

Referenced by libsumo::VehicleType::getActionStepLength(), libsumo::Vehicle::getActionStepLength(), and MSVehicle::getActionStepLengthSecs().

◆ getBoardingDuration()

SUMOTime MSVehicleType::getBoardingDuration ( ) const
inline

Get this vehicle type's boarding duration.

Returns
The time a person needs to board a vehicle of this type

Definition at line 306 of file MSVehicleType.h.

References SUMOVTypeParameter::boardingDuration, and myParameter.

Referenced by MSTransportableControl::boardAnyWaiting(), and GUIVehicle::getTypeParameterWindow().

◆ getCarFollowModel() [1/2]

◆ getCarFollowModel() [2/2]

MSCFModel& MSVehicleType::getCarFollowModel ( )
inline

Returns the vehicle type's car following model definition (non-const version)

Returns
The vehicle type's car following model definition

Definition at line 155 of file MSVehicleType.h.

References myCarFollowModel.

◆ getColor()

const RGBColor& MSVehicleType::getColor ( ) const
inline

Returns this type's color.

Returns
The color of this type

Definition at line 208 of file MSVehicleType.h.

References SUMOVTypeParameter::color, and myParameter.

Referenced by libsumo::VehicleType::getColor(), and GUIBaseVehicle::setFunctionalColor().

◆ getContainerCapacity()

int MSVehicleType::getContainerCapacity ( ) const
inline

Get this vehicle type's container capacity.

Returns
The container capacity of this vehicle type

Definition at line 299 of file MSVehicleType.h.

References SUMOVTypeParameter::containerCapacity, and myParameter.

Referenced by GUIMEVehicle::getTypeParameterWindow(), GUIVehicle::getTypeParameterWindow(), and MSTransportableControl::loadAnyWaiting().

◆ getDefaultProbability()

double MSVehicleType::getDefaultProbability ( ) const
inline

Get the default probability of this vehicle type.

Returns
The probability to use this type

Definition at line 182 of file MSVehicleType.h.

References SUMOVTypeParameter::defaultProbability, and myParameter.

Referenced by MSRouteHandler::myEndElement(), MSRouteHandler::openVehicleTypeDistribution(), and setDefaultProbability().

◆ getEmissionClass()

◆ getGuiShape()

SUMOVehicleShape MSVehicleType::getGuiShape ( ) const
inline

Get this vehicle type's shape.

Returns
The shape of this vehicle type
See also
SUMOVehicleShape

Definition at line 268 of file MSVehicleType.h.

References myParameter, and SUMOVTypeParameter::shape.

Referenced by GUIBaseVehicle::drawAction_drawVehicleAsPoly(), MSVehicle::getBoundingPoly(), and libsumo::VehicleType::getShapeClass().

◆ getHeight()

double MSVehicleType::getHeight ( ) const
inline

Get the height which vehicles of this class shall have when being drawn.

Returns
The height of this type's vehicles

Definition at line 260 of file MSVehicleType.h.

References SUMOVTypeParameter::height, and myParameter.

Referenced by libsumo::VehicleType::getHeight(), GUIContainer::getTypeParameterWindow(), GUIPerson::getTypeParameterWindow(), GUIVehicle::getTypeParameterWindow(), and setHeight().

◆ getID()

◆ getImgFile()

std::string MSVehicleType::getImgFile ( ) const
inline

Get this vehicle type's raster model file name.

Returns
The raster file name of this vehicle type

Definition at line 283 of file MSVehicleType.h.

References SUMOVTypeParameter::imgFile, and myParameter.

Referenced by GUIContainer::drawAction_drawAsImage(), GUIPerson::drawAction_drawAsImage(), and GUIBaseVehicle::drawAction_drawVehicleAsImage().

◆ getImpatience()

double MSVehicleType::getImpatience ( ) const
inline

Returns this type's impatience.

Returns
The impatience of this type

Definition at line 240 of file MSVehicleType.h.

References SUMOVTypeParameter::impatience, and myParameter.

Referenced by MSPModel_Striping::PState::getImpatience(), and setImpatience().

◆ getLaneChangeModel()

LaneChangeModel MSVehicleType::getLaneChangeModel ( ) const
inline

Definition at line 160 of file MSVehicleType.h.

References SUMOVTypeParameter::lcModel, and myParameter.

Referenced by MSVehicle::MSVehicle().

◆ getLength()

double MSVehicleType::getLength ( ) const
inline

Get vehicle's length [m].

Returns
The length vehicles of this type have in m

Definition at line 116 of file MSVehicleType.h.

References SUMOVTypeParameter::length, and myParameter.

Referenced by MSCFModel_Wiedemann::_v(), MSPModel_Striping::addCrossingVehs(), MSVehicle::addStop(), MSStoppingPlace::addTransportable(), MSLane::basePos(), MSLane::checkForPedestrians(), MSVehicle::checkRewindLinkLanes(), MSInductLoop::collectVehiclesOnDet(), MSLaneChanger::computeOvertakingTime(), MSLane::detectCollisions(), GUIContainer::drawAction_drawAsImage(), GUIPerson::drawAction_drawAsImage(), GUIVehicle::drawAction_drawLinkItems(), GUIVehicle::drawAction_drawRailCarriages(), GUIBaseVehicle::drawAction_drawVehicleAsImage(), GUIBaseVehicle::drawAction_drawVehicleAsPoly(), GUIBaseVehicle::drawAction_drawVehicleAsTrianglePlus(), MSLane::enteredByLaneChange(), MSVehicle::enterLaneAtInsertion(), MSVehicle::enterLaneAtLaneChange(), MSDevice_SSM::estimateConflictTimes(), MSLane::executeMovements(), MSLane::freeInsertion(), libsumo::Vehicle::getAccel(), MSVehicle::getBackPosition(), MEVehicle::getBackPositionOnLane(), MSVehicle::getBackPositionOnLane(), MSTransportable::getBoundingBox(), MSLane::getBruttoOccupancy(), GUIBaseVehicle::getCenteringBoundary(), MSLane::getCriticalLeader(), MSEdge::getDepartPosBound(), MSLane::getFollower(), MSLane::getFollowersOnConsecutive(), MSLink::getLeaderInfo(), MSLane::getLeaderOnConsecutive(), MSLane::getLeadersOnConsecutive(), libsumo::VehicleType::getLength(), libsumo::Vehicle::getLength(), MSPModel_Striping::PState::getLength(), MSBaseVehicle::getLength(), MSLane::getNettoOccupancy(), MSLane::getOppositeFollower(), MSLane::getOppositeLeader(), MSVehicle::getPositionOnLane(), MSLaneChanger::getRealFollower(), GUIContainer::getTypeParameterWindow(), GUIPerson::getTypeParameterWindow(), GUIMEVehicle::getTypeParameterWindow(), GUIVehicle::getTypeParameterWindow(), MSLink::getZipperSpeed(), MSLane::handleCollisionBetween(), MSLane::incorporateVehicle(), MSLCM_SL2015::informFollower(), MSLCM_SL2015::informLeader(), MSLane::integrateNewVehicle(), MSLane::isInsertionSuccess(), MSLCM_SL2015::keepLatGap(), MSInductLoop::leaveDetectorByMove(), MSLane::leftByLaneChange(), MSE2Collector::makeVehicleInfo(), MSPModel_Striping::moveInDirectionOnLane(), MSVehicleType(), MSPModel_Striping::nextBlocking(), MSInstantInductLoop::notifyMove(), MSMeanData::MeanDataValues::notifyMove(), MSInductLoop::notifyMove(), MSE3Collector::MSE3LeaveReminder::notifyMove(), MSE2Collector::notifyMove(), MSMeanData_Net::MSLaneMeanDataValues::notifyMoveInternal(), MSLCM_LC2013::overtakeDistance(), MSVehicle::planMoveInternal(), MSVehicle::processLinkAproaches(), MSVehicle::processNextStop(), MSStoppingPlace::removeTransportable(), MSLane::removeVehicle(), GUIVehicle::selectBlockingFoes(), MSLink::setApproaching(), setLength(), MSVehicle::setTentativeLaneAndPosition(), MSLaneChangerSublane::startChangeSublane(), MSVehicle::unsafeLinkAhead(), MSLCM_SL2015::updateCFRelated(), MSLCM_SL2015::updateExpectedSublaneSpeeds(), MSInstantInductLoop::write(), and MSQueueExport::writeLane().

◆ getLengthWithGap()

◆ getLoadingDuration()

SUMOTime MSVehicleType::getLoadingDuration ( ) const
inline

Get this vehicle type's loading duration.

Returns
The time a container needs to get laoded on a vehicle of this type

Definition at line 313 of file MSVehicleType.h.

References SUMOVTypeParameter::loadingDuration, and myParameter.

Referenced by GUIVehicle::getTypeParameterWindow(), and MSTransportableControl::loadAnyWaiting().

◆ getMaxSpeed()

◆ getMaxSpeedLat()

double MSVehicleType::getMaxSpeedLat ( ) const
inline

Get vehicle's maximum lateral speed [m/s].

Returns
The maximum lateral speed (in m/s) of vehicles of this class

Definition at line 320 of file MSVehicleType.h.

References SUMOVTypeParameter::maxSpeedLat, and myParameter.

Referenced by MSLCM_SL2015::checkBlocking(), MSLCM_SL2015::commitManoeuvre(), MSLCM_SL2015::computeSpeedLat(), libsumo::VehicleType::getMaxSpeedLat(), MSLeaderInfo::getSubLanes(), GUIVehicle::getTypeParameterWindow(), and setMaxSpeedLat().

◆ getMinGap()

double MSVehicleType::getMinGap ( ) const
inline

Get the free space in front of vehicles of this class.

Returns
The place before the vehicle

Definition at line 132 of file MSVehicleType.h.

References SUMOVTypeParameter::minGap, and myParameter.

Referenced by MSLCM_LC2013::_patchSpeed(), MSLCM_SL2015::_patchSpeed(), MSCFModel_IDM::_v(), MSLCM_LC2013::adaptSpeedToPedestrians(), MSVehicle::adaptToLeaders(), MSLaneChanger::checkChange(), MSLane::checkFailure(), MSVehicle::checkRewindLinkLanes(), MSLaneChanger::computeOvertakingTime(), MSLane::detectCollisionBetween(), GUIBaseVehicle::drawOnPos(), MSLane::freeInsertion(), MSLane::getCriticalLeader(), MSLane::getFollowersOnConsecutive(), MSStoppingPlace::getLastFreePos(), MSLane::getLeader(), MSVehicle::getLeader(), MSLink::getLeaderInfo(), MSLane::getLeaderOnConsecutive(), MSLaneChangerSublane::getLeaders(), MSLane::getLeadersOnConsecutive(), libsumo::VehicleType::getMinGap(), libsumo::Vehicle::getMinGap(), MSPModel_Striping::PState::getMinGap(), MSLane::getOppositeLeader(), MSLaneChanger::getRealLeader(), GUIContainer::getTypeParameterWindow(), GUIPerson::getTypeParameterWindow(), GUIMEVehicle::getTypeParameterWindow(), GUIVehicle::getTypeParameterWindow(), MSLink::getZipperSpeed(), MSLCM_SL2015::informLeaders(), MSLane::isInsertionSuccess(), MSLane::lastInsertion(), MSE2Collector::makeVehicleInfo(), MSLCM_DK2008::patchSpeed(), MSVehicle::processNextStop(), MSLane::safeInsertionSpeed(), MSAbstractLaneChangeModel::setFollowerGaps(), MSAbstractLaneChangeModel::setLeaderGaps(), setMinGap(), MSAbstractLaneChangeModel::setOrigLeaderGaps(), MSLCM_LC2013::slowDownForBlocked(), MSLCM_SL2015::slowDownForBlocked(), MSLCM_SL2015::updateExpectedSublaneSpeeds(), MSLCM_DK2008::wantsChangeToLeft(), and MSLCM_DK2008::wantsChangeToRight().

◆ getMinGapLat()

double MSVehicleType::getMinGapLat ( ) const
inline

Get the minimum lateral gap that vehicles of this type maintain.

Returns
The place before the vehicle

Definition at line 139 of file MSVehicleType.h.

References SUMOVTypeParameter::minGapLat, and myParameter.

Referenced by libsumo::VehicleType::getMinGapLat(), GUIVehicle::getTypeParameterWindow(), setMinGapLat(), and MSLCM_SL2015::updateGaps().

◆ getNumericalID()

int MSVehicleType::getNumericalID ( ) const
inline

Returns the running index of the vehicle type.

Returns
This type's numerical id

Definition at line 108 of file MSVehicleType.h.

References myIndex.

Referenced by MSAmitranTrajectories::writeVehicle().

◆ getOSGFile()

std::string MSVehicleType::getOSGFile ( ) const
inline

Get this vehicle type's 3D model file name.

Returns
The model file name of this vehicle type

Definition at line 275 of file MSVehicleType.h.

References myParameter, and SUMOVTypeParameter::osgFile.

◆ getParameter()

◆ getPersonCapacity()

int MSVehicleType::getPersonCapacity ( ) const
inline

Get this vehicle type's person capacity.

Returns
The person capacity of this vehicle type

Definition at line 291 of file MSVehicleType.h.

References myParameter, and SUMOVTypeParameter::personCapacity.

Referenced by MSTransportableControl::boardAnyWaiting(), GUIMEVehicle::getTypeParameterWindow(), and GUIVehicle::getTypeParameterWindow().

◆ getPreferredLateralAlignment()

◆ getSpeedFactor()

const Distribution_Parameterized& MSVehicleType::getSpeedFactor ( ) const
inline

Returns this type's speed factor.

Returns
The speed factor of this type

Definition at line 216 of file MSVehicleType.h.

References myParameter, and SUMOVTypeParameter::speedFactor.

Referenced by libsumo::VehicleType::getSpeedDeviation(), libsumo::Vehicle::getSpeedDeviation(), libsumo::VehicleType::getSpeedFactor(), and MSEdge::insertVehicle().

◆ getVehicleClass()

◆ getWidth()

double MSVehicleType::getWidth ( ) const
inline

Get the width which vehicles of this class shall have when being drawn.

Returns
The width of this type's vehicles

Definition at line 253 of file MSVehicleType.h.

References myParameter, and SUMOVTypeParameter::width.

Referenced by MSLCM_LC2013::adaptSpeedToPedestrians(), MSPModel_Striping::addCrossingVehs(), MSLane::checkForPedestrians(), MSDevice_SSM::classifyEncounter(), MSLane::detectCollisionBetween(), MSLane::detectCollisions(), GUIContainer::drawAction_drawAsImage(), GUIPerson::drawAction_drawAsImage(), GUIVehicle::drawAction_drawRailCarriages(), GUIBaseVehicle::drawAction_drawVehicleAsImage(), GUIBaseVehicle::drawAction_drawVehicleAsPoly(), MSVehicle::getBoundingBox(), MSVehicle::getBoundingPoly(), MSLane::getDepartPosLat(), MSLink::getLeaderInfo(), GUIVehicle::getLeftSideOnEdge(), MSPModel_Striping::getNextLaneObstacles(), MSVehicle::getRightSideOnEdge(), MSVehicle::getRightSideOnLane(), MSLeaderInfo::getSubLanes(), GUIContainer::getTypeParameterWindow(), GUIPerson::getTypeParameterWindow(), GUIVehicle::getTypeParameterWindow(), libsumo::VehicleType::getWidth(), libsumo::Vehicle::getWidth(), MSLCM_SL2015::getWidth(), MSBaseVehicle::getWidth(), MSLane::insertVehicle(), MSPModel_Striping::moveInDirectionOnLane(), libsumo::Person::moveToXY(), libsumo::Vehicle::moveToXY(), MSPModel_Striping::nextBlocking(), MSPModel_Striping::PState::otherStripe(), MSVehicle::planMoveInternal(), MSVehicle::Influencer::postProcessRemoteControl(), setWidth(), and MSLCM_SL2015::updateCFRelated().

◆ isVehicleSpecific()

bool MSVehicleType::isVehicleSpecific ( ) const
inline

Returns whether this type belongs to a single vehicle only (was modified)

Returns
Whether this vehicle type is based on a different one, and belongs to one vehicle only

Definition at line 519 of file MSVehicleType.h.

References myOriginalType.

Referenced by MSBaseVehicle::getSingularType(), MSTransportable::getSingularType(), MSBaseVehicle::replaceVehicleType(), MSTransportable::replaceVehicleType(), setActionStepLength(), MSTransportable::~MSTransportable(), and MSVehicle::~MSVehicle().

◆ operator=()

MSVehicleType& MSVehicleType::operator= ( const MSVehicleType )
private

Invalidated assignment operator.

◆ setActionStepLength()

void MSVehicleType::setActionStepLength ( const SUMOTime  actionStepLength,
bool  resetActionOffset 
)

Set a new value for this type's action step length.

Parameters
[in]actionStepLengthThe new action step length of this type (in ms.)
[in]resetActionOffsetIf True (default), the next action point is scheduled immediately. if If resetActionOffset == False, the interval between the last and the next action point is updated to match the given value for all vehicles of this type, or if the latter is smaller than the time since the last action point, the next action follows immediately.
Note
: Singular vtypes do not update the state of the corresponding vehicle, because the global lookup would be too expensive. The caller is responsible to perform the actionOffsetReset operation at caller context, where the vehicle is known.

Definition at line 202 of file MSVehicleType.cpp.

References SUMOVTypeParameter::actionStepLength, check(), MSNet::getInstance(), MSNet::getVehicleControl(), MSBaseVehicle::getVehicleType(), isVehicleSpecific(), MSVehicleControl::loadedVehBegin(), MSVehicleControl::loadedVehEnd(), myCachedActionStepLengthSecs, myParameter, SUMOVTypeParameter::parametersSet, MSVehicle::resetActionOffset(), STEPS2TIME, MSVehicle::updateActionOffset(), and VTYPEPARS_ACTIONSTEPLENGTH_SET.

Referenced by getPreferredLateralAlignment(), libsumo::VehicleType::setActionStepLength(), and libsumo::Vehicle::setActionStepLength().

◆ setColor()

void MSVehicleType::setColor ( const RGBColor color)

Set a new value for this type's color.

Parameters
[in]colorThe new color of this type

Definition at line 245 of file MSVehicleType.cpp.

References SUMOVTypeParameter::color, myParameter, SUMOVTypeParameter::parametersSet, and VTYPEPARS_COLOR_SET.

Referenced by getPreferredLateralAlignment(), libsumo::VehicleType::setColor(), and libsumo::Person::setColor().

◆ setDefaultProbability()

void MSVehicleType::setDefaultProbability ( const double &  prob)

Set a new value for this type's default probability.

If the given value<0 then the one from the original type will be used.

Parameters
[in]probThe new default probability of this type

Definition at line 169 of file MSVehicleType.cpp.

References SUMOVTypeParameter::defaultProbability, getDefaultProbability(), myOriginalType, myParameter, SUMOVTypeParameter::parametersSet, and VTYPEPARS_PROBABILITY_SET.

Referenced by getPreferredLateralAlignment().

◆ setEmissionClass()

void MSVehicleType::setEmissionClass ( SUMOEmissionClass  eclass)

Set a new value for this type's emission class.

Parameters
[in]eclassThe new emission class of this type

Definition at line 238 of file MSVehicleType.cpp.

References SUMOVTypeParameter::emissionClass, myParameter, SUMOVTypeParameter::parametersSet, and VTYPEPARS_EMISSIONCLASS_SET.

Referenced by getPreferredLateralAlignment(), and libsumo::VehicleType::setEmissionClass().

◆ setHeight()

void MSVehicleType::setHeight ( const double &  height)

Set a new value for this type's height.

If the given value<0 then the one from the original type will be used.

Parameters
[in]heightThe new height of this type

Definition at line 101 of file MSVehicleType.cpp.

References getHeight(), SUMOVTypeParameter::height, myOriginalType, myParameter, SUMOVTypeParameter::parametersSet, and VTYPEPARS_HEIGHT_SET.

Referenced by getPreferredLateralAlignment(), libsumo::VehicleType::setHeight(), and libsumo::Person::setHeight().

◆ setImpatience()

void MSVehicleType::setImpatience ( const double  impatience)

Set a new value for this type's impatience.

Parameters
[in]impatienceThe new impatience of this type

Definition at line 262 of file MSVehicleType.cpp.

References getImpatience(), SUMOVTypeParameter::impatience, myOriginalType, myParameter, SUMOVTypeParameter::parametersSet, and VTYPEPARS_IMPATIENCE_SET.

Referenced by getPreferredLateralAlignment().

◆ setLength()

void MSVehicleType::setLength ( const double &  length)

Set a new value for this type's length.

If the given value<0 then the one from the original type will be used.

Parameters
[in]lengthThe new length of this type

Definition at line 90 of file MSVehicleType.cpp.

References getLength(), SUMOVTypeParameter::length, myOriginalType, myParameter, SUMOVTypeParameter::parametersSet, and VTYPEPARS_LENGTH_SET.

Referenced by getPreferredLateralAlignment(), libsumo::VehicleType::setLength(), and libsumo::Person::setLength().

◆ setMaxSpeed()

void MSVehicleType::setMaxSpeed ( const double &  maxSpeed)

Set a new value for this type's maximum speed.

If the given value<0 then the one from the original type will be used.

Parameters
[in]maxSpeedThe new maximum speed of this type

Definition at line 134 of file MSVehicleType.cpp.

References getMaxSpeed(), SUMOVTypeParameter::maxSpeed, myOriginalType, myParameter, SUMOVTypeParameter::parametersSet, and VTYPEPARS_MAXSPEED_SET.

Referenced by getPreferredLateralAlignment(), libsumo::VehicleType::setMaxSpeed(), and libsumo::Vehicle::setMaxSpeed().

◆ setMaxSpeedLat()

void MSVehicleType::setMaxSpeedLat ( const double &  maxSpeedLat)

Set a new value for this type's maximum lateral speed.

If the given value<0 then the one from the original type will be used.

Parameters
[in]maxSpeedLatThe new maximum lateral speed of this type

Definition at line 145 of file MSVehicleType.cpp.

References getMaxSpeedLat(), SUMOVTypeParameter::maxSpeedLat, myOriginalType, myParameter, SUMOVTypeParameter::parametersSet, and VTYPEPARS_MAXSPEED_LAT_SET.

Referenced by getPreferredLateralAlignment(), and libsumo::VehicleType::setMaxSpeedLat().

◆ setMinGap()

void MSVehicleType::setMinGap ( const double &  minGap)

Set a new value for this type's minimum gap.

If the given value<0 then the one from the original type will be used.

Parameters
[in]minGapThe new minimum gap of this type

Definition at line 112 of file MSVehicleType.cpp.

References getMinGap(), SUMOVTypeParameter::minGap, myOriginalType, myParameter, SUMOVTypeParameter::parametersSet, and VTYPEPARS_MINGAP_SET.

Referenced by getPreferredLateralAlignment(), libsumo::VehicleType::setMinGap(), and libsumo::Person::setMinGap().

◆ setMinGapLat()

void MSVehicleType::setMinGapLat ( const double &  minGapLat)

Set a new value for this type's minimum lataral gap.

If the given value<0 then the one from the original type will be used.

Parameters
[in]minGapLatThe new minimum lateral gap of this type

Definition at line 123 of file MSVehicleType.cpp.

References getMinGapLat(), SUMOVTypeParameter::minGapLat, myOriginalType, myParameter, SUMOVTypeParameter::parametersSet, and VTYPEPARS_MINGAP_LAT_SET.

Referenced by getPreferredLateralAlignment(), and libsumo::VehicleType::setMinGapLat().

◆ setPreferredLateralAlignment()

void MSVehicleType::setPreferredLateralAlignment ( LateralAlignment  latAlignment)

◆ setShape()

void MSVehicleType::setShape ( SUMOVehicleShape  shape)

Set a new value for this type's shape.

Parameters
[in]shapeThe new shape of this type

Definition at line 273 of file MSVehicleType.cpp.

References myParameter, SUMOVTypeParameter::parametersSet, SUMOVTypeParameter::shape, and VTYPEPARS_SHAPE_SET.

Referenced by getPreferredLateralAlignment(), libsumo::VehicleType::setShapeClass(), and libsumo::Vehicle::setShapeClass().

◆ setSpeedDeviation()

void MSVehicleType::setSpeedDeviation ( const double &  dev)

Set a new value for this type's speed deviation.

If the given value<0 then the one from the original type will be used.

Parameters
[in]devThe new speed deviation of this type

Definition at line 191 of file MSVehicleType.cpp.

References Distribution_Parameterized::getParameter(), myOriginalType, myParameter, SUMOVTypeParameter::parametersSet, SUMOVTypeParameter::speedFactor, and VTYPEPARS_SPEEDFACTOR_SET.

Referenced by getPreferredLateralAlignment(), and libsumo::VehicleType::setSpeedDeviation().

◆ setSpeedFactor()

void MSVehicleType::setSpeedFactor ( const double &  factor)

Set a new value for this type's speed factor.

If the given value<0 then the one from the original type will be used.

Parameters
[in]factorThe new speed factor of this type

Definition at line 180 of file MSVehicleType.cpp.

References Distribution_Parameterized::getParameter(), myOriginalType, myParameter, SUMOVTypeParameter::parametersSet, SUMOVTypeParameter::speedFactor, and VTYPEPARS_SPEEDFACTOR_SET.

Referenced by getPreferredLateralAlignment(), and libsumo::VehicleType::setSpeedFactor().

◆ setVClass()

void MSVehicleType::setVClass ( SUMOVehicleClass  vclass)

Set a new value for this type's vehicle class.

Parameters
[in]vclassThe new vehicle class of this type

Definition at line 156 of file MSVehicleType.cpp.

References myParameter, SUMOVTypeParameter::parametersSet, SUMOVTypeParameter::vehicleClass, and VTYPEPARS_VEHICLECLASS_SET.

Referenced by getPreferredLateralAlignment(), and libsumo::VehicleType::setVehicleClass().

◆ setWidth()

void MSVehicleType::setWidth ( const double &  width)

Set a new value for this type's width.

If the given value<0 then the one from the original type will be used.

Parameters
[in]widthThe new width of this type

Definition at line 252 of file MSVehicleType.cpp.

References getWidth(), myOriginalType, myParameter, SUMOVTypeParameter::parametersSet, VTYPEPARS_WIDTH_SET, and SUMOVTypeParameter::width.

Referenced by getPreferredLateralAlignment(), libsumo::VehicleType::setWidth(), and libsumo::Person::setWidth().

◆ wasSet()

bool MSVehicleType::wasSet ( int  what) const
inline

Returns whether the given parameter was set.

Parameters
[in]whatThe parameter which one asks for
Returns
Whether the given parameter was set

Definition at line 89 of file MSVehicleType.h.

References myParameter, and SUMOVTypeParameter::parametersSet.

Referenced by MSRouteHandler::myStartElement(), and GUIBaseVehicle::setFunctionalColor().

Field Documentation

◆ myCachedActionStepLengthSecs

double MSVehicleType::myCachedActionStepLengthSecs
private

the vtypes actionsStepLength in seconds (cached because needed very often)

Definition at line 539 of file MSVehicleType.h.

Referenced by getActionStepLengthSecs(), MSVehicleType(), and setActionStepLength().

◆ myCarFollowModel

MSCFModel* MSVehicleType::myCarFollowModel
private

instance of the car following model.

Definition at line 549 of file MSVehicleType.h.

Referenced by build(), duplicateType(), getCarFollowModel(), and ~MSVehicleType().

◆ myIndex

const int MSVehicleType::myIndex
private

the running index

Definition at line 546 of file MSVehicleType.h.

Referenced by getNumericalID().

◆ myNextIndex

int MSVehicleType::myNextIndex = 0
staticprivate

next value for the running index

Definition at line 555 of file MSVehicleType.h.

◆ myOriginalType

◆ myParameter

◆ myWarnedActionStepLengthTauOnce

bool MSVehicleType::myWarnedActionStepLengthTauOnce
private

Indicator whether the user was already warned once about an action step length larger than the desired time headway.

Definition at line 543 of file MSVehicleType.h.

Referenced by check().


The documentation for this class was generated from the following files: