Package javaff.planning

Examples of javaff.planning.PlanningGraph$Node


  /**
   * {@inheritDoc}
   */
  public void process(NodeContainer container) {
    Node node = container.getEntity();

    boolean matchesFilter = false;
    for (Tag tag : node.getTags()) {
      String keyValue = tag.getKey() + "." + tag.getValue();
      if (allowedKeyValues.contains(keyValue)) {
        matchesFilter = true;
        break;
      }
View Full Code Here


            false,
            false);
    simpleAreaFilter.setSink(entityInspector);
    intersectingBound = new Bound(30, 10, 30, 10, "intersecting");
    nonIntersectingBound = new Bound(-30, -50, 10, -10, "nonintersecting");
    inAreaNode = new Node(new CommonEntityData(1234, 0, new Date(), user, 0, tags), 10, 10);
    outOfAreaNode = new Node(new CommonEntityData(1235, 0, new Date(), user, 0, tags), 30, 30);
    edgeNodeEast = new Node(new CommonEntityData(1236, 0, new Date(), user, 0, tags), 10, 20);
    edgeNodeWest = new Node(new CommonEntityData(1237, 0, new Date(), user, 0, tags), 10, -20);
    edgeNodeNorth = new Node(new CommonEntityData(1238, 0, new Date(), user, 0, tags), 20, 10);
    edgeNodeSouth = new Node(new CommonEntityData(1239, 0, new Date(), user, 0, tags), -20, 10);
  }
View Full Code Here

    polyAreaFilter = new PolygonFilter(IdTrackerType.Dynamic, polygonFile, false, false, false, false);
    polyAreaFilter.setSink(entityInspector);
    intersectingBound = new Bound(30, 0, 30, 0, "intersecting");
    crossingIntersectingBound = new Bound(-10, 10, 30, -30, "crossing intersecting");
    nonIntersectingBound = new Bound(30, 15, 30, 15, "nonintersecting");
    inAreaNode = new Node(new CommonEntityData(1234, 0, new Date(), user, 0, tags), 5, 10);
    outOfAreaNode = new Node(new CommonEntityData(1235, 0, new Date(), user, 0, tags), 15, 15);
    edgeNode = new Node(new CommonEntityData(1236, 0, new Date(), user, 0, tags), 15, 10);
  }
View Full Code Here

  /**
   * Test writing out a normal Node element.
   */
  @Test
  public final void testProcessNormalNode() {
    Node node =
      new Node(
        new CommonEntityData(1234, 2, timestamp, new OsmUser(23, "someuser"), 0),
        20.12345678, -21.98765432);
    node.getTags().add(new Tag("nodekey", "nodevalue"));
    testNodeWriter.process(node);
    try {
      testBufferedWriter.flush();
    } catch (IOException e) {
      e.printStackTrace();
View Full Code Here

   * Test writing out a Node element with no tags.
   */
  @Test
  public final void testProcessNodeNoTags() {
    testNodeWriter.process(
        new Node(
          new CommonEntityData(
            1234, 2, timestamp,
            new OsmUser(23, "someuser"), 0,
            new ArrayList<Tag>()),
          20.12345678,
View Full Code Here

  /**
   * Test writing of a Node element with no user.
   */
  @Test
  public final void testProcessNodeWithNoUser() {
    Node node = new Node(new CommonEntityData(1234, 2, timestamp, OsmUser.NONE, 0), 20.12345678, -21.98765432);
    node.getTags().add(new Tag("nodekey", "nodevalue"));
    testNodeWriter.process(node);
    try {
      testBufferedWriter.flush();
    } catch (IOException e) {
      e.printStackTrace();
View Full Code Here

    }
   
    private Node createNode() {
      double lon = (bound.getRight() - bound.getLeft()) / 2;
      double lat = (bound.getTop() - bound.getBottom()) / 2;
      return new Node(
          new CommonEntityData(idGenerator.incrementAndGet(), 1, new Date(), OsmUser.NONE, 1),
          lat, lon);
    }
View Full Code Here

    DatasetContext dsCtx = dataset.createReader();
   
    try {
      EntityManager<Node> nodeManager = dsCtx.getNodeManager();
      OsmUser user;
      Node node;
     
      // Create the user for edits to be performed under. This is an existing user with an
      // updated name.
      user = new OsmUser(10, "user10b");
     
      // Modify node 1 to add a new tag.
      node = nodeManager.getEntity(1).getWriteableInstance();
      node.setUser(user);
      node.getTags().add(new Tag("change", "new tag"));
      nodeManager.modifyEntity(node);
     
      // Delete node 6.
      nodeManager.removeEntity(6);
     
      // Add node 7 using the NONE user.
      node = new Node(new CommonEntityData(7, 16, buildDate("2008-01-02 18:19:20"), OsmUser.NONE, 93), -11, -12);
      node.getTags().addAll(
          Arrays.asList(new Tag[]{new Tag("created_by", "Me7"), new Tag("change", "new node")}));
      nodeManager.addEntity(node);
     
      dsCtx.complete();
     
View Full Code Here

     
      processedNodes = new ArrayList<Node>(INSERT_BULK_ROW_COUNT_NODE);
     
      prmIndex = 1;
      for (int i = 0; i < INSERT_BULK_ROW_COUNT_NODE; i++) {
        Node node;
       
        node = nodeBuffer.remove(0);
        processedNodes.add(node);
       
        prmIndex = nodeBuilder.populateEntityParameters(bulkNodeStatement, prmIndex, node);
      }
     
      try {
        bulkNodeStatement.executeUpdate();
      } catch (SQLException e) {
        throw new OsmosisRuntimeException("Unable to bulk insert nodes into the database.", e);
      }
     
      for (Node node : processedNodes) {
        addNodeTags(node);
      }
    }
   
    if (complete) {
      while (nodeBuffer.size() > 0) {
        Node node;
       
        node = nodeBuffer.remove(0);
       
        nodeBuilder.populateEntityParameters(singleNodeStatement, 1, node);
       
View Full Code Here

   * @param scr
   *            Maintains the mapping between classes and their identifiers
   *            within the store.
   */
  public NodeContainer(StoreReader sr, StoreClassRegister scr) {
    node = new Node(sr, scr);
  }
View Full Code Here

TOP

Related Classes of javaff.planning.PlanningGraph$Node

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.