Package edu.uci.ics.jung.graph.util

Examples of edu.uci.ics.jung.graph.util.EdgeType


   */
  public Double transform(VEPair<V, E> ve_pair)
  {
    E e = ve_pair.getE();
    V v = ve_pair.getV();
    EdgeType edge_type = graph.getEdgeType(e);
    if (edge_type == EdgeType.UNDIRECTED)
      return 1.0 / graph.degree(v);
    if (edge_type == EdgeType.DIRECTED)
      return 1.0 / graph.outDegree(graph.getSource(e));
    throw new IllegalArgumentException("can't handle edge type: " + edge_type);
View Full Code Here


        e_string = "<edge ";
        // add ID if present
        if (id != null)
          e_string += "id=\"" + id + "\" ";
        // add edge type if doesn't match default
        EdgeType edge_type = g.getEdgeType(e);
        if (directed && edge_type == EdgeType.UNDIRECTED)
          e_string += "directed=\"false\" ";
        if (!directed && edge_type == EdgeType.DIRECTED)
          e_string += "directed=\"true\" ";
        e_string += "source=\"" + vertex_ids.transform(v1) +
View Full Code Here

        if (! c_pred.evaluate(curLine))
            nextLine = skip(br, c_pred);

        boolean reading_arcs = false;
        boolean reading_edges = false;
        EdgeType directedness = null;
        if (a_pred.evaluate(nextLine))
        {
            if (g instanceof UndirectedGraph) {
                throw new IllegalArgumentException("Supplied undirected-only graph cannot be populated with directed edges");
            } else {
View Full Code Here

        if (target == null)
            throw new SAXNotSupportedException("specified 'target' attribute " +
                "\"" + target_id + "\" does not match any node ID");

        String directed = edge_atts.remove("directed");
        EdgeType edge_type;
        if (directed == null)
            edge_type = default_edgetype;
        else if (directed.equals("true"))
            edge_type = EdgeType.DIRECTED;
        else if (directed.equals("false"))
View Full Code Here

            assert(v != null);
            stringer.key(elements[idx++].name()).value(v.getElementId());
        } // FOR
       
        // Only store the first character of the edge type (U, D)
        EdgeType edge_type = this.graph.getEdgeType(this);
        stringer.key(Members.TYPE.name()).value(edge_type.name().subSequence(0, 1));
    }
View Full Code Here

        AbstractVertex v1 = this.graph.getVertex(v1_elementId);
        assert(v1 != null) : "Invalid vertex element id '" + v1_elementId + "' (1)";
       
        // Edge Type
        String edge_type_key = object.getString(Members.TYPE.name());
        EdgeType edge_type = null;
        for (EdgeType e : EdgeType.values()) {
            if (e.name().startsWith(edge_type_key)) {
                edge_type = e;
                break;
            }
View Full Code Here

        // user | file | file2 | user2 | weigth
        out.printLog("Iniciado calculo da métrica de matriz com " + getMatrix().getNodes().size() + " nodes. Parametros: " + params);
        AbstractTypedGraph<String, String> graphMulti;

        EdgeType type;
        out.printLog("Iniciando preenchimento do grapho.");
        if (getMatrix().getClassServicesName().equals(UserCommentedSamePairOfFileInDateServices.class.getName()) || getMatrix().getClassServicesName().equals(UserCommentedSamePairOfFileInAllDateServices.class.getName())) {
            graphMulti = new DirectedSparseMultigraph<>();
            type = EdgeType.DIRECTED;
        } else {
View Full Code Here

TOP

Related Classes of edu.uci.ics.jung.graph.util.EdgeType

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.