Examples of addModelElement()


Examples of de.hpi.eworld.core.ModelManager.addModelElement()

    for (ModelElement element : allElements) {
      if (element instanceof WayModel) {
        WayModel way = (WayModel) element;
        //add way to ModelManager
        mm.addModelElement(way);
       
        List<EdgeModel> edges = way.getBackwardEdges();
        edges.addAll(way.getForwardEdges());
        for (EdgeModel edge : edges) {
          // for each edge in the testcase add a StatEdge to the dummy
View Full Code Here

Examples of de.hpi.eworld.core.ModelManager.addModelElement()

   * {@code ModelManager} and connects the number models to this new instance.
   */
  private void createCity() {
    CityModel city = new CityModel();
    ModelManager modelManager = ModelManager.getInstance();
    modelManager.addModelElement(city);

    carPersonRelationModel.clear();
    carPersonRelationModel.add(city);
    carPreferenceModel.clear();
    carPreferenceModel.add(city);
View Full Code Here

Examples of de.hpi.eworld.core.ModelManager.addModelElement()

//      if (n.isTrafficLight)
//        newNode = new TrafficLightModel(n.lat, n.lon);
//      else
//        newNode = new NodeModel(n.lat, n.lon);
      eNodes.put(id, newNode);
      model.addModelElement(newNode);
    }
   
    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));
View Full Code Here

Examples of de.hpi.eworld.core.ModelManager.addModelElement()

     
      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);
        newEdge.setComplementaryEdge(eWays.get(e.second+"|"+e.first).getFirstForwardEdge());
        eWays.get(e.second+"|"+e.first).getFirstForwardEdge().setComplementaryEdge(newEdge);
        newEdge.setParentWay(eWays.get(e.second+"|"+e.first));
View Full Code Here

Examples of de.hpi.eworld.core.ModelManager.addModelElement()

      } else {
        WayModel newWay = new WayModel("");
        newWay.addForwardEdge(newEdge);
        newEdge.setParentWay(newWay);
        eWays.put(e.first+"|"+e.second, newWay);
        model.addModelElement(newWay);
      }
    }
   
    model.setChanged();
    model.notifyObservers(new ObserverNotification(NotificationType.endBatchProcess, true, false));
View Full Code Here

Examples of test.de.hpi.eworld.util.ModelManagerMockUp.addModelElement()

   
    ArrayList<ModelElement> testCase = TestCaseUtil.createSampleTestcase();
    for(ModelElement m : testCase) {
      mm.addModelElement(m);
      // save test case structural information for later use
      mmm.addModelElement(m);
    }
    // save and load again from the DB
    dba.save();
    dba.load();
   
View Full Code Here

Examples of test.de.hpi.eworld.util.ModelManagerMockUp.addModelElement()

    dba.load();
   
    Collection<ModelElement> loadedModelElements = mm.getAllModelElements();
    ModelManagerMockUp mmmCompare = ModelManagerMockUp.getInstance();
    for(ModelElement m : loadedModelElements) {
      mmmCompare.addModelElement(m);
    }
   
    Assert.assertEquals(mmm.nodes, mmmCompare.nodes);
    Assert.assertEquals(mmm.pois, mmmCompare.pois);
    Assert.assertEquals(mmm.trafficlights, mmmCompare.trafficlights);
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.