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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.mosaic.fed.sumo.bridge.traci.AbstractTraciCommand
AbstractTraciCommand.TraciCommandResultReaderBuilder, AbstractTraciCommand.TraciCommandWriterBuilder
-
-
Constructor Summary
Constructors Constructor Description SimulationGetDepartedVehicleIds()
Creates a newSimulationGetDepartedVehicleIds
traci command, which will return a list of all departed vehicles once executed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<String>
constructResult(Status status, Object... objects)
This method is called during reading the command response when all readers have been executed.List<String>
execute(Bridge bridge)
This method executes the command with the given arguments in order to get the vehicles Id's in the simulation, which departed the simulation.-
Methods inherited from class org.eclipse.mosaic.fed.sumo.bridge.traci.AbstractTraciCommand
execute, executeAndReturn, executeAndReturnList, read, write
-
-
-
-
Constructor Detail
-
SimulationGetDepartedVehicleIds
public SimulationGetDepartedVehicleIds()
Creates a newSimulationGetDepartedVehicleIds
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 Detail
-
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 interfaceSimulationGetDepartedVehicleIds
- 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 classAbstractTraciCommand<List<String>>
- Parameters:
status
- the status of the responseobjects
- the objects created by the configured readers- Returns:
- the final result constructed from the passed objects
-
-