/****************************************************************************/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 MEVehicleControl.cpp14/// @author Daniel Krajzewicz15/// @date Wed, 10. Dec 200316///17// The class responsible for building and deletion of vehicles (meso-version)18/****************************************************************************/19#include <config.h>2021#include <utils/common/FileHelpers.h>22#include <utils/common/MsgHandler.h>23#include <utils/vehicle/SUMOVTypeParameter.h>24#include <utils/iodevices/OutputDevice.h>25#include <microsim/MSNet.h>26#include <microsim/MSRouteHandler.h>27#include <microsim/MSVehicleType.h>28#include "MESegment.h"29#include "MEVehicle.h"30#include "MEVehicleControl.h"313233// ===========================================================================34// member method definitions35// ===========================================================================36MEVehicleControl::MEVehicleControl()37: MSVehicleControl() {}383940MEVehicleControl::~MEVehicleControl() {}414243SUMOVehicle*44MEVehicleControl::buildVehicle(SUMOVehicleParameter* defs,45ConstMSRoutePtr route, MSVehicleType* type,46const bool ignoreStopErrors, const VehicleDefinitionSource source,47bool addRouteStops) {48const double speedFactor = (source == VehicleDefinitionSource::STATE ? 1 :49type->computeChosenSpeedDeviation(source == VehicleDefinitionSource::ROUTEFILE ? MSRouteHandler::getParsingRNG() : nullptr));50MEVehicle* built = new MEVehicle(defs, route, type, speedFactor);51initVehicle(built, ignoreStopErrors, addRouteStops, source);52return built;53}545556/****************************************************************************/575859