Examples of AreaModel


Examples of de.hpi.eworld.model.db.data.AreaModel

              vehicleType = vehicleTypes.get(indexOfVehicleType);
            }

            // select random destination area
            int indexOfDestinationArea = random.nextInt(destinationAreasOfThisStartArea.size());
            AreaModel destinationArea = destinationAreasOfThisStartArea.get(indexOfDestinationArea);

            // select random destination edge in this area
            List<EdgeModel> destinationEdges = destinationArea.getLocation().getEdges();
            if (destinationEdges.size() > 0) {
              int indexOfDestinationEdge = random.nextInt(destinationEdges.size());
              EdgeModel destinationEdge = destinationEdges.get(indexOfDestinationEdge);

              // write data to buffer
View Full Code Here

Examples of de.hpi.eworld.model.db.data.AreaModel

              vehicleType = vehicleTypes.get(indexOfVehicleType);
            }

            // select random destination area
            int indexOfDestinationArea = random.nextInt(destinationAreasOfThisStartArea.size());
            AreaModel destinationArea = destinationAreasOfThisStartArea.get(indexOfDestinationArea);

            // select random destination edge in this area
            List<EdgeModel> destinationEdges = destinationArea.getLocation().getEdges();
            if (destinationEdges.size() > 0) {
              int indexOfDestinationEdge = random.nextInt(destinationEdges.size());
              EdgeModel destinationEdge = destinationEdges.get(indexOfDestinationEdge);

              // write data to buffer
              buffer.append(writeTrip(startArea.getSimulationTime(), destinationArea.getSimulationTime(), startEdge, destinationEdge,
                  vehicleType, vehicleCountOnThisFlow));
            }
          }
        }
      }
View Full Code Here

Examples of de.hpi.eworld.model.db.data.AreaModel

    // initialize variables
    init();

    // create start and destination areas
    areas = new ArrayList<AreaModel>();
    AreaModel destinationArea1 = createDestinationArea(5.0, 4.0, 0.5, 0, 0, 0);
    AreaModel destinationArea2 = createDestinationArea(5.0, 2.0, 0.5, 0, 0, 0);
    areas.add(destinationArea1);
    areas.add(destinationArea2);
    vehicleCountPerArea.put(destinationArea1, new int[] { 0, 0 });
    vehicleCountPerArea.put(destinationArea2, new int[] { 0, 0 });
    AreaModel startArea1 = createStartArea(1.0, 1.0, 0.5, 100, 50, 1, Arrays.asList(destinationArea1));
    AreaModel startArea2 = createStartArea(2.0, 4.0, 0.5, 200, 10, 1, Arrays.asList(destinationArea2));
    areas.add(startArea1);
    areas.add(startArea2);
    vehicleCountPerArea.put(startArea1, new int[] { 50, 0 });
    vehicleCountPerArea.put(startArea2, new int[] { 10, 0 });
View Full Code Here

Examples of de.hpi.eworld.model.db.data.AreaModel

    // initialize variables
    init();

    // create destination areas only
    areas = new ArrayList<AreaModel>();
    AreaModel destinationArea1 = createDestinationArea(5.0, 4.0, 0.5, 100, 50, 1);
    AreaModel destinationArea2 = createDestinationArea(5.0, 2.0, 0.5, 200, 10, 1);
    areas.add(destinationArea1);
    areas.add(destinationArea2);
    vehicleCountPerArea.put(destinationArea1, new int[] { 50, 0 });
    vehicleCountPerArea.put(destinationArea2, new int[] { 10, 0 });
View Full Code Here

Examples of de.hpi.eworld.model.db.data.AreaModel

    // initialize variables
    init();

    // create start areas only
    areas = new ArrayList<AreaModel>();
    AreaModel startArea1 = createStartArea(1.0, 1.0, 0.5, 100, 50, 1, new ArrayList<AreaModel>());
    AreaModel startArea2 = createStartArea(2.0, 4.0, 0.5, 200, 10, 1, new ArrayList<AreaModel>());
    areas.add(startArea1);
    areas.add(startArea2);
    vehicleCountPerArea.put(startArea1, new int[] { 50, 0 });
    vehicleCountPerArea.put(startArea2, new int[] { 10, 0 });
View Full Code Here

