Class SimulationGetDepartedVehicleIds

java.lang.Object
org.eclipse.mosaic.fed.sumo.bridge.traci.AbstractTraciCommand<List<String>>
org.eclipse.mosaic.fed.sumo.bridge.traci.SimulationGetDepartedVehicleIds
All Implemented Interfaces:
SimulationGetDepartedVehicleIds

public class SimulationGetDepartedVehicleIds extends AbstractTraciCommand<List<String>> implements SimulationGetDepartedVehicleIds
This class represents the SUMO command which allows to get the Id's of the vehicles departed the simulation.
  • Constructor Details

    • SimulationGetDepartedVehicleIds

      public SimulationGetDepartedVehicleIds()
      Creates a new SimulationGetDepartedVehicleIds traci command, which will return a list of all departed vehicles once executed. Access needs to be public, because command is called using Reflection.
  • Method Details

    • execute

      public List<String> execute(Bridge bridge) throws CommandException, InternalFederateException
      This method executes the command with the given arguments in order to get the vehicles Id's in the simulation, which departed the simulation.
      Specified by:
      execute in interface SimulationGetDepartedVehicleIds
      Parameters:
      bridge - Connection to SUMO.
      Returns:
      List of vehicle Id's.
      Throws:
      CommandException - if the status code of the response is ERROR. The connection to SUMO is still available.
      InternalFederateException - if some serious error occurs during writing or reading. The TraCI connection is shut down.
    • constructResult

      protected List<String> constructResult(Status status, Object... objects)
      Description copied from class: AbstractTraciCommand
      This method is called during reading the command response when all readers have been executed. The results of the readers are passed to this method.
      Specified by:
      constructResult in class AbstractTraciCommand<List<String>>
      Parameters:
      status - the status of the response
      objects - the objects created by the configured readers
      Returns:
      the final result constructed from the passed objects