Examples of run()


Examples of it.polito.appeal.traci.AddVehicleQuery.run()

    Route route = conn.getRouteRepository().getByID("0");
    VehicleType vType = conn.getVehicleTypeRepository().getByID("KRAUSS_DEFAULT");
   
    AddVehicleQuery avq = conn.queryAddVehicle();
    avq.setVehicleData(id, vType, route, 0, 0, 0);
    avq.run();
   
    /*
     * The new vehicle won't enter the simulation immediately, because other
     * vehicles are waiting the lane to be freed before entering.
     */
 
View Full Code Here

Examples of it.polito.appeal.traci.ChangeEdgeTravelTimeQuery.run()

    String edgeID = "middle";
    Edge edge = conn.getEdgeRepository().getByID(edgeID);
    ChangeEdgeTravelTimeQuery settq = firstVehicle.querySetEdgeTravelTime();
    settq.setEdge(edge);
    settq.setTravelTime(10000);
    settq.run();
   
    firstVehicle.queryReroute().run();
   
    List<Edge> routeAfter = routeQuery.get();
    System.out.println("Route after:          " + routeAfter);
View Full Code Here

Examples of it.polito.appeal.traci.ChangeGlobalTravelTimeQuery.run()

    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);
View Full Code Here

Examples of it.polito.appeal.traci.ChangeLightsStateQuery.run()

                     ls[i]=LightState.RED;
                    }
                    TLState tls = new TLState(ls);
                    ChangeLightsStateQuery q = tl.getChangeLightsStateQuery();
                    q.setValue(tls);
                    q.run();
                   

                }
            } catch (IOException ex) {
                Logger.getLogger(FuzzyTesterView.class.getName()).log(Level.SEVERE, null, ex);
View Full Code Here

Examples of it.polito.appeal.traci.ChangeObjectVarQuery.ChangeStringQ.run()

    Repository<POI> poiRepo = conn.getPOIRepository();
    POI poi = poiRepo.getByID("0");
    ChangeStringQ q = poi.getChangeTypeQuery();
    final String newType = "NEW_TYPE";
    q.setValue(newType);
    q.run();
    assertEquals(newType, poi.getReadTypeQuery().get());
  }
 
  @Test
  public void testSetPOIPosition() throws IOException {
View Full Code Here

Examples of it.polito.appeal.traci.ChangeRouteQuery.run()

    newRoute.add(conn.getEdgeRepository().getByID("beg2left"));
    newRoute.add(conn.getEdgeRepository().getByID("left"));
    newRoute.add(conn.getEdgeRepository().getByID("left2end"));
    ChangeRouteQuery crq = v.queryChangeRoute();
    crq.setValue(newRoute);
    crq.run();
    assertEquals(newRoute, v.queryReadCurrentRoute().get());
  }
 
  @Test
  public void testLaneLinks() throws IOException {
View Full Code Here

Examples of it.polito.appeal.traci.ChangeTargetQuery.run()

    getFirstVehicle();
    Vehicle v = firstVehicle;

    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"));
View Full Code Here

Examples of it.polito.appeal.traci.MultiQuery.run()

      MultiQuery multi = conn.makeMultiQuery();
      for (Vehicle vehicle : vehicles.values()) {
        multi.add(vehicle.queryReadPosition());
      }
      multi.add(conn.getVehicleRepository().getQuery());
      multi.run();
      conn.nextSimStep();
    }
    long elapsedMulti = System.currentTimeMillis() - start;
    System.out.println("MultiQuery queries: " + elapsedMulti + " ms");
   
View Full Code Here

Examples of it.polito.appeal.traci.POI.ChangeColorQuery.run()

    Repository<POI> poiRepo = conn.getPOIRepository();
    POI poi = poiRepo.getByID("0");
    final Color newColor = Color.cyan;
    ChangeColorQuery q = poi.getChangeColorQuery();
    q.setValue(newColor);
    q.run();
    assertEquals(newColor, poi.getReadColorQuery().get());
  }
 
  @Test
  public void testMeMeExistence() throws IOException {
View Full Code Here

Examples of it.polito.appeal.traci.POI.ChangePositionQuery.run()

    Repository<POI> poiRepo = conn.getPOIRepository();
    POI poi = poiRepo.getByID("0");
    final Point2D newPos = new Point2D.Double(0, 0);
    ChangePositionQuery q = poi.getChangePositionQuery();
    q.setValue(newPos);
    q.run();
    final Point2D pos = poi.getReadPositionQuery().get();
    assertEquals(newPos.getX(), pos.getX(), DELTA);
    assertEquals(newPos.getY(), pos.getY(), DELTA);
  }
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.