Examples of de.hpi.eworld.model.db.data.AreaModel

    List<EdgeModel> underlyingEdges = TestCaseUtil.calculateUnderlyingEdges(latitude, longitude, radius, edges);
    for (EdgeModel underlyingEdge : underlyingEdges) {
      startLocation.addEdge(underlyingEdge);
    }

    AreaModel area = new AreaModel(startLocation, AreaModel.AreaType.START);
    area.setSimulationTime(simulationTime);
    area.setVehicleCount(vehicleCount);
    area.setVehicleEmitInterval(vehicleEmitInterval);
    area.setVehicleTypes(new ArrayList<String>());
    area.setDestinationAreas(destinationAreas);

    return area;
  }
View Full Code Here

Examples of de.hpi.eworld.model.db.data.AreaModel

    List<EdgeModel> underlyingEdges = TestCaseUtil.calculateUnderlyingEdges(latitude, longitude, radius, edges);
    for (EdgeModel underlyingEdge : underlyingEdges) {
      destinationLocation.addEdge(underlyingEdge);
    }

    AreaModel area = new AreaModel(destinationLocation, AreaModel.AreaType.DESTINATION);
    area.setSimulationTime(simulationTime);
    area.setVehicleCount(vehicleCount);
    area.setVehicleEmitInterval(vehicleEmitInterval);
    area.setVehicleTypes(new ArrayList<String>());

    return area;
  }
View Full Code Here

Examples of de.hpi.eworld.model.db.data.AreaModel

   * @param fromEdge The edge where the route starts.
   * @param toEdge The edge where the route ends.
   */
  private void evaluateEdges(String fromEdge, String toEdge) {
    // fetch corresponding edges
    AreaModel startArea = getAreaByEdgeID(fromEdge);
    AreaModel destinationArea = getAreaByEdgeID(toEdge);

    // check simulation time
    if (testPart == TestPart.WITHOUT_START_PARSING_ROUTES) {
      if (destinationArea != null) {
        Assert.assertTrue(destinationArea.getSimulationTime() >= currentStartTime);
      }
    } else {
      if (startArea != null) {
        Assert.assertTrue(startArea.getSimulationTime() <= currentStartTime);
      }
View Full Code Here

Examples of de.hpi.eworld.model.db.data.AreaModel

   * @param toEdgeID The destination edge.
   */
  private void checkStartBelongsToDestination(String fromEdgeID, String toEdgeID) {
    if (testPart == TestPart.START_AND_DESTINATION_PARSING_TRIPS || testPart == TestPart.START_AND_DESTINATION_PARSING_ROUTES) {
      // check, whether the start area contains this area as a destination area
      AreaModel startArea = getAreaByEdgeID(fromEdgeID);
      AreaModel destinationArea = getAreaByEdgeID(toEdgeID);
      if (!startArea.getDestinationAreas().contains(destinationArea)) {
        Assert.fail("ScenariosTest: start area with edge " + fromEdgeID + " does not contain destination area with edge "
            + toEdgeID);
      }
    } else if (testPart == TestPart.WITHOUT_START_PARSING_TRIPS || testPart == TestPart.WITHOUT_START_PARSING_ROUTES) {
      // check, whether a destination area contains this edge
      AreaModel destinationArea = getAreaByEdgeID(toEdgeID);
      if (destinationArea == null) {
        Assert.fail("ScenariosTest: no destination area contains destination edge " + toEdgeID);
      }

      // check, whether the network contains this start edge
      EdgeModel startEdge = getEdgeByEdgeID(fromEdgeID);
      if (startEdge == null) {
        Assert.fail("ScenariosTest: street network does not contain start edge " + fromEdgeID);
      }
    } else if (testPart == TestPart.WITHOUT_DESTINATION_PARSING_TRIPS
        || testPart == TestPart.WITHOUT_DESTINATION_PARSING_ROUTES) {
      // check, whether a start area contains this edge
      AreaModel startArea = getAreaByEdgeID(fromEdgeID);
      if (startArea == null) {
        Assert.fail("ScenariosTest: no start area contains start edge " + fromEdgeID);
      }

      // check, whether the network contains this destination edge
View Full Code Here

Examples of de.hpi.eworld.model.db.data.AreaModel

          ids.add(id);
        }

        String from = attributes.getValue(FROM);
        String to = attributes.getValue(TO);
        AreaModel startArea = getAreaByEdgeID(from);
        AreaModel destinationArea = getAreaByEdgeID(to);

        // check simulation time
        int startTime = Integer.parseInt(attributes.getValue(DEPART));
        if (testPart == TestPart.WITHOUT_START_PARSING_TRIPS) {
          if (destinationArea != null) {
            Assert.assertTrue(destinationArea.getSimulationTime() >= startTime);
          }
        } else {
          if (startArea != null) {
            Assert.assertTrue(startArea.getSimulationTime() <= startTime);
          }
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.