Eclipse SUMO - Simulation of Urban MObility
MSVehicleType Class Reference

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

#include <MSVehicleType.h>

Collaboration diagram for MSVehicleType:

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 std::string & getOriginalID () const
 Returns the id of the original vehicle type if this is a vehicle specific type, the id otherwise. 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 setAccel (double accel)
 Set a new value for this type's acceleration. More...
 
void setDecel (double decel)
 Set a new value for this type's deceleration. More...
 
void setEmergencyDecel (double emergencyDecel)
 Set a new value for this type's emergency deceleration. More...
 
void setApparentDecel (double apparentDecel)
 Set a new value for this type's apparent deceleration. More...
 
void setImperfection (double imperfection)
 Set a new value for this type's imperfection. More...
 
void setTau (double tau)
 Set a new value for this type's headway. More...
 
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...
 

Protected Member Functions

void initRailVisualizationParameters ()
 init Rail Visualization Parameters More...
 

Private Member Functions

 MSVehicleType (const MSVehicleType &)=delete
 Invalidated copy constructor. More...
 
MSVehicleTypeoperator= (const MSVehicleType &)=delete
 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 66 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 )
privatedelete

Invalidated copy constructor.

Member Function Documentation

◆ build()

◆ 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 355 of file MSVehicleType.cpp.

References duplicateType().

Referenced by 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 376 of file MSVehicleType.cpp.

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

Referenced by build(), 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 361 of file MSVehicleType.cpp.

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

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

◆ 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 218 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 226 of file MSVehicleType.h.

References myCachedActionStepLengthSecs.

Referenced by 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 300 of file MSVehicleType.h.

References SUMOVTypeParameter::boardingDuration, and myParameter.

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

◆ getCarFollowModel() [1/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 149 of file MSVehicleType.h.

References myCarFollowModel.

◆ getCarFollowModel() [2/2]

◆ getColor()

const RGBColor& MSVehicleType::getColor ( ) const
inline

Returns this type's color.

Returns
The color of this type

Definition at line 202 of file MSVehicleType.h.

References SUMOVTypeParameter::color, and myParameter.

Referenced by MSDevice_ToC::initColorScheme(), GUIBaseVehicle::setFunctionalColor(), and MSDevice_ToC::setParameter().

◆ getContainerCapacity()

int MSVehicleType::getContainerCapacity ( ) const
inline

Get this vehicle type's container capacity.

Returns
The container capacity of this vehicle type

Definition at line 293 of file MSVehicleType.h.

References SUMOVTypeParameter::containerCapacity, and myParameter.

Referenced by GUIVehicle::drawAction_drawCarriageClass(), GUIBaseVehicle::drawOnPos(), GUIVehicle::getTypeParameterWindow(), GUIMEVehicle::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 176 of file MSVehicleType.h.

References SUMOVTypeParameter::defaultProbability, and myParameter.

Referenced by MSRouteHandler::closeVType(), 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 262 of file MSVehicleType.h.

References myParameter, and SUMOVTypeParameter::shape.

Referenced by GUIVehicle::drawAction_drawCarriageClass(), MSVehicle::getBoundingPoly(), GUIVehicle::getTypeParameterWindow(), and GUIBaseVehicle::setFunctionalColor().

◆ 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 254 of file MSVehicleType.h.

References SUMOVTypeParameter::height, and myParameter.

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

◆ getID()

const std::string& MSVehicleType::getID ( ) const
inline

Returns the name of the vehicle type.

Returns
This type's id

Definition at line 94 of file MSVehicleType.h.

References SUMOVTypeParameter::id, and myParameter.

Referenced by MSChargingStation::addChargeValueForOutput(), MSVehicleControl::addVType(), libsumo::Helper::applySubscriptionFilters(), check(), MSRouteHandler::closeVehicle(), MSRouteHandler::closeVType(), MSInductLoop::collectVehiclesOnDet(), duplicateType(), MSVTypeProbe::execute(), libsumo::Simulation::findIntermodalRoute(), MSDevice_Tripinfo::generateOutput(), getOriginalID(), MSBaseVehicle::getSingularType(), MSTransportable::getSingularType(), libsumo::Person::getStage(), libsumo::Person::getTypeID(), libsumo::Vehicle::getTypeID(), GUIPerson::getTypeParameterWindow(), GUIContainer::getTypeParameterWindow(), GUIVehicle::getTypeParameterWindow(), GUIMEVehicle::getTypeParameterWindow(), MSAbstractLaneChangeModel::laneChangeOutput(), MSInductLoop::leaveDetectorByMove(), MSE2Collector::makeVehicleInfo(), MEVehicle::MEVehicle(), MSDevice_ToC::MSDevice_ToC(), MSVehicle::MSVehicle(), MSDevice_Bluelight::notifyMove(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_Person::processSet(), MSVehicleControl::removeVType(), MSPerson::routeOutput(), MSTransportable::Stage_Trip::setArrived(), MSStopOut::stopEnded(), MSDevice_ToC::switchHolderType(), MSBatteryExport::write(), MSEmissionExport::write(), MSFCDExport::write(), MSInstantInductLoop::write(), MSDevice_Vehroutes::writeOutput(), MSAmitranTrajectories::writeVehicle(), and MSFullExport::writeVehicles().

◆ 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 277 of file MSVehicleType.h.

References SUMOVTypeParameter::imgFile, and myParameter.

Referenced by GUIContainer::drawAction_drawAsImage().

◆ getImpatience()

double MSVehicleType::getImpatience ( ) const
inline

Returns this type's impatience.

Returns
The impatience of this type

Definition at line 234 of file MSVehicleType.h.

References SUMOVTypeParameter::impatience, and myParameter.

Referenced by setImpatience().

◆ getLaneChangeModel()

LaneChangeModel MSVehicleType::getLaneChangeModel ( ) const
inline

Definition at line 154 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 110 of file MSVehicleType.h.

References SUMOVTypeParameter::length, and myParameter.

Referenced by MSCFModel_Wiedemann::_v(), MSLCM_LC2013::_wantsChange(), MSPModel_Striping::addCrossingVehs(), MSVehicle::addStop(), MSLane::checkForPedestrians(), MSVehicle::checkRewindLinkLanes(), MSLink::checkWalkingAreaFoe(), MSInductLoop::collectVehiclesOnDet(), MSLaneChanger::computeOvertakingTime(), MSLane::detectCollisions(), GUIContainer::drawAction_drawAsImage(), GUIVehicle::drawAction_drawCarriageClass(), GUIVehicle::drawAction_drawLinkItems(), GUIBaseVehicle::drawOnPos(), MSLane::enteredByLaneChange(), MSVehicle::enterLaneAtInsertion(), MSVehicle::enterLaneAtLaneChange(), MSDevice_SSM::estimateConflictTimes(), MSLane::executeMovements(), MSStoppingPlace::fits(), MSLane::freeInsertion(), MSVehicle::getBackPosition(), MEVehicle::getBackPositionOnLane(), MSVehicle::getBackPositionOnLane(), MSTransportable::getBoundingBox(), MSLane::getBruttoOccupancy(), GUIBaseVehicle::getCenteringBoundary(), MSLane::getCriticalLeader(), MSEdge::getDepartPosBound(), MSLane::getFollower(), MSLane::getFollowersOnConsecutive(), MSStoppingPlace::getLastFreePos(), MSParkingArea::getLastFreePosWithReservation(), MSLink::getLeaderInfo(), MSLane::getLeaderOnConsecutive(), MSLane::getLeadersOnConsecutive(), MSBaseVehicle::getLength(), MSLane::getNettoOccupancy(), MSLane::getOppositeFollower(), MSLane::getOppositeLeader(), MSVehicle::getPositionOnLane(), MSLaneChanger::getRealFollower(), MSCFModel_Wiedemann::getSecureGap(), GUIPerson::getTypeParameterWindow(), GUIContainer::getTypeParameterWindow(), GUIVehicle::getTypeParameterWindow(), GUIMEVehicle::getTypeParameterWindow(), MSPModel_Striping::getVehicleObstacles(), MSLink::getZipperSpeed(), MSLane::handleCollisionBetween(), MSLane::incorporateVehicle(), MSLCM_SL2015::informFollower(), MSLCM_SL2015::informLeader(), MSLane::isInsertionSuccess(), MSLCM_SL2015::keepLatGap(), MSInductLoop::leaveDetectorByMove(), MSLane::leftByLaneChange(), MSE2Collector::makeVehicleInfo(), MSPModel_Striping::moveInDirection(), MSCFModel_Rail::MSCFModel_Rail(), MSVehicleType(), MSPModel_Striping::nextBlocking(), MSE3Collector::MSE3EntryReminder::notifyEnter(), MSInstantInductLoop::notifyMove(), MSMeanData::MeanDataValues::notifyMove(), MSInductLoop::notifyMove(), MSE3Collector::MSE3LeaveReminder::notifyMove(), MSE2Collector::notifyMove(), MSMeanData_Net::MSLaneMeanDataValues::notifyMoveInternal(), MSLCM_LC2013::overtakeDistance(), MSVehicle::planMoveInternal(), MSVehicle::processLaneAdvances(), MSVehicle::processLinkApproaches(), MSVehicle::processNextStop(), 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 307 of file MSVehicleType.h.

References SUMOVTypeParameter::loadingDuration, and myParameter.

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

◆ getMaxSpeed()

◆ getMaxSpeedLat()

◆ 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 126 of file MSVehicleType.h.

References SUMOVTypeParameter::minGap, and myParameter.

Referenced by MSLCM_LC2013::_patchSpeed(), MSLCM_SL2015::_patchSpeed(), MSCFModel_IDM::_v(), MSCFModel_ACC::accelGapControl(), MSLCM_LC2013::adaptSpeedToPedestrians(), MSVehicle::adaptToLeaders(), MSLaneChanger::checkChange(), MSLane::checkFailure(), MSVehicle::checkRewindLinkLanes(), MSLaneChanger::computeOvertakingTime(), MSCFModel_W99::computeThresholds(), MSLane::detectCollisionBetween(), GUIBaseVehicle::drawOnPos(), MSCFModel_W99::followSpeed(), MSLane::freeInsertion(), MSVehicle::Influencer::gapControlSpeed(), MSLane::getCriticalLeader(), MSLane::getFollower(), MSLane::getFollowersOnConsecutive(), MSStoppingPlace::getLastFreePos(), MSParkingArea::getLastFreePos(), MSParkingArea::getLastFreePosWithReservation(), MSLane::getLeader(), MSVehicle::getLeader(), MSLink::getLeaderInfo(), MSLane::getLeaderOnConsecutive(), MSLaneChangerSublane::getLeaders(), MSLane::getLeadersOnConsecutive(), MSLane::getOppositeLeader(), MSLaneChanger::getRealFollower(), MSLaneChanger::getRealLeader(), GUIPerson::getTypeParameterWindow(), GUIContainer::getTypeParameterWindow(), GUIVehicle::getTypeParameterWindow(), GUIMEVehicle::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(), MSCFModel_CACC::speedGapControl(), 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 133 of file MSVehicleType.h.

References SUMOVTypeParameter::minGapLat, and myParameter.

Referenced by 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 102 of file MSVehicleType.h.

References myIndex.

Referenced by MSAmitranTrajectories::writeVehicle().

◆ getOriginalID()

const std::string& MSVehicleType::getOriginalID ( ) const
inline

Returns the id of the original vehicle type if this is a vehicle specific type, the id otherwise.

Returns
the original vehicle type id

Definition at line 551 of file MSVehicleType.h.

References getID(), and myOriginalType.

Referenced by MSDetectorFileOutput::vehicleApplies(), and MSTriggeredRerouter::vehicleApplies().

◆ 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 269 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 285 of file MSVehicleType.h.

References myParameter, and SUMOVTypeParameter::personCapacity.

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

◆ getPreferredLateralAlignment()

LateralAlignment MSVehicleType::getPreferredLateralAlignment ( ) const
inline

Get vehicle's preferred lateral alignment.

Returns
The vehicle's preferred lateral alignment

Definition at line 321 of file MSVehicleType.h.

References SUMOVTypeParameter::latAlignment, and myParameter.

Referenced by MSLCM_SL2015::_wantsChangeSublane(), and GUIVehicle::getTypeParameterWindow().

◆ getSpeedFactor()

const Distribution_Parameterized& MSVehicleType::getSpeedFactor ( ) const
inline

Returns this type's speed factor.

Returns
The speed factor of this type

Definition at line 210 of file MSVehicleType.h.

References myParameter, and SUMOVTypeParameter::speedFactor.

Referenced by libsumo::Simulation::findIntermodalRoute(), libsumo::Simulation::findRoute(), and MSEdge::insertVehicle().

◆ getVehicleClass()

◆ getWidth()

◆ initRailVisualizationParameters()

◆ 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 543 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 )
privatedelete

Invalidated assignment operator.

◆ setAccel()

void MSVehicleType::setAccel ( double  accel)

Set a new value for this type's acceleration.

Parameters
[in]accelThe new acceleration of this type

Definition at line 390 of file MSVehicleType.cpp.

References SUMOVTypeParameter::cfParameter, getCarFollowModel(), MSCFModel::getMaxAccel(), myCarFollowModel, myOriginalType, myParameter, MSCFModel::setMaxAccel(), SUMO_ATTR_ACCEL, and toString().

◆ 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 MSVehicle::setActionStepLength().

◆ setApparentDecel()

void MSVehicleType::setApparentDecel ( double  apparentDecel)

Set a new value for this type's apparent deceleration.

Parameters
[in]apparentDecelThe new apparent deceleration of this type

Definition at line 417 of file MSVehicleType.cpp.

References SUMOVTypeParameter::cfParameter, MSCFModel::getApparentDecel(), getCarFollowModel(), myCarFollowModel, myOriginalType, myParameter, MSCFModel::setApparentDecel(), SUMO_ATTR_APPARENTDECEL, and toString().

◆ 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.

◆ setDecel()

void MSVehicleType::setDecel ( double  decel)

Set a new value for this type's deceleration.

Parameters
[in]decelThe new deceleration of this type

Definition at line 399 of file MSVehicleType.cpp.

References SUMOVTypeParameter::cfParameter, getCarFollowModel(), MSCFModel::getMaxDecel(), myCarFollowModel, myOriginalType, myParameter, MSCFModel::setMaxDecel(), SUMO_ATTR_DECEL, and toString().

◆ 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.

◆ setEmergencyDecel()

void MSVehicleType::setEmergencyDecel ( double  emergencyDecel)

Set a new value for this type's emergency deceleration.

Parameters
[in]emergencyDecelThe new emergency deceleration of this type

Definition at line 408 of file MSVehicleType.cpp.

References SUMOVTypeParameter::cfParameter, getCarFollowModel(), MSCFModel::getEmergencyDecel(), myCarFollowModel, myOriginalType, myParameter, MSCFModel::setEmergencyDecel(), SUMO_ATTR_EMERGENCYDECEL, and toString().

◆ 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.

◆ 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.

◆ 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.

◆ setImperfection()

void MSVehicleType::setImperfection ( double  imperfection)

Set a new value for this type's imperfection.

Parameters
[in]imperfectionThe new imperfection of this type

Definition at line 426 of file MSVehicleType.cpp.

References SUMOVTypeParameter::cfParameter, getCarFollowModel(), MSCFModel::getImperfection(), myCarFollowModel, myOriginalType, myParameter, MSCFModel::setImperfection(), SUMO_ATTR_SIGMA, and toString().

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ setPreferredLateralAlignment()

void MSVehicleType::setPreferredLateralAlignment ( LateralAlignment  latAlignment)

Set vehicle's preferred lateral alignment.

Definition at line 162 of file MSVehicleType.cpp.

References SUMOVTypeParameter::latAlignment, myParameter, SUMOVTypeParameter::parametersSet, and VTYPEPARS_LATALIGNMENT_SET.

Referenced by MSDevice_Bluelight::notifyMove().

◆ 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.

◆ 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 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.

◆ setTau()

void MSVehicleType::setTau ( double  tau)

Set a new value for this type's headway.

Parameters
[in]tauThe new headway of this type

Definition at line 435 of file MSVehicleType.cpp.

References SUMOVTypeParameter::cfParameter, getCarFollowModel(), MSCFModel::getHeadwayTime(), myCarFollowModel, myOriginalType, myParameter, MSCFModel::setHeadwayTime(), SUMO_ATTR_TAU, and toString().

◆ 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.

◆ 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.

◆ 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 83 of file MSVehicleType.h.

References myParameter, and SUMOVTypeParameter::parametersSet.

Referenced by MSAbstractLaneChangeModel::computeSpeedLat(), MSAbstractLaneChangeModel::estimateLCDuration(), MSCFModel_Rail::MSCFModel_Rail(), MSRouteHandler::myStartElement(), MSAbstractLaneChangeModel::remainingTime(), and GUIBaseVehicle::setFunctionalColor().

Field Documentation

◆ myCachedActionStepLengthSecs

double MSVehicleType::myCachedActionStepLengthSecs
private

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

Definition at line 575 of file MSVehicleType.h.

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

◆ myCarFollowModel

MSCFModel* MSVehicleType::myCarFollowModel
private

instance of the car following model.

Definition at line 585 of file MSVehicleType.h.

Referenced by build(), duplicateType(), getCarFollowModel(), setAccel(), setApparentDecel(), setDecel(), setEmergencyDecel(), setImperfection(), setTau(), and ~MSVehicleType().

◆ myIndex

const int MSVehicleType::myIndex
private

the running index

Definition at line 582 of file MSVehicleType.h.

Referenced by getNumericalID().

◆ myNextIndex

int MSVehicleType::myNextIndex = 0
staticprivate

next value for the running index

Definition at line 591 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 579 of file MSVehicleType.h.

Referenced by check().


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