Examples of Vertex


Examples of com.tinkerpop.gremlin.structure.Vertex

                                      final SerializerProvider serializerProvider, final TypeSerializer typeSerializer) throws IOException {
            ser(directionalVertex, jsonGenerator);
        }

        public void ser(final GraphSONVertex directionalVertex, final JsonGenerator jsonGenerator) throws IOException {
            final Vertex vertex = directionalVertex.getVertexToSerialize();
            final Map<String, Object> m = new HashMap<>();
            m.put(GraphSONTokens.ID, vertex.id());
            m.put(GraphSONTokens.LABEL, vertex.label());
            m.put(GraphSONTokens.TYPE, GraphSONTokens.VERTEX);

            final Object properties = StreamFactory.stream(vertex.iterators().propertyIterator())
                    .collect(Collectors.groupingBy(vp -> vp.key()));
            final Object hiddens = StreamFactory.stream(vertex.iterators().hiddenPropertyIterator())
                    .collect(Collectors.groupingBy(vp -> vp.key()));
            m.put(GraphSONTokens.PROPERTIES, properties);
            m.put(GraphSONTokens.HIDDENS, hiddens);

            if (directionalVertex.getDirection() == Direction.BOTH || directionalVertex.getDirection() == Direction.OUT) {
                m.put(GraphSONTokens.OUT_E, StreamFactory.stream(vertex.iterators().edgeIterator(Direction.OUT)).collect(Collectors.toList()));
            }

            if (directionalVertex.getDirection() == Direction.BOTH || directionalVertex.getDirection() == Direction.IN) {
                m.put(GraphSONTokens.IN_E, StreamFactory.stream(vertex.iterators().edgeIterator(Direction.IN)).collect(Collectors.toList()));
            }

            jsonGenerator.writeObject(m);
        }
View Full Code Here

Examples of com.vividsolutions.jts.triangulate.quadedge.Vertex

   *
   * @throws LocateFailureException if the location algorithm fails to converge in a reasonable number of iterations
   */
  public void insertSites(Collection vertices) {
    for (Iterator i = vertices.iterator(); i.hasNext();) {
      Vertex v = (Vertex) i.next();
      insertSite(v);
    }
  }
View Full Code Here

Examples of com.vividsolutions.jts.triangulate.quadedge.Vertex

public class ConformingDelaunayTriangulator
{
  private static Envelope computeVertexEnvelope(Collection vertices) {
    Envelope env = new Envelope();
    for (Iterator i = vertices.iterator(); i.hasNext();) {
      Vertex v = (Vertex) i.next();
      env.expandToInclude(v.getCoordinate());
    }
    return env;
  }
View Full Code Here

Examples of com.vividsolutions.jts.triangulate.quadedge.Vertex

  private Coordinate[] getPointArray() {
    Coordinate[] pts = new Coordinate[initialVertices.size()
        + segVertices.size()];
    int index = 0;
    for (Iterator i = initialVertices.iterator(); i.hasNext();) {
      Vertex v = (Vertex) i.next();
      pts[index++] = v.getCoordinate();
    }
    for (Iterator i2 = segVertices.iterator(); i2.hasNext();) {
      Vertex v = (Vertex) i2.next();
      pts[index++] = v.getCoordinate();
    }
    return pts;
  }
View Full Code Here

Examples of crazypants.vecmath.Vertex

    double d13 = par4 + this.renderMaxY;
    double d14 = par6 + this.renderMinZ;
    double d15 = par6 + this.renderMaxZ;

    List<Vertex> result = new ArrayList<Vertex>(4);
    Vertex v;
    if(enableAO) {
      result.add(new Vertex(d11, d13, d15, d7, d9, brightnessTopLeft, colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft, 1));
      result.add(new Vertex(d11, d13, d14, d3, d5, brightnessBottomLeft, colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft, 1));
      result.add(new Vertex(d11, d12, d14, d8, d10, brightnessBottomRight, colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight, 1));
      result.add(new Vertex(d11, d12, d15, d4, d6, brightnessTopRight, colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight, 1));
    } else {
      result.add(new Vertex(d11, d13, d15, d7, d9));
      result.add(new Vertex(d11, d13, d14, d3, d5));
      result.add(new Vertex(d11, d12, d14, d8, d10));
      result.add(new Vertex(d11, d12, d15, d4, d6));
    }
    return result;
  }
View Full Code Here

Examples of de.hpi.bpt.hypergraph.abs.Vertex

    Map<String, Vertex> idToVertex = new HashMap<String, Vertex>();
   
    DirectedGraph g = new DirectedGraph();
   
    for(String key:idMap.keySet()){
      Vertex s = new Vertex(key);
      g.addVertex(s);
      idToVertex.put(key, s);
    }
     
   
View Full Code Here

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

   
    for (int converterCount = 0;
        converterCount < allConverterServices.length;
        converterCount++) {

      Vertex sourceNode, targetNode;

      ServiceReference currentConverterServiceReference =
        allConverterServices[converterCount];

      String sourceNodeKey =
View Full Code Here

Examples of graph.model.Vertex

        return notVisitedEdges;
    }

    public void sendAnt(Graph graph, Ant ant) {
        Vertex startingVertex = graph.getRandomVertex();
        int numberOfVertices = graph.getVertices().size();
        List<Vertex> visitedVertex = null;
        int size = 0;

        while (size + 1 < numberOfVertices) {
            Vertex chosenVertex = chosePath(startingVertex, graph, ant);
            ant.addVisitedVertex(startingVertex);
            ant.addToTour(graph.getEdgeBetweenToVertices(startingVertex, chosenVertex).getWeight());
            ant.addEdge(graph.getEdgeBetweenToVertices(startingVertex, chosenVertex));
            startingVertex = chosenVertex;
View Full Code Here

Examples of graphmatcher.graph.Vertex

  protected int[] getMatching() {
    int[] matching = new int[pattern.getNumberOfVertices()];
    Point patternCenter = pattern.getCenter();
    Point templateCenter = template.getCenter();
    for (int i = 0; i < pattern.getNumberOfVertices(); i++) {
      Vertex patternVertex = pattern.vertices()[i];
      Point patternVertexPoint = new Point(patternVertex.x - patternCenter.x, patternVertex.y
          - patternCenter.y);
      int bestTemplateVertexID = -1;
      double minDist = Double.MAX_VALUE;
      for (int j = 0; j < template.getNumberOfVertices(); j++) {
        Vertex templateVertex = template.vertices()[j];
        Point templateVertexPoint = new Point(templateVertex.x - templateCenter.x, templateVertex.y
            - templateCenter.y);
        double dist = DistanceHelper.getDistance(patternVertexPoint, templateVertexPoint);
        if (dist < minDist) {
          minDist = dist;
View Full Code Here

Examples of instantbach.data.graph.Vertex

        //add the dominant as the second to last
        identifiers.add("7V");

        //get the current vertex (for the cadence)
        Vertex currentVertex = graph.getVertex("7V");

        for (int i = 0; i < 9; i++) {

            //get the adjacent edges to the current vertex
            LinkedList<Edge> currentEdges = currentVertex.getAdjacent();
            int numToChoose = currentEdges.size();

            int randomNumber = (int) (Math.random() * numToChoose + 0);

            //get a random edge
            Edge randomEdge = currentEdges.get(randomNumber);

            //get the destination of the random edge
            currentVertex = randomEdge.getDestination();

            String identifier = currentVertex.getName();
            identifiers.add(identifier);
            //returnVector.add(current.name);
        }

        //create a progression using the given identifiers
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.