Examples of LaneModel


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

      int noLanes = edgeProps.getLanesForWay(currentAttributes);
     
      EdgeModel edge = null;
      ArrayList<LaneModel> lanes = new ArrayList<>();
      for( int i = 0; i < noLanes; i++ ) {
        LaneModel lane = new LaneModel( 0, speed );
        lanes.add( lane );
      }

      // create edge without reference to previous or next edges
View Full Code Here

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

   * @return The create edge.
   */
  public static EdgeModel createTestEdge(NodeModel fromNode, NodeModel toNode) {
    EdgeModel result = new EdgeModel("edgeModelID", fromNode, toNode);
    ArrayList<LaneModel> lanes = new ArrayList<LaneModel>();
    lanes.add(new LaneModel(10, 100));
    lanes.add(new LaneModel(30, 50));
    result.setLanes(lanes);
    result.setMaxspeed(100);
    result.setMinspeed(30);
    result.setPriority(3);

View Full Code Here

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

    w[24].addForwardEdge(e[48]);
    w[24].addBackwardEdge(e[49]);

    // create lanes for all edges
    for (EdgeModel edge : e) {
      edge.addLane(new LaneModel(10, 70));
    }

    // create point of interests
    PointOfInterest[] poi = new PointOfInterest[2];
    poi[0] = new PointOfInterest(1.0, 2.0, "Point of interest 1");
View Full Code Here

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

   
    re1.setFullBlock(true);
    Assert.assertTrue(re1.isFullBlock());
   
    ArrayList<LaneModel> ll = new ArrayList<LaneModel>();
    LaneModel l1 = new LaneModel(50, 70);
    ll.add(l1);
    LaneModel l2 = new LaneModel(-23, -75);
    ll.add(l2);
    re1.setBlockedLanes(ll);
   
    Assert.assertEquals(2, re1.getBlockedLanes().size());
    Assert.assertEquals(l1, re1.getBlockedLanes().get(0));
View Full Code Here

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

          NodeList laneList = curNode.getChildNodes();
          int maxSpeed = 42;
          for (int j = 0; j < laneList.getLength(); j++) {
            if (laneList.item(j).getNodeName().equals("lane")) {
              LaneModel newLane = new LaneModel();
              maxSpeed = Math.round(Float.parseFloat(laneList.item(j).getAttributes()
                  .getNamedItem("speed").getTextContent()) * 3.6f);
              newLane.setMaxSpeed(maxSpeed);
              newEdge.addLane(newLane);
            }
          }
         
          newEdge.setMaxspeed(maxSpeed);
 
View Full Code Here

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

        }
        edge.setLanes((ArrayList<LaneModel>) lanes);
      } else {
        // add n lanes
        final List<LaneModel> lanes = edge.getLanes();
        final LaneModel sampleLane = lanes.get(0);
        for (int i = 0; i < diff; i++) {
          lanes.add(new LaneModel(sampleLane));
        }
        edge.setLanes((ArrayList<LaneModel>) lanes);
      }
      // notify model manager of element change
      ModelManager.getInstance().modelElementChanged(edge);
View Full Code Here

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

    for(Entry<String, MyEdge> edgePair : edges.entrySet()) {
      MyEdge e = edgePair.getValue();
      EdgeModel newEdge = new EdgeModel(edgePair.getKey(), eNodes.get(e.first), eNodes.get(e.second));
     
      for(int i=0; i<e.nolanes; i++) {
        newEdge.addLane(new LaneModel());
      }
     
      model.addModelElement(newEdge);
      if (eWays.keySet().contains(e.second + "|" + e.first)) {
        eWays.get(e.second+"|"+e.first).addBackwardEdge(newEdge);
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.