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

Examples of de.hpi.eworld.visualizer.simulation.traci.commands.ScenarioCommandCodec


    return new VehicleMovements(time, added, updated, removed);
  }

  @SuppressWarnings("unchecked")
  public List<TrafficLightPhase> getTrafficLightStatus(int trafficLightID) throws IOException, TraciException {
    ScenarioCommandCodec commandGenerator = ScenarioCommandCodec.buildReadCommandCodec(
        ScenarioCommandCodec.DOMAIN_TRAFFIC_LIGHT,
        trafficLightID,
        ScenarioCommandCodec.VARIABLE_ACTUAL_PHASE);
   
    ScenarioCommandCodec reader = createReader(commandGenerator);
    return (List<TrafficLightPhase>) reader.getValue();
  }
View Full Code Here


    return (List<TrafficLightPhase>) reader.getValue();
  }
 
  public int getExternalID(TrafficLightModel trafficLight) throws IOException, TraciException {
   
    ScenarioCommandCodec commandGenerator = ScenarioCommandCodec.buildReadCommandCodec(
        ScenarioCommandCodec.DOMAIN_TRAFFIC_LIGHT,
        -1,
        ScenarioCommandCodec.VARIABLE_EXTERNAL_ID,
        TraciConstants.DATATYPE_STRING,
        trafficLight.getInternalID().getBytes());
   
    ScenarioCommandCodec reader = createReader(commandGenerator);
    return ((Integer) reader.getValue()).intValue();
  }
View Full Code Here

    return ((Integer) reader.getValue()).intValue();
  }

  private ScenarioCommandCodec createReader(ScenarioCommandCodec commandGenerator) throws IOException, TraciException {
    Command command = commandGenerator.performSingleResponseSynchronousRequest(inputStream, outputStream);
    ScenarioCommandCodec reader = ScenarioCommandCodec.fromCommand(command);
   
    return reader;
  }
View Full Code Here

TOP

Related Classes of de.hpi.eworld.visualizer.simulation.traci.commands.ScenarioCommandCodec

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.