Examples of Edge


Examples of diva.graph.modular.Edge

                for (int i = 1; i < 32; i++) {
                    Node n = g.createNode(null);
                    g.addNode(this, n, root);

                    Edge e = g.createEdge(null);
                    g.connectEdge(this, e, first, n);
                }

                stopTimer();
            }
View Full Code Here

Examples of edu.gmu.seor.prognos.unbbayesplugin.jt.prs.Edge

     
    }
  }
 
  public void createEdge( ProbabilisticNetwork rede, Node uNodeSrs, Node uNodeDes ){
    Edge edge = new Edge(uNodeSrs, uNodeDes);
    try {
      rede.addEdge(edge);
    } catch (InvalidParentException e) {
      e.printStackTrace();
    }
View Full Code Here

Examples of edu.indiana.extreme.xbaya.graph.Edge

      }

      this.draggedPort = port;

    } else if (selected instanceof Edge) {
      Edge edge = (Edge) selected;
      selectEdge(edge);
    } else {
      /*
       * If nothing is selected
       */
 
View Full Code Here

Examples of edu.stanford.hci.flowmap.structure.Edge

            //System.out.println("n1.outEdges: " + n1.getOutEdges().size());
            double avgX, avgY;
            int count = 0;
            avgX = avgY = 0;
            while (gpIter.hasNext()) {
                Edge e2 = (Edge) gpIter.next();
                Point2D e2Pt = e2.getSecondNode()
                        .getLocation();
                //System.out.println("averaging points: " + e2Pt);
                avgX += e2Pt.getX();
                avgY += e2Pt.getY();
                count++;
            }

            avgX /= count;
            avgY /= count;
            Vector2D gpVec = new Vector2D(n1Pt, new Point2D.Double(avgX, avgY));
            Point2D gpVecNorm = gpVec.getNormalized();
            gpVecNorm.setLocation(-1 * gpVecNorm.getX(), -1 * gpVecNorm.getY());
            grandParent = new Point2D.Double(n1Pt.getX() + 10
                    * gpVecNorm.getX(), n1Pt.getY() + 10 * gpVecNorm.getY());
           

        } else {
            //System.out.println("n2 is not null");
            grandParent = n1.getPrevControlPoint();
            //System.out.println("Prev Control Point for " +
            // ((FlowNode)n1.getEntity()).toStringId() + " has prev control
            // point: " + grandParent);
        }
        //System.out.println("grandparent: " + grandParent);

        // 2. the parent catmull-rom point is n1, since we want it to
        // go through this point
        parent = n1.getLocation();
       
        Point2D shiftPoint = null;
        // additive edge code
        // only shift edges if we are not at the root
        // relies on the fact that there only 2 edges per node
        if (m_additiveEdges && (n1.getRoutingParent() != null)) {

            n2 = n1.getRoutingParent(); //redundant, but who cares
           
            // get the other edge that starts from n1
            Edge otherEdgeItem = null;
            //System.out.println("n1.getOutEdges().size() " + n1.getOutEdges().size());
            for (Edge other: n1.getOutEdges()) {
                if ((otherEdgeItem = other) != edge) break;
            }
            assert(otherEdgeItem != null);
           
//          find the parent edge from n2 to n1
            Edge parentEdgeItem = null;
            for (Edge parent: n2.getOutEdges()) {
                parentEdgeItem = parent;
                if (parentEdgeItem.isIncident(n1) && (parentEdgeItem.isIncident(n2))) {
                    break;               
                }
            }
            assert(parentEdgeItem != null);
           
            Node item1;
            Node item2;
            // get vectors for both edges
            item1 = edge.getFirstNode();
            item2 = edge.getSecondNode();
            Vector2D thisEdgeVec = new Vector2D(item1.getLocation(), item2.getLocation());
           
            item1 = otherEdgeItem.getFirstNode();
            item2 = otherEdgeItem.getSecondNode();
            Vector2D otherEdgeVec = new Vector2D(item1.getLocation(), item2.getLocation());
           
            // now do the cross product of thisEdgeVec
           
//            do not use Vector3d but own implementation that gets rid of this dependency
//            Vector3d thisEdgeVector = new Vector3d(thisEdgeVec.getNormalized().getX(), -1*thisEdgeVec.getNormalized().getY(), 0);
//            Vector3d otherEdgeVector = new Vector3d(otherEdgeVec.getNormalized().getX(), -1*otherEdgeVec.getNormalized().getY(), 0);
//           
//            Vector3d result = new Vector3d();
//
//            result.cross(thisEdgeVector, otherEdgeVector);
            double[] cross = computeCrossProduct(thisEdgeVec.getNormalized().getX(), -1*thisEdgeVec.getNormalized().getY(),
                    otherEdgeVec.getNormalized().getX(), -1*otherEdgeVec.getNormalized().getY());
            //System.out.println("edges: " + parentEdgeItem + ", " + edgeItem + " , " + otherEdgeItem);
            //System.out.println(result);
           
            // compute the perpendicular vector, the direction to shift
            // we will get a vector that points to the right
            Vector2D grandToParent = new Vector2D(grandParent, parent);
            Point2D shiftDir = new Point2D.Double(-grandToParent.getNormalized().getY(),
                    -grandToParent.getNormalized().getX());
           
//            if (result.z < 0) {
            if (cross[2] < 0 ) {
            // if z > 0 then we know that thisEdge is to the right of otherEdge
            // so we push this in the direction of shiftDir

            // else we know that thisEdge is to the left of otherEdge
            // so we push this up, or in the negative direction of shiftDir
                shiftDir.setLocation(shiftDir.getX()*-1, shiftDir.getY()*-1);
            }
           
            double parentWidth = scale.getDisplayWidth(parentEdgeItem.getWeight());
            double otherWidth = scale.getDisplayWidth(otherEdgeItem.getWeight());
            parentWidth = Math.round(parentWidth);
            otherWidth = Math.round(otherWidth);
    /*
            System.out.println("edges: par: " + parentEdgeItem + ", edge:" + edgeItem + " , other:" + otherEdgeItem);
View Full Code Here

Examples of edu.uci.ics.jung.graph.Edge

    String serviceShortPID = serviceCompletePID.substring(startIndexForConverterName);
   
    /*
     * Build the actual edge & attach it to the graph.
     * */
    Edge edge = new DirectedSparseEdge(sourceNode, targetNode);
   
    edge.addUserDatum("converter_name", serviceShortPID,
        new UserDataContainer.CopyAction.Shared());
    edge.addUserDatum("service_pid", serviceCompletePID,
        new UserDataContainer.CopyAction.Shared());
   
    outputGraph.addEdge(edge);
  }
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.Edge

        // of the basic block, and mark each exception edge
        // with the set of exceptions which can be propagated
        // along the edge.

        int exceptionEdgeCount = 0;
        Edge lastExceptionEdge = null;

        for (Iterator<Edge> i = cfg.outgoingEdgeIterator(basicBlock); i.hasNext();) {
            Edge e = i.next();
            if (e.isExceptionEdge()) {
                exceptionEdgeCount++;
                lastExceptionEdge = e;
            }
        }

        if (exceptionEdgeCount == 0) {
            // System.out.println("Shouldn't all blocks have an exception edge");
            return;
        }
        // Compute exceptions that can be thrown by the
        // basic block.
        cachedExceptionSet = computeBlockExceptionSet(basicBlock, result);

        if (exceptionEdgeCount == 1) {
            cachedExceptionSet.setEdgeExceptionSet(lastExceptionEdge, cachedExceptionSet.getExceptionSet());
            return;
        }

        // For each outgoing exception edge, compute exceptions
        // that can be thrown. This assumes that the exception
        // edges are enumerated in decreasing order of priority.
        // In the process, this will remove exceptions from
        // the thrown exception set.
        ExceptionSet thrownExceptionSet = cachedExceptionSet.getExceptionSet();
        if (!thrownExceptionSet.isEmpty()) {
            thrownExceptionSet = thrownExceptionSet.duplicate();
        }
        for (Iterator<Edge> i = cfg.outgoingEdgeIterator(basicBlock); i.hasNext();) {
            Edge edge = i.next();
            if (edge.isExceptionEdge()) {
                cachedExceptionSet.setEdgeExceptionSet(edge, computeEdgeExceptionSet(edge, thrownExceptionSet));
            }
        }
    }
