Package it.polito.appeal.traci

Examples of it.polito.appeal.traci.Edge


   
    List<Edge> routeBefore = routeQuery.get();
    System.out.println("Route before:         " + routeBefore);

    String edgeID = "middle";
    Edge edge = conn.getEdgeRepository().getByID(edgeID);
    ChangeEdgeTravelTimeQuery settq = firstVehicle.querySetEdgeTravelTime();
    settq.setEdge(edge);
    settq.setTravelTime(10000);
    settq.run();
   
View Full Code Here


    ValueReadQuery<List<Edge>> routeQuery = firstVehicle.queryReadCurrentRoute();
    List<Edge> routeBefore = routeQuery.get();
    System.out.println("Route before:         " + routeBefore);

    String edgeID = "middle";
    Edge edge = conn.getEdgeRepository().getByID(edgeID);
    ChangeGlobalTravelTimeQuery cttq = edge.queryChangeTravelTime();
    cttq.setBeginTime(0);
    cttq.setEndTime(1000);
    cttq.setTravelTime(10000);
    cttq.run();
   
    ReadGlobalTravelTimeQuery rgttq = edge.queryReadGlobalTravelTime();
    rgttq.setTime(conn.getCurrentSimStep());
    double newTravelTime = rgttq.get();
    assertEquals(10000, newTravelTime, DELTA);

    firstVehicle.queryReroute().run();
View Full Code Here

  }
 
  @Test
  public void testGetBelongingEdge() throws IOException {
    Lane lane = conn.getLaneRepository().getByID("beg_0");
    Edge edge = lane.queryReadParentEdge().get();
    assertEquals("beg", edge.getID());
  }
View Full Code Here

    ChangeTargetQuery ctq = v.queryChangeTarget();
    ctq.setValue(conn.getEdgeRepository().getByID("end"));
    ctq.run();
   
    Edge lastEdge = null;
    while (conn.getVehicleRepository().getByID(v.getID()) != null) {
      lastEdge = v.queryReadCurrentEdge().get();
      assertFalse(lastEdge.getID().equals("end"));

      conn.nextSimStep();
    }
  }
View Full Code Here

   
    List<Edge> routeBefore = firstVehicle.getCurrentRoute();
    log.info("Route before:         " + routeBefore);

    String edgeID = "middle";
    Edge edge = conn.getEdgeRepository().getByID(edgeID);
    ChangeEdgeTravelTimeQuery settq = firstVehicle.querySetEdgeTravelTime();
    settq.setEdge(edge);
    settq.setTravelTime(10000);
    settq.run();
   
View Full Code Here

   
    List<Edge> routeBefore = firstVehicle.getCurrentRoute();
    log.info("Route before:         " + routeBefore);

    String edgeID = "middle";
    Edge edge = conn.getEdgeRepository().getByID(edgeID);
    ChangeGlobalTravelTimeQuery cttq = edge.queryChangeTravelTime();
    cttq.setBeginTime(0);
    cttq.setEndTime(1000);
    cttq.setTravelTime(10000);
    cttq.run();
   
    ReadGlobalTravelTimeQuery rgttq = edge.queryReadGlobalTravelTime();
    rgttq.setTime(conn.getCurrentSimStep());
    double newTravelTime = rgttq.get();
    assertEquals(10000, newTravelTime, DELTA);

    firstVehicle.queryReroute().run();
View Full Code Here

   * @throws IOException
   */
  @Test
  public void testGetBelongingEdge() throws IOException {
    Lane lane = conn.getLaneRepository().getByID("beg_0");
    Edge edge = lane.getParentEdge();
    assertEquals("beg", edge.getID());
  }
View Full Code Here

  @Test
  public void testChangeTarget() throws IOException {
    getFirstVehicle();
    Vehicle v = firstVehicle;

    Edge endEdge = conn.getEdgeRepository().getByID("end");
    v.changeTarget(endEdge);
   
    Edge lastEdge = null;
    while (conn.getVehicleRepository().getByID(v.getID()) != null) {
      lastEdge = v.getCurrentEdge();
      assertFalse(lastEdge.getID().equals("rend"));

      conn.nextSimStep();
    }
  }
View Full Code Here

   */
  @Test
  public void testChangeTargetAlsoAffectsRouteList() throws IOException {
    getFirstVehicle();
    Vehicle v = firstVehicle;
    Edge endEdge = conn.getEdgeRepository().getByID("end");
    v.changeTarget(endEdge);
    List<Edge> route = v.getCurrentRoute();
    assertEquals("end", route.get(route.size()-1).getID());
  }
View Full Code Here

TOP

Related Classes of it.polito.appeal.traci.Edge

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.