Class JunctionGetPosition

java.lang.Object
org.eclipse.mosaic.fed.sumo.bridge.traci.AbstractTraciCommand<Position>
org.eclipse.mosaic.fed.sumo.bridge.traci.JunctionGetPosition
All Implemented Interfaces:
JunctionGetPosition

public class JunctionGetPosition extends AbstractTraciCommand<Position> implements JunctionGetPosition
  • Constructor Details

    • JunctionGetPosition

      public JunctionGetPosition()
      Creates a new JunctionGetPosition object. Access needs to be public, because command is called using Reflection.
  • Method Details

    • execute

      public Position execute(Bridge bridge, String junctionId) throws CommandException, InternalFederateException
      This method executes the command with the given arguments and returns the position of the junction.
      Specified by:
      execute in interface JunctionGetPosition
      Parameters:
      bridge - Connection to SUMO.
      junctionId - Id of the junction
      Returns:
      Position of the junction.
      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 Position 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<Position>
      Parameters:
      status - the status of the response
      objects - the objects created by the configured readers
      Returns:
      the final result constructed from the passed objects