* @throws TraciException
*/
private float[] subscribeToVehicleValues(String id, int startTime) throws IOException, TraciException {
SubscribeVehicleValueRetrivalCommandGenerator vehicleValue = new SubscribeVehicleValueRetrivalCommandGenerator(
startTime, ModelManager.getInstance().getSimulationEndTime() * 1000, id);
Message request = new Message(vehicleValue);
request.writeToStream(this.outputStream);
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.");