/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2026 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file IntermodalTrip.h14/// @author Jakob Erdmann15/// @author Michael Behrisch16/// @author Robert Hilbrich17/// @date Mon, 03 March 201418///19// The "vehicle" definition for the Intermodal Router20/****************************************************************************/21#pragma once22#include <config.h>2324#include <string>25#include <vector>2627#include "EffortCalculator.h"2829class SUMOVTypeParameter;3031// ===========================================================================32// class definitions33// ===========================================================================34/// @brief the "vehicle" type that is given to the internal router (SUMOAbstractRouter)35template<class E, class N, class V>36class IntermodalTrip {37public:38IntermodalTrip(const E* _from, const E* _to, double _departPos, double _arrivalPos,39double _speed, SUMOTime _departTime, const N* _node,40const SUMOVTypeParameter& _pars,41const V* _vehicle = 0, const SVCPermissions _modeSet = SVC_PEDESTRIAN,42const EffortCalculator* const _calc = nullptr, const double _externalFactor = 0.) :43from(_from),44to(_to),45departPos(_departPos < 0 ? _from->getLength() + _departPos : _departPos),46arrivalPos(_arrivalPos < 0 ? _to->getLength() + _arrivalPos : _arrivalPos),47speed(_speed),48departTime(_departTime),49node(_node),50pars(_pars),51vehicle(_vehicle),52modeSet(_modeSet),53calc(_calc),54externalFactor(_externalFactor) {55}5657// exists just for debugging purposes58std::string getID() const {59return from->getID() + ":" + to->getID() + ":" + time2string(departTime);60}616263inline SUMOVehicleClass getVClass() const {64return vehicle != 0 ? vehicle->getVClass() : SVC_PEDESTRIAN;65}6667inline const SUMOVTypeParameter& getVTypeParameter() const {68return vehicle != 0 ? vehicle->getVTypeParameter() : pars;69}7071/** @brief Returns whether this object is ignoring transient permission72* changes (during routing)73*/74bool ignoreTransientPermissions() const {75return vehicle != 0 ? vehicle->ignoreTransientPermissions() : false;76};7778inline double getLength() const {79// person length is arbitrary (only used in the context of rail-reversal validity80return vehicle != 0 ? vehicle->getVehicleType().getLength() : 1;81}8283// only used by AStar84inline double getMaxSpeed() const {85return vehicle != nullptr ? vehicle->getMaxSpeed() : speed;86}8788// only used by AStar89inline double getChosenSpeedFactor() const {90return vehicle != nullptr ? vehicle->getChosenSpeedFactor() : 1.0;91}9293const E* const from;94const E* const to;95const double departPos;96const double arrivalPos;97const double speed;98const SUMOTime departTime;99const N* const node; // indicates whether only routing across this node shall be performed100const SUMOVTypeParameter& pars;101const V* const vehicle; // indicates which vehicle may be used102const SVCPermissions modeSet;103const EffortCalculator* const calc;104const double externalFactor;105106private:107/// @brief Invalidated assignment operator.108IntermodalTrip& operator=(const IntermodalTrip&);109};110111112