37 const double totalLength = vtype.
getLength();
75 const MSLane* backLane = lane;
76 int backFurtherIndex = furtherIndex;
117 while (carriageOffset < 0) {
127 while (carriageBackOffset < 0) {
129 if (prev != backLane) {
133 carriageBackOffset = 0;
150 Position dir = carriage->front - carriage->back;
151 const double carriageLength = dir.
length2D();
152 if (carriageLength > 0.0) {
156 carriage->doorPositions.push_back(carriage->front - dir * doorOffset);
167 Position dir = carriage->front - carriage->back;
168 const double carriageLength = dir.
length2D();
169 if (carriageLength > 0.0) {
172 double nbrLongitudinalCells, longitudinalOffset;
173 longitudinalOffset = std::modf((carriageLength - 2.0 * passengerRadius) / (2.0 * passengerRadius), &nbrLongitudinalCells);
174 double nbrLateralCells, lateralOffset;
175 lateralOffset = std::modf((
myHalfWidth * 2.0 - 2.0 * passengerRadius) / (2.0 * passengerRadius), &nbrLateralCells);
176 const Position gridOrigin = carriage->back + dir * (passengerRadius + 0.5 * longitudinalOffset) - perp * (
myHalfWidth - passengerRadius - 0.5 * lateralOffset);
177 for (
unsigned int i = 0; i <= (
unsigned int)nbrLongitudinalCells; i++) {
178 for (
unsigned int j = 0; j <= (
unsigned int)nbrLateralCells; j++) {
179 carriage->unboardingPositions.push_back(gridOrigin + dir * i * 2.0 * passengerRadius + perp * j * 2.0 * passengerRadius);
183 std::copy(carriage->unboardingPositions.begin(), carriage->unboardingPositions.end(), std::back_inserter(unboardingPositions));
192 if (upscale > 1 && length > 5 && width < 5 && vehicleQuality != 4) {
193 return MAX2(1.0, upscale * 5 / length);
@ SVC_RAIL
vehicle is a not electrified rail
@ SVC_RAIL_FAST
vehicle that is allowed to drive on high-speed rail tracks
@ SVC_RAIL_ELECTRIC
rail vehicle that requires electrified tracks
const double INVALID_DOUBLE
invalid double
bool isReversed() const
Returns whether the logical state of the vehicle is reversed - for drawing.
const SUMOVehicleParameter::Stop * getNextStopParameter() const
return parameters for the next stop (SUMOVehicle Interface)
double getLength() const
Returns the vehicle's length.
bool isParking() const
Returns whether the vehicle is parking.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
static bool gLefthand
Whether lefthand-drive is being simulated.
Representation of a lane in the micro simulation.
virtual double getLengthGeometryFactor(bool) const
double getLength() const
Returns the lane's length.
double getWidth() const
Returns the lane's width.
virtual const PositionVector & getShape(bool) const
void computeTrainDimensions(double exaggeration, int vehicleQuality)
double myFirstCarriageLength
const MSVehicle * myTrain
static const double PEDESTRIAN_RADIUS_EXTRA_TOLERANCE
small extra tolerance used to avoid constraint violations
std::vector< Carriage * > myCarriages
void computeDoorPositions()
compute door positions on demand and fills the carriage structures
double myLocomotiveLength
double myCarriageLengthWithGap
void computeUnboardingPositions(double passengerRadius, std::vector< Position > &unboardingPositions)
compute unboarding positions on demand and fills the carriage structures
static const double CARRIAGE_DOOR_WIDTH
average door width used to compute doors positions
int myFirstPassengerCarriage
double getUpscaleLength() const
void computeCarriages(bool reversed, bool secondaryShape)
const MSLane * getPreviousLane(const MSLane *current, int &furtherIndex) const
MSAbstractLaneChangeModel & getLaneChangeModel()
double getLateralPositionOnLane() const
Get the vehicle's lateral position on the lane.
double getPositionOnLane() const
Get the vehicle's position along the lane.
const MSLane * getLane() const
Returns the lane the vehicle is on.
The car-following model and parameter.
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
double getLength() const
Get vehicle's length [m].
const SUMOVTypeParameter & getParameter() const
A point in 2D or 3D with translation and scaling methods.
void norm2D()
Normalizes the given vector.
double x() const
Returns the x-position.
double length2D() const
Computes the length of the given vector neglecting the z coordinate.
double y() const
Returns the y-position.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
static void shuffle(std::vector< T > &v, SumoRNG *rng=nullptr)
double carriageLength
the length of train carriages and locomotive
int carriageDoors
the number of doors per carriage
double posLat
the lateral offset when stopping