Package it.polito.appeal.traci.ReadObjectVarQuery

Examples of it.polito.appeal.traci.ReadObjectVarQuery.StringListQ


     */
   
  }

  public StringListQ newIDListQuery(final int command) {
    return new StringListQ(dis, dos,
        command, "", Constants.ID_LIST);
  }
View Full Code Here


   
    /*
     * constructs a multi-query that advances one step, reads the list of
     * active vehicles, the list of teleport-starting and teleport-ending
     */
    StringListQ teleportStartQ;
    StringListQ teleportEndQ;
    MultiQuery multi = new MultiQuery(dos, dis);
    { // begin multi-query
      SimStepQuery ssq = new SimStepQuery(dis, dos);
      ssq.setTargetTime(currentSimStep * 1000);
      multi.add(ssq);

      multi.add(vehicleListQuery);

      teleportStartQ = new StringListQ(dis, dos,
          Constants.CMD_GET_SIM_VARIABLE, "",
          Constants.VAR_TELEPORT_STARTING_VEHICLES_IDS);
      multi.add(teleportStartQ);

      teleportEndQ = new StringListQ(dis, dos,
          Constants.CMD_GET_SIM_VARIABLE, "",
          Constants.VAR_TELEPORT_ENDING_VEHICLES_IDS);
      multi.add(teleportEndQ);
    } // end multi-query
    multi.run();

    /*
     * now, compute the difference sets (departed/arrived) and teleports
     */
    List<String> teleportStart = teleportStartQ.get();
    List<String> teleportEnd = teleportEndQ.get();
   
    Set<String> vehicleListAfter = new HashSet<String>(vehicleListQuery.get());

    Set<String> departedIDs = Utils.getAddedItems(vehicleListBefore, vehicleListAfter);
    departedIDs.removeAll(teleportEnd);
View Full Code Here

     */
   
  }

  private StringListQ newIDListQuery(final int command) {
    return new StringListQ(dis, dos,
        command, "", Constants.ID_LIST);
  }
View Full Code Here

   
    /*
     * constructs a multi-query that advances one step, reads the list of
     * active vehicles, the list of teleport-starting and teleport-ending
     */
    StringListQ teleportStartQ;
    StringListQ teleportEndQ;
    MultiQuery multi = new MultiQuery(dos, dis);
    { // begin multi-query
      SimStepQuery ssq = new SimStepQuery(dis, dos);
      ssq.setTargetTime(currentSimStep * 1000);
      multi.add(ssq);

      multi.add(vehicleListQuery);

      teleportStartQ = new StringListQ(dis, dos,
          Constants.CMD_GET_SIM_VARIABLE, "",
          Constants.VAR_TELEPORT_STARTING_VEHICLES_IDS);
      multi.add(teleportStartQ);

      teleportEndQ = new StringListQ(dis, dos,
          Constants.CMD_GET_SIM_VARIABLE, "",
          Constants.VAR_TELEPORT_ENDING_VEHICLES_IDS);
      multi.add(teleportEndQ);
    } // end multi-query
    multi.run();

    /*
     * now, compute the difference sets (departed/arrived) and teleports
     */
    List<String> teleportStart = teleportStartQ.get();
    List<String> teleportEnd = teleportEndQ.get();
   
    Set<String> vehicleListAfter = new HashSet<String>(vehicleListQuery.get());

    Set<String> departedIDs = Utils.getAddedItems(vehicleListBefore, vehicleListAfter);
    departedIDs.removeAll(teleportEnd);
View Full Code Here

TOP

Related Classes of it.polito.appeal.traci.ReadObjectVarQuery.StringListQ

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.