Package edu.uci.ics.jung.graph.impl

Examples of edu.uci.ics.jung.graph.impl.DirectedSparseGraph


      LogService logger) {
   
    this.nodeCount = 0;
    this.logger = logger;
    this.allConverterServices = allConverterServices;
    this.outputGraph = new DirectedSparseGraph();
   
    /*
     * Side affects nodes & edges
     * */
    processServiceReferences();
 
View Full Code Here


   */
  public DataConversionServiceImpl(BundleContext bContext, CIShellContext ciContext) {
    this.bContext = bContext;
    this.ciContext = ciContext;

    this.graph = new DirectedSparseGraph();
    this.dataTypeToVertex = new HashMap<String,Vertex>();

    String filter = "(&("+ALGORITHM_TYPE+"="+TYPE_CONVERTER+")" +
        "("+IN_DATA+"=*) " +
        "("+OUT_DATA+"=*)" +
View Full Code Here

       
        _graphType = type;
       
        _rndDecorator = new RandomVertexLocationDecorator(new Dimension(1000,1000));
        if (_graphType == GraphTypes.Directed) {
            _myGraph = new DirectedSparseGraph();
        } else if (_graphType == GraphTypes.UnDirected){
            _myGraph = new UndirectedSparseGraph();
        } else {
            throw new GraphException("Error in GraphManager, the specified graph type is not either Directed or UnDirected");
        }
View Full Code Here

    return v.containsUserDatumKey(JUConstants.INITIAL);   
  }

  /** Creates a graph with a single accept-vertex. */
  public static DirectedSparseGraph initialise(){
    DirectedSparseGraph pta = new DirectedSparseGraph();
    DirectedSparseVertex init = new DirectedSparseVertex();
    init.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
    init.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);
    pta.setUserDatum(JUConstants.TITLE, "Hypothesis machine", UserData.SHARED);
    pta.addVertex(init);
    DeterministicDirectedSparseGraph.numberVertices(pta);
    return pta;
  }
View Full Code Here

   * This one only copies vertices which participate in transitions.
   */
  @SuppressWarnings("unchecked")
  public static DirectedSparseGraph copy(Graph g)
  {
    DirectedSparseGraph result = new DirectedSparseGraph();
    Map<VertexID,DeterministicVertex> newVertices = new TreeMap<VertexID,DeterministicVertex>();
    for(DirectedSparseEdge e:(Set<DirectedSparseEdge>)g.getEdges())
    {
      DeterministicVertex newSrc = DeterministicDirectedSparseGraph.copyVertex(newVertices,result,e.getSource()),
        newDst = DeterministicDirectedSparseGraph.copyVertex(newVertices, result, e.getDest());
      DirectedSparseEdge newEdge = new DirectedSparseEdge(newSrc,newDst);
      newEdge.addUserDatum(JUConstants.LABEL, ((HashSet<String>)e.getUserDatum(JUConstants.LABEL)).clone(), UserData.SHARED);
      result.addEdge(newEdge);
    }
    return result;
  }
View Full Code Here

    return v.containsUserDatumKey(JUConstants.INITIAL);   
  }

  /** Creates a graph with a single accept-vertex. */
  public static DirectedSparseGraph initialise(){
    DirectedSparseGraph pta = new DirectedSparseGraph();
    DirectedSparseVertex init = new DirectedSparseVertex();
    init.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
    init.addUserDatum(JUConstants.ACCEPTED, true, UserData.SHARED);
    pta.setUserDatum(JUConstants.TITLE, "Hypothesis machine", UserData.SHARED);
    pta.addVertex(init);
    DeterministicDirectedSparseGraph.numberVertices(pta);
    return pta;
  }
View Full Code Here

   * This one only copies vertices which participate in transitions.
   */
  @SuppressWarnings("unchecked")
  public static DirectedSparseGraph copy(Graph g)
  {
    DirectedSparseGraph result = new DirectedSparseGraph();
    Map<VertexID,DeterministicVertex> newVertices = new TreeMap<VertexID,DeterministicVertex>();
    for(DirectedSparseEdge e:(Set<DirectedSparseEdge>)g.getEdges())
    {
      DeterministicVertex newSrc = DeterministicDirectedSparseGraph.copyVertex(newVertices,result,e.getSource()),
        newDst = DeterministicDirectedSparseGraph.copyVertex(newVertices, result, e.getDest());
      DirectedSparseEdge newEdge = new DirectedSparseEdge(newSrc,newDst);
      newEdge.addUserDatum(JUConstants.LABEL, ((HashSet<String>)e.getUserDatum(JUConstants.LABEL)).clone(), UserData.SHARED);
      result.addEdge(newEdge);
    }
    return result;
  }
View Full Code Here

  /**
   * @param hypothesis followed by actual graph
   */
  public static void main(String[] args) {
    DirectedSparseGraph specGraph = FsmParser.buildGraph("q0-initialise->q1-connect->q2-login->q3-setfiletype->q4-rename->q6-storefile->q5-setfiletype->q4-storefile->q7-appendfile->q5-setfiletype->q4\nq3-makedir->q8-makedir->q8-logout->q16-disconnect->q17\nq3-changedir->q9-listnames->q10-delete->q10-changedir->q9\nq10-appendfile->q11-logout->q16\nq3-storefile->q11\nq3-listfiles->q13-retrievefile->q13-logout->q16\nq13-changedir->q14-listfiles->q13\nq7-logout->q16\nq6-logout->q16", "specgraph");
    DirectedSparseGraph impGraph = FsmParser.buildGraph("q0-initialise->q1-connect->q2-login->q3-storefile->q9-logout->q12-disconnect->q13\nq3-makedir->q8-makedir->q8-logout->q12\nq3-setfiletype->q4-storefile->q5-appendfile->q6-setfiletype->q4-rename->q7-storefile->q6\nq7-logout->q12\nq3-listfiles->q11-retrievefile->q11-changedirectory->q10-listfiles->q11-logout->q12\nq3-changedirectory->q17-listnames->q16-changedirectory->q17\nq16-delete->q14-delete->q15-delete->q16\nq14-changedirectory->q13\nq14-appendfile->q7", "impGraph");
    compare(specGraph, impGraph);
  }
View Full Code Here

    DirectedSparseGraph impGraph = FsmParser.buildGraph("q0-initialise->q1-connect->q2-login->q3-storefile->q9-logout->q12-disconnect->q13\nq3-makedir->q8-makedir->q8-logout->q12\nq3-setfiletype->q4-storefile->q5-appendfile->q6-setfiletype->q4-rename->q7-storefile->q6\nq7-logout->q12\nq3-listfiles->q11-retrievefile->q11-changedirectory->q10-listfiles->q11-logout->q12\nq3-changedirectory->q17-listnames->q16-changedirectory->q17\nq16-delete->q14-delete->q15-delete->q16\nq14-changedirectory->q13\nq14-appendfile->q7", "impGraph");
    compare(specGraph, impGraph);
  }
 
  public static void compare(String spec, DirectedSparseGraph imp){
    DirectedSparseGraph specGraph = FsmParser.buildGraph(spec, "specGraph");
    compare(specGraph, imp);
  }
View Full Code Here

    GD<List<CmpVertex>,List<CmpVertex>,LearnerGraphNDCachedData,LearnerGraphNDCachedData> gd =
      new GD<List<CmpVertex>,List<CmpVertex>,LearnerGraphNDCachedData,LearnerGraphNDCachedData>();
    Configuration config = Configuration.getDefaultConfiguration();
    LearnerGraphND grA=new LearnerGraphND(buildGraph(graphA, "labellingDemo_A_"+counter),config),grB=
    new LearnerGraphND(buildGraph(graphB, "labellingDemo_B_"+counter),config);
    DirectedSparseGraph gr = gd.showGD(
        grA,grB,
        ExperimentRunner.getCpuNumber());
    if (display)
    {
    Visualiser.updateFrame(grA, grB);
View Full Code Here

TOP

Related Classes of edu.uci.ics.jung.graph.impl.DirectedSparseGraph

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.