View Full Code Here

Examples of eu.stratosphere.example.java.graph.util.EnumTrianglesDataTypes.Edge

    public void reduce(Iterator<Edge> edges, Collector<EdgeWithDegrees> out) throws Exception {
     
      otherVertices.clear();
     
      // get first edge
      Edge edge = edges.next();
      Integer groupVertex = edge.getFirstVertex();
      this.otherVertices.add(edge.getSecondVertex());
     
      // get all other edges (assumes edges are sorted by second vertex)
      while(edges.hasNext()) {
        edge = edges.next();
        Integer otherVertex = edge.getSecondVertex();
        // collect unique vertices
        if(!otherVertices.contains(otherVertex) && otherVertex != groupVertex) {
          this.otherVertices.add(otherVertex);
        }
      }
View Full Code Here

Examples of graph.Edge

    Collection<Edge> eg = new ArrayList<Edge>();
    vr.add((VertexRoom) bob.getLocation());
    VertexRoom t, tve;
    Iterator<VertexRoom> it_v;
    Iterator<Edge> it_eg;
    Edge te;
   
    while (distance<distanceMax)
    {
      it_v = vr.iterator();
      while (it_v.hasNext())
      {
        t = it_v.next();
        vr_light.add(t);
       
        eg = t.getEdges();
        it_eg = eg.iterator();
        while (it_eg.hasNext())
        {
          te = it_eg.next();
          tve = (VertexRoom) te.getOtherVertex((Vertex) t);
          if (!vr_light.contains(tve))
            vr2.add(tve);
        }
       
        r = ((Square) t).getRow();
View Full Code Here

Examples of graph.model.Edge

        for(Edge edge : getNotVisitedEdgesByAnt(graph, startVertex, ant)) {
            sum += d(edge);
        }

        Edge edge = graph.getEdgeBetweenToVertices(startVertex, endVertex);

        return  d(edge) / sum;
    }
View Full Code Here

Examples of graphmatcher.graph.Edge

      break;
    }
    case EDGE_MATCHING: {
      System.out.println("Kantenmatching:");
      for (int i = 0; i < matching.length; i++) {
        Edge patternEdge = pattern.virtualEdges()[i];
        Edge templateEdge = null;
        if (matching[i] != -1) {
          templateEdge = template.virtualEdges()[matching[i]];
        }
        System.out.println(patternEdge + " -> " + templateEdge);
      }
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.