Examples of Vertex


Examples of org.worldbank.transport.tamt.shared.Vertex

   
    int vertexCount = vertices.size();
    //TODO: handle null vertices
    Coordinate[] coords = new Coordinate[vertexCount];
    for (int i = 0; i < vertexCount; i++) {
      Vertex v = vertices.get(i);
      Coordinate c = new Coordinate(v.getLng(), v.getLat());
      coords[i] = c;
    }
   
    // now create a line string from the coordinates array where null = no holes in the polygon
    LinearRing ring = new GeometryFactory().createLinearRing(coords);
View Full Code Here

Examples of perestrojka.common.Vertex

   
    // get the start- and endvertices from the graph. We could run into problems if
    // formats with the same extension exists that have different lossy/lossless
    // settings. Since I don't know such a format we simply take the first matching
    // vertex.
    Vertex startVertex = null;
    for (Edge edge : edges) {
      if (edge.getSourceVertex().getFormat().equalsIgnoreCase(sourceFormat)) {
        startVertex = edge.getSourceVertex();
        break;
      }
    }
    if (startVertex == null) {
      return null;
    }
   
    Vertex targetVertex = null;
    for (Edge edge : edges) {
      if (edge.getTargetVertex().getFormat().equalsIgnoreCase(targetFormat)) {
        targetVertex = edge.getTargetVertex();
        break;
      }
    }
    if (targetVertex == null) {
      return null;
    }
   
    runDijkstra(startVertex);
    ret = new ArrayList<ConversionStep>();
    Vertex predecessor = null;

    Vertex activeVertex = targetVertex;
    while ((predecessor = activeVertex.getPredecessor()) != null) {
      Edge edge = findEdge(predecessor, activeVertex);
      ret.add(0, new ConversionStep(activeVertex.getFormat(), edge.getConversionExtension()));
      activeVertex = predecessor;
    }
   
    // add to cache
    cache.add(sourceFormat, targetFormat, ret);
View Full Code Here

Examples of ptolemy.moml.Vertex

         *   a relation.
         *  @return An iterator of Link objects, all of which have their
         *   head as the given node.
         */
        public Iterator inEdges(Object node) {
            Vertex vertex = (Vertex) node;

            // Go through all the links, creating a list of
            // those we are connected to.
            List vertexLinkList = new LinkedList();
            Iterator links = _linkSet.iterator();
View Full Code Here

Examples of starlight.taliis.core.binary.m2.geometry.Vertex

   
    keybonelookup=new short[1];
    keybonelookup[0]=-1;
   
    vertex=new Vertex[1];
    vertex[0]=new Vertex();

    transparency=new AnimationBlock[1];
    transparency[0]=new AnimationBlock();
   
    texdefs=new TexDef[1];
View Full Code Here

Examples of upenn.junto.graph.Vertex

      Reducer<Text, Text, Text, Text> {
    public void reduce(Text key, Iterator<Text> values,
        OutputCollector<Text, Text> output, Reporter reporter)
        throws IOException {
      String vertexId = key.toString();
      Vertex v = new Vertex(vertexId);

      while (values.hasNext()) {
        // neighbor/self edge_weight/inject_score
        String val = values.next().toString();
        String[] fields = val.split(_kDelim);
        String msgType = fields[0];
        String trgVertexId = fields[1];

        if (msgType.equals(neighMsgType)) {
          v.setNeighbor(trgVertexId, Double.parseDouble(fields[2]));
        } else if (msgType.equals(goldLabMsgType)) {
          v.setGoldLabel(trgVertexId, Double.parseDouble(fields[2]));
        } else if (msgType.equals(injLabMsgType)) {
          v.SetInjectedLabelScore(trgVertexId,
              Double.parseDouble(fields[2]));
        }
      }
     
      // normalize transition probabilities
      v.NormalizeTransitionProbability();

      // remove dummy labels
      v.SetInjectedLabelScore(Constants.GetDummyLabel(), 0);
      v.SetEstimatedLabelScore(Constants.GetDummyLabel(), 0);

      // calculate random walk probabilities
      v.CalculateRWProbabilities(_kBeta);

      // generate the random walk probability string of the node
      String rwProbStr = Constants._kInjProb + " "
          + v.pinject() + " " + Constants._kContProb
          + " " + v.pcontinue() + " "
          + Constants._kTermProb + " "
          + v.pabandon();

      // represent neighborhood information as a string
      Object[] neighNames = v.GetNeighborNames();
      String neighStr = "";
      int totalNeighbors = neighNames.length;
      for (int ni = 0; ni < totalNeighbors; ++ni) {
        // if the neighborhood string is already too long, then
        // print it out. It is possible to split the neighborhood
        // information of a node into multiple lines. However, all
        // other fields should be repeated in all the split lines.
        if (neighStr.length() > 0 && (ni % kMaxNeighorsPerLine_ == 0)) {
          // output format
          // id gold_label injected_labels estimated_labels neighbors
          // rw_probabilities
          output.collect(
              key,
              new Text(
                  CollectionUtil.Map2String(v.goldLabels())
                      + _kDelim
                      + CollectionUtil.Map2String(v
                          .injectedLabels())
                      + _kDelim
                      + CollectionUtil.Map2String(v
                          .estimatedLabels())
                      + _kDelim + neighStr.trim()
                      + _kDelim + rwProbStr));

          // reset the neighborhood string
          neighStr = "";
        }

        neighStr += neighNames[ni] + " "
            + v.GetNeighborWeight((String) neighNames[ni]) + " ";
      }

      // print out any remaining neighborhood information, plus all other
      // info
      if (neighStr.length() > 0) {
        // output format
        // id gold_label injected_labels estimated_labels neighbors
        // rw_probabilities
        output.collect(
            key,
            new Text(CollectionUtil.Map2String(v.goldLabels())
                + _kDelim
                + CollectionUtil.Map2String(v
                    .injectedLabels())
                + _kDelim
                + CollectionUtil.Map2String(v
                    .estimatedLabels()) + _kDelim
                + neighStr.trim() + _kDelim + rwProbStr));
      }
    }
View Full Code Here

Examples of vg.core.graph.Vertex

  }
  public int getStorableId() {
    return(this.storableId);
  }
  public synchronized Vertex getVertex() {
    Vertex v = new Vertex(this.id);
    for(StorableAttribute bufAttribte : this.attributes) {
      v.addAttribute(bufAttribte.getName(), bufAttribte.getValue());       
    }
    v.setInnerGraph(this.innerGraphId);
    return(v);
  }
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.