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

Examples of de.hpi.eworld.visualizer.simulation.traci.common.TraciOutputStream


  }
 
  @Override
  public Command toCommand() throws IOException {
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    TraciOutputStream dataOutputStream = new TraciOutputStream(outputStream);

    dataOutputStream.writeByte(flag);
    dataOutputStream.writeByte(domain);
    dataOutputStream.writeInt(domainID);
    dataOutputStream.writeByte(variable);
    dataOutputStream.writeByte(valueDataType);
    dataOutputStream.writeTraciObject(valueDataType, value);
    dataOutputStream.close();
   
    return new Command(ID, outputStream.toByteArray());
  }
View Full Code Here


  }
 
  public Command toCommand() throws IOException {
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    DataOutputStream dataOutputStream = new DataOutputStream(outputStream);
    TraciOutputStream traciOutputStream = new TraciOutputStream(dataOutputStream);
   
    traciOutputStream.writeInt(startTime);
    traciOutputStream.writeInt(endTime);
    // the simulation ID is always unused and therefore an empty string
    traciOutputStream.writeTraciObject(TraciConstants.DATATYPE_STRING, "".getBytes());
    traciOutputStream.writeByte(7); // count of following variables
    traciOutputStream.writeByte(CURRENT_SIMULATION_TIME);
    traciOutputStream.writeByte(NUMBER_LOADED_VEHICLES);
    traciOutputStream.writeByte(IDS_LOADED_VEHICLES);
    traciOutputStream.writeByte(NUMBER_DEPARTED_VEHICLES);
    traciOutputStream.writeByte(IDS_DEPARTED_VEHICLES);
    traciOutputStream.writeByte(NUMBER_ARRIVED_VEHICLES);
    traciOutputStream.writeByte(IDS_ARRIVED_VEHICLES);
    traciOutputStream.close();
    return new Command(ID, outputStream.toByteArray());
  }
View Full Code Here

 
  @Override
  public Command toCommand() throws IOException {
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    DataOutputStream dataOutputStream = new DataOutputStream(outputStream);
    TraciOutputStream traciOutputStream = new TraciOutputStream(dataOutputStream);
   
    traciOutputStream.writeInt(startTime);
    traciOutputStream.writeInt(endTime);
    traciOutputStream.writeTraciObject(TraciConstants.DATATYPE_STRING, objectId.getBytes());
    traciOutputStream.writeByte(1); // count of following variables
    traciOutputStream.writeByte(POSITION);
    traciOutputStream.close();
    return new Command(ID, outputStream.toByteArray());
  }
View Full Code Here

TOP

Related Classes of de.hpi.eworld.visualizer.simulation.traci.common.TraciOutputStream

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.