/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2012-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 GUITransportableControl.cpp14/// @author Daniel Krajzewicz15/// @author Jakob Erdmann16/// @author Michael Behrisch17/// @date Wed, 13.06.201218///19// GUI-version of the person control for building gui persons20/****************************************************************************/21#include <config.h>2223#include <vector>24#include <algorithm>25#include "GUINet.h"26#include "GUIContainer.h"27#include "GUIPerson.h"28#include "GUITransportableControl.h"293031// ===========================================================================32// method definitions33// ===========================================================================34GUITransportableControl::GUITransportableControl(const bool isPerson) :35MSTransportableControl(isPerson),36myIsPerson(isPerson)37{}383940GUITransportableControl::~GUITransportableControl() {41}424344MSTransportable*45GUITransportableControl::buildPerson(const SUMOVehicleParameter* pars, MSVehicleType* vtype, MSTransportable::MSTransportablePlan* plan,46SumoRNG* rng) const {47const double speedFactor = vtype->computeChosenSpeedDeviation(rng);48return new GUIPerson(pars, vtype, plan, speedFactor);49}505152MSTransportable*53GUITransportableControl::buildContainer(const SUMOVehicleParameter* pars, MSVehicleType* vtype, MSTransportable::MSTransportablePlan* plan) const {54return new GUIContainer(pars, vtype, plan);55}565758void59GUITransportableControl::insertIDs(std::vector<GUIGlID>& into) {60into.reserve(myTransportables.size());61for (std::map<std::string, MSTransportable*>::const_iterator it = myTransportables.begin(); it != myTransportables.end(); ++it) {62if (it->second->getCurrentStageType() != MSStageType::WAITING_FOR_DEPART) {63if (myIsPerson) {64into.push_back(static_cast<const GUIPerson*>(it->second)->getGlID());65} else {66into.push_back(static_cast<const GUIContainer*>(it->second)->getGlID());67}68}69}70}717273/****************************************************************************/747576