Package edu.uci.ics.jung.io

Examples of edu.uci.ics.jung.io.GraphMLFile.load()


  {
    synchronized (LearnerGraph.syncObj)
    {// ensure that the calls to Jung's vertex-creation routines do not occur on different threads.
        GraphMLFile graphmlFile = new GraphMLFile();
        graphmlFile.setGraphMLFileHandler(new ExperimentGraphMLHandler());
        LearnerGraph graph = new LearnerGraph(graphmlFile.load(fileName+".xml"),config);
        int acceptNumber = graph.getAcceptStateNumber();
        int rejectNumber = graph.getStateNumber()-acceptNumber;
        graph.vertPositiveID=acceptNumber;
        graph.vertNegativeID=1+rejectNumber;
        return graph;
View Full Code Here


      synchronized (LearnerGraph.syncObj)
      {// ensure that the calls to Jung's vertex-creation routines do not occur on different threads.
          GraphMLFile graphmlFile = new GraphMLFile();
          graphmlFile.setGraphMLFileHandler(new ExperimentGraphMLHandler());
          Configuration cnf = (Configuration)config.clone();cnf.setLearnerCloneGraph(true);cnf.setLearnerUseStrings(true);
          graph = new LearnerGraph(graphmlFile.load(inputFileName),cnf);
      }
    }

    enum OUTCOME { SUCCESS, FAILURE };
   
View Full Code Here

    StringWriter writer = new StringWriter();gr.transform322.writeGraphML(writer);
    synchronized (computeStateScores.syncObj)
    {// ensure that the calls to Jung's vertex-creation routines do not occur on different threads.
        GraphMLFile graphmlFile = new GraphMLFile();
        graphmlFile.setGraphMLFileHandler(new ExperimentGraphMLHandler());
        Graph brokenGraph=graphmlFile.load(new StringReader(writer.toString().replace("VERTEX=\"BB1\"", "VERTEX=\""+Transform322.Initial+" BB1\"")));
        try
        {
          new FSMStructure(brokenGraph,Configuration.getDefaultConfiguration());
        }
        catch(IllegalArgumentException ex)
View Full Code Here

    String wholePath = graphDir.getAbsolutePath()+System.getProperty("file.separator");
    GraphMLFile graphmlFile = new GraphMLFile();
    graphmlFile.setGraphMLFileHandler(new ExperimentGraphMLHandler());
    DirectedSparseGraph dg = new DirectedSparseGraph();
    dg.getEdgeConstraints().clear();
    dg = (DirectedSparseGraph)graphmlFile.load(wholePath+args[1]);
    GraphMLVisualiser gmlVis = new GraphMLVisualiser();
    gmlVis.construct(dg);
  }

}
View Full Code Here

    {// ensure that the calls to Jung's vertex-creation routines do not occur on different threads.
        GraphMLFile graphmlFile = new GraphMLFile();
        graphmlFile.setGraphMLFileHandler(new ExperimentGraphMLHandler());
        graph = new DirectedSparseGraph();
        graph.getEdgeConstraints().clear();
        graph = (DirectedSparseGraph)graphmlFile.load(fileName);
    }
    return graph;
  }
 
  public static void dumpQuestionsFrom(String A,String B)
View Full Code Here

    LearnerGraph loaded = null;
    synchronized (LearnerGraph.syncObj)
    {// ensure that the calls to Jung's vertex-creation routines do not occur on different threads.
        GraphMLFile graphmlFile = new GraphMLFile();
        graphmlFile.setGraphMLFileHandler(new ExperimentGraphMLHandler());
        loaded = new LearnerGraph(graphmlFile.load(new StringReader(writer.toString())),Configuration.getDefaultConfiguration());
    }   

    Assert.assertTrue(!gr.wmethod.checkUnreachableStates());Assert.assertTrue(!loaded.wmethod.checkUnreachableStates());
    WMethod.checkM(loaded, gr);
    for(Entry<CmpVertex,LinkedList<String>> entry:gr.wmethod.computeShortPathsToAllStates().entrySet())
View Full Code Here

    {// ensure that the calls to Jung's vertex-creation routines do not occur on different threads.
        GraphMLFile graphmlFile = new GraphMLFile();
        graphmlFile.setGraphMLFileHandler(new ExperimentGraphMLHandler());
        try
        {
          new LearnerGraph(graphmlFile.load(new StringReader(writer.toString().replace("accepted=\"false\"", "accepted=\"aa\""))),Configuration.getDefaultConfiguration());
        }
        catch(FatalException ex)
        {
          Assert.assertTrue(ex.getCause() instanceof IllegalUserDataException);
        }
View Full Code Here

        GraphMLFile graphmlFile = new GraphMLFile();
        graphmlFile.setGraphMLFileHandler(new ExperimentGraphMLHandler());
       
        try
        {
          new LearnerGraph(graphmlFile.load(new StringReader(writer.toString().replace("colour=\"red\"", "colour=\"aa\""))),Configuration.getDefaultConfiguration());
        }
        catch(FatalException ex)
        {
          Assert.assertTrue(ex.getCause() instanceof IllegalUserDataException);
        }
View Full Code Here

    StringWriter writer = new StringWriter();gr.transform.writeGraphML(writer);
    synchronized (LearnerGraph.syncObj)
    {// ensure that the calls to Jung's vertex-creation routines do not occur on different threads.
        GraphMLFile graphmlFile = new GraphMLFile();
        graphmlFile.setGraphMLFileHandler(new ExperimentGraphMLHandler());
        Graph g=graphmlFile.load(new StringReader(writer.toString().replace("BB1", Transform.Initial+"_BB1")));
        try
        {
          new LearnerGraph(g,Configuration.getDefaultConfiguration());
        }
        catch(IllegalArgumentException ex)
View Full Code Here

    String wholePath = graphDir.getAbsolutePath()+System.getProperty("file.separator");
    GraphMLFile graphmlFile = new GraphMLFile();
    graphmlFile.setGraphMLFileHandler(new ExperimentGraphMLHandler());
    DirectedSparseGraph dg = new DirectedSparseGraph();
    dg.getEdgeConstraints().clear();
    dg = (DirectedSparseGraph)graphmlFile.load(wholePath+args[1]);
    GraphMLVisualiser gmlVis = new GraphMLVisualiser();
    gmlVis.construct(dg);
  }

}
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.