Eclipse SUMO - Simulation of Urban MObility
|
A class that helps computing positions of a train's carriages and additional structures. More...
#include <MSTrainHelper.h>
Data Structures | |
struct | Carriage |
Public Member Functions | |
void | computeDoorPositions () |
compute door positions on demand and fills the carriage structures | |
void | computeUnboardingPositions (double passengerRadius, std::vector< Position > &unboardingPositions) |
compute unboarding positions on demand and fills the carriage structures | |
int | getCarriageDoors () const |
double | getCarriageLength () const |
const std::vector< Carriage * > & | getCarriages () const |
double | getFirstCarriageLength () const |
int | getFirstCarriageNo () const |
int | getFirstPassengerCarriage () const |
double | getHalfWidth () const |
int | getNumCarriages () const |
double | getUpscaleLength () const |
bool | isReversed () const |
MSTrainHelper (const MSVehicle *vehicle, bool reversed=false, bool secondaryShape=false, double exaggeration=1.0, int vehicleQuality=3) | |
~MSTrainHelper () | |
Static Public Member Functions | |
static double | getUpscaleLength (double upscale, double length, double width, int vehicleQuality) |
return length exaggeration factor (special for long vehicles) | |
Static Public Attributes | |
static const double | CARRIAGE_DOOR_WIDTH = 1.5 |
average door width used to compute doors positions | |
static const double | PEDESTRIAN_RADIUS_EXTRA_TOLERANCE = 0.01 |
small extra tolerance used to avoid constraint violations | |
Private Member Functions | |
void | computeCarriages (bool reversed, bool secondaryShape) |
void | computeTrainDimensions (double exaggeration, int vehicleQuality) |
Private Attributes | |
int | myCarriageDoors |
double | myCarriageGap |
double | myCarriageLength |
double | myCarriageLengthWithGap |
std::vector< Carriage * > | myCarriages |
double | myDefaultLength |
double | myFirstCarriageLength |
int | myFirstCarriageNo |
int | myFirstPassengerCarriage |
double | myHalfWidth |
bool | myIsReversed |
double | myLength |
double | myLocomotiveLength |
int | myNumCarriages |
const MSVehicle * | myTrain |
double | myUpscaleLength |
A class that helps computing positions of a train's carriages and additional structures.
Definition at line 42 of file MSTrainHelper.h.
|
inline |
Definition at line 51 of file MSTrainHelper.h.
References computeCarriages(), and computeTrainDimensions().
|
inline |
Definition at line 57 of file MSTrainHelper.h.
References myCarriages.
|
private |
Definition at line 70 of file MSTrainHelper.cpp.
References MSTrainHelper::Carriage::back, MSTrainHelper::Carriage::front, MSVehicle::getLane(), MSVehicle::getLaneChangeModel(), MSVehicle::getLateralPositionOnLane(), MSBaseVehicle::getLength(), MSLane::getLength(), MSLane::getLengthGeometryFactor(), MSBaseVehicle::getNextStopParameter(), MSVehicleType::getParameter(), MSVehicle::getPositionOnLane(), MSVehicle::getPreviousLane(), MSLane::getShape(), MSBaseVehicle::getVClass(), MSBaseVehicle::getVehicleType(), MSLane::getWidth(), MSGlobals::gLefthand, INVALID_DOUBLE, MSAbstractLaneChangeModel::isOpposite(), MSBaseVehicle::isParking(), MSBaseVehicle::isReversed(), SUMOVTypeParameter::locomotiveLength, MIN2(), myCarriageGap, myCarriageLength, myCarriageLengthWithGap, myCarriages, myDefaultLength, myFirstCarriageLength, myFirstCarriageNo, myFirstPassengerCarriage, myIsReversed, myLocomotiveLength, myNumCarriages, myTrain, PositionVector::positionAtOffset(), SUMOVehicleParameter::Stop::posLat, SVC_RAIL, SVC_RAIL_ELECTRIC, and SVC_RAIL_FAST.
Referenced by MSTrainHelper().
void MSTrainHelper::computeDoorPositions | ( | ) |
compute door positions on demand and fills the carriage structures
Definition at line 148 of file MSTrainHelper.cpp.
References Position::length2D(), myCarriageDoors, myCarriages, and Position::norm2D().
Referenced by MSPModel_JuPedSim::execute(), and MSStageDriving::setArrived().
|
private |
Definition at line 35 of file MSTrainHelper.cpp.
References SUMOVTypeParameter::carriageDoors, SUMOVTypeParameter::carriageGap, SUMOVTypeParameter::carriageLength, MSVehicleType::getLength(), MSVehicleType::getParameter(), getUpscaleLength(), MSBaseVehicle::getVehicleType(), MSVehicleType::getWidth(), SUMOVTypeParameter::locomotiveLength, MAX2(), MIN2(), myCarriageDoors, myCarriageGap, myCarriageLength, myCarriageLengthWithGap, myDefaultLength, myFirstCarriageLength, myHalfWidth, myLength, myLocomotiveLength, myNumCarriages, myTrain, and myUpscaleLength.
Referenced by MSTrainHelper().
void MSTrainHelper::computeUnboardingPositions | ( | double | passengerRadius, |
std::vector< Position > & | unboardingPositions | ||
) |
compute unboarding positions on demand and fills the carriage structures
Definition at line 164 of file MSTrainHelper.cpp.
References Position::length2D(), myCarriages, myHalfWidth, Position::norm2D(), PEDESTRIAN_RADIUS_EXTRA_TOLERANCE, RandHelper::shuffle(), Position::x(), and Position::y().
Referenced by MSStageDriving::setArrived().
|
inline |
Definition at line 83 of file MSTrainHelper.h.
References myCarriageDoors.
Referenced by MSStageDriving::setArrived().
|
inline |
Definition at line 75 of file MSTrainHelper.h.
References myCarriageLength.
Referenced by GUIVehicle::drawAction_drawCarriageClass().
|
inline |
Definition at line 99 of file MSTrainHelper.h.
References myCarriages.
Referenced by GUIVehicle::drawAction_drawCarriageClass(), MSPModel_JuPedSim::execute(), and MSStageDriving::setArrived().
|
inline |
Definition at line 79 of file MSTrainHelper.h.
References myFirstCarriageLength.
Referenced by GUIVehicle::drawAction_drawCarriageClass().
|
inline |
Definition at line 87 of file MSTrainHelper.h.
References myFirstCarriageNo.
Referenced by GUIVehicle::drawAction_drawCarriageClass().
|
inline |
Definition at line 91 of file MSTrainHelper.h.
References myFirstPassengerCarriage.
Referenced by GUIVehicle::drawAction_drawCarriageClass(), and MSStageDriving::setArrived().
|
inline |
Definition at line 67 of file MSTrainHelper.h.
References myHalfWidth.
Referenced by GUIVehicle::drawAction_drawCarriageClass(), and MSPModel_JuPedSim::execute().
|
inline |
Definition at line 71 of file MSTrainHelper.h.
References myNumCarriages.
Referenced by GUIVehicle::drawAction_drawCarriageClass(), and MSStageDriving::setArrived().
|
inline |
Definition at line 63 of file MSTrainHelper.h.
References myUpscaleLength.
Referenced by computeTrainDimensions(), GUIVehicle::drawAction_drawCarriageClass(), and GUIBaseVehicle::drawOnPos().
|
static |
return length exaggeration factor (special for long vehicles)
Definition at line 191 of file MSTrainHelper.cpp.
References MAX2().
|
inline |
Definition at line 95 of file MSTrainHelper.h.
References myIsReversed.
Referenced by GUIVehicle::drawAction_drawCarriageClass().
|
static |
average door width used to compute doors positions
Definition at line 115 of file MSTrainHelper.h.
Referenced by MSPModel_JuPedSim::execute(), and MSStageDriving::setArrived().
|
private |
Definition at line 135 of file MSTrainHelper.h.
Referenced by computeDoorPositions(), computeTrainDimensions(), and getCarriageDoors().
|
private |
Definition at line 128 of file MSTrainHelper.h.
Referenced by computeCarriages(), and computeTrainDimensions().
|
private |
Definition at line 133 of file MSTrainHelper.h.
Referenced by computeCarriages(), computeTrainDimensions(), and getCarriageLength().
|
private |
Definition at line 132 of file MSTrainHelper.h.
Referenced by computeCarriages(), and computeTrainDimensions().
|
private |
Definition at line 139 of file MSTrainHelper.h.
Referenced by computeCarriages(), computeDoorPositions(), computeUnboardingPositions(), getCarriages(), and ~MSTrainHelper().
|
private |
Definition at line 127 of file MSTrainHelper.h.
Referenced by computeCarriages(), and computeTrainDimensions().
|
private |
Definition at line 134 of file MSTrainHelper.h.
Referenced by computeCarriages(), computeTrainDimensions(), and getFirstCarriageLength().
|
private |
Definition at line 136 of file MSTrainHelper.h.
Referenced by computeCarriages(), and getFirstCarriageNo().
|
private |
Definition at line 137 of file MSTrainHelper.h.
Referenced by computeCarriages(), and getFirstPassengerCarriage().
|
private |
Definition at line 130 of file MSTrainHelper.h.
Referenced by computeTrainDimensions(), computeUnboardingPositions(), and getHalfWidth().
|
private |
Definition at line 138 of file MSTrainHelper.h.
Referenced by computeCarriages(), and isReversed().
|
private |
Definition at line 129 of file MSTrainHelper.h.
Referenced by computeTrainDimensions().
|
private |
Definition at line 126 of file MSTrainHelper.h.
Referenced by computeCarriages(), and computeTrainDimensions().
|
private |
Definition at line 131 of file MSTrainHelper.h.
Referenced by computeCarriages(), computeTrainDimensions(), and getNumCarriages().
|
private |
Definition at line 124 of file MSTrainHelper.h.
Referenced by computeCarriages(), and computeTrainDimensions().
|
private |
Definition at line 125 of file MSTrainHelper.h.
Referenced by computeTrainDimensions(), and getUpscaleLength().
|
static |
small extra tolerance used to avoid constraint violations
Definition at line 118 of file MSTrainHelper.h.
Referenced by computeUnboardingPositions().