Package de.hpi.eworld.visualizer.simulation.traci.commands.received

Examples of de.hpi.eworld.visualizer.simulation.traci.commands.received.ResponseCommandReader


    message.writeToStream(this.outputStream);
    Message response = Message.readFromStream(this.inputStream);
    for (Command command:response.getCommands()) {
      switch(command.getId()) {
        case SubscribeSimulationValueRetrivalCommandGenerator.ID:
          ResponseCommandReader responseCommand = ResponseCommandReader.fromCommand(command);
          if(responseCommand.getResult() != 0) {
            throw new IOException("TraCI reported an error.");
          }
          break;
        case ResponseSimulationValueCommandReader.ID:
          @SuppressWarnings("unused")
View Full Code Here


    Message response = Message.readFromStream(this.inputStream);
    float[] position = null;
    for (Command command:response.getCommands()) {
      switch(command.getId()) {
        case SubscribeVehicleValueRetrivalCommandGenerator.ID:
          ResponseCommandReader responseCommand = ResponseCommandReader.fromCommand(command);
          if(responseCommand.getResult() != 0) {
            throw new IOException("TraCI reported an error.");
          }
          break;
        case ResponseVehicleValueCommandReader.ID:
          ResponseVehicleValueCommandReader reader = ResponseVehicleValueCommandReader.fromCommand(command);
View Full Code Here

    SimulationResponseReceiver receiver = SimulationResponseReceiver.readFromStream(this.inputStream);
    System.out.println("number of status responses: " + receiver.getNumberOfResponses());
    for(Command command : receiver.getCommands()) {
      switch(command.getId()) {
      case SimulationStepCommandGenerator2.ID:
        ResponseCommandReader responseCommand = ResponseCommandReader.fromCommand(command);;
        if(responseCommand.getResult() != 0) {
          throw new IOException("TraCI reported an error.");
        }
        break;
      case ResponseSimulationValueCommandReader.ID:
        ResponseSimulationValueCommandReader simulationValues = ResponseSimulationValueCommandReader.fromCommand(command);
View Full Code Here

    Command command = commands.get(0);
    int expectedID = getCommands().get(0).getId();
    if(command.getId() != expectedID) {
      throw new IOException("Expected command with ID " + expectedID + ", but got " + command.getId());
    }
    ResponseCommandReader commandReader = ResponseCommandReader.fromCommand(command);
    if(commandReader.getResult() != 0) {
      throw new TraciException("Received a TraCI exception: " + new String(commandReader.getDescription()));
    }
   
    ArrayList<Command> result = new ArrayList<Command>();
    result.addAll(commands);
    result.remove(0);
View Full Code Here

TOP

Related Classes of de.hpi.eworld.visualizer.simulation.traci.commands.received.ResponseCommandReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.