/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 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"282930// ===========================================================================31// class definitions32// ===========================================================================33/// @brief the "vehicle" type that is given to the internal router (SUMOAbstractRouter)34template<class E, class N, class V>35class IntermodalTrip {36public:37IntermodalTrip(const E* _from, const E* _to, double _departPos, double _arrivalPos,38double _speed, SUMOTime _departTime, const N* _node,39const V* _vehicle = 0, const SVCPermissions _modeSet = SVC_PEDESTRIAN,40const EffortCalculator* const _calc = nullptr, const double _externalFactor = 0.) :41from(_from),42to(_to),43departPos(_departPos < 0 ? _from->getLength() + _departPos : _departPos),44arrivalPos(_arrivalPos < 0 ? _to->getLength() + _arrivalPos : _arrivalPos),45speed(_speed),46departTime(_departTime),47node(_node),48vehicle(_vehicle),49modeSet(_modeSet),50calc(_calc),51externalFactor(_externalFactor) {52}5354// exists just for debugging purposes55std::string getID() const {56return from->getID() + ":" + to->getID() + ":" + time2string(departTime);57}585960inline SUMOVehicleClass getVClass() const {61return vehicle != 0 ? vehicle->getVClass() : SVC_PEDESTRIAN;62}6364/** @brief Returns whether this object is ignoring transient permission65* changes (during routing)66*/67bool ignoreTransientPermissions() const {68return vehicle != 0 ? vehicle->ignoreTransientPermissions() : false;69};7071inline double getLength() const {72// person length is arbitrary (only used in the context of rail-reversal validity73return vehicle != 0 ? vehicle->getVehicleType().getLength() : 1;74}7576// only used by AStar77inline double getMaxSpeed() const {78return vehicle != nullptr ? vehicle->getMaxSpeed() : speed;79}8081// only used by AStar82inline double getChosenSpeedFactor() const {83return vehicle != nullptr ? vehicle->getChosenSpeedFactor() : 1.0;84}8586const E* const from;87const E* const to;88const double departPos;89const double arrivalPos;90const double speed;91const SUMOTime departTime;92const N* const node; // indicates whether only routing across this node shall be performed93const V* const vehicle; // indicates which vehicle may be used94const SVCPermissions modeSet;95const EffortCalculator* const calc;96const double externalFactor;9798private:99/// @brief Invalidated assignment operator.100IntermodalTrip& operator=(const IntermodalTrip&);101};102103104