Package edu.uci.ics.jung.io

Examples of edu.uci.ics.jung.io.GraphMLFile


  {
    StringWriter writer = new StringWriter();gr.transform.writeGraphML(writer);
    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


  {
    LearnerGraph gr = new LearnerGraph(TestFSMAlgo.buildGraph(TestRpniLearner.largeGraph1_invalid5, "testMerge_fail1"),Configuration.getDefaultConfiguration());
    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());
        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

  {
    LearnerGraph gr = new LearnerGraph(TestFSMAlgo.buildGraph(TestRpniLearner.largeGraph1_invalid5, "testMerge_fail1"),Configuration.getDefaultConfiguration());
    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());
       
        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

  {
    LearnerGraph gr = new LearnerGraph(TestFSMAlgo.buildGraph(TestRpniLearner.largeGraph1_invalid5, "testMerge_fail1"),Configuration.getDefaultConfiguration());
    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

    if (graphs.getLength() > 1)
      throw new IllegalArgumentException("duplicate graph element");
    Element graphElement = (Element)graphs.item(0);

    DOMExperimentGraphMLHandler graphHandler = new DOMExperimentGraphMLHandler();
      GraphMLFile graphmlFile = new GraphMLFile();
      graphmlFile.setGraphMLFileHandler(graphHandler);
      synchronized(AbstractLearnerGraph.syncObj)
      {// multi-core execution understandably fails if I forget to sync on that object
        try
        {
          graphHandler.startElement(graphElement.getNamespaceURI(), graphElement.getLocalName(), graphElement.getNodeName(), Attributes_DOM_to_SAX(graphElement.getAttributes())); // so as to applease the lack of any clue Jung has about graphml namespaces
View Full Code Here

    AbstractLearnerGraph<TARGET_TYPE,CACHE_TYPE> loadGraph(Reader from,
        AbstractLearnerGraph<TARGET_TYPE,CACHE_TYPE> result)
  {
    synchronized (AbstractLearnerGraph.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());
        try
        {
          loadGraph(LearnerSimulator.getDocumentOfXML(from).getDocumentElement(), result);
        }
        finally
View Full Code Here

    AbstractLearnerGraph<TARGET_TYPE,CACHE_TYPE> loadGraph(String fileName,
        AbstractLearnerGraph<TARGET_TYPE,CACHE_TYPE> result) throws IOException
  {
    synchronized (AbstractLearnerGraph.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());
        String fileToLoad = fileName;
        if (!new java.io.File(fileToLoad).canRead()) fileToLoad+=".xml";
        loadGraph(new FileReader(fileToLoad),result);result.setName(fileName);
        return result;
    }
View Full Code Here

    if (graphs.getLength() > 1)
      throw new IllegalArgumentException("duplicate graph element");
    Element graphElement = (Element)graphs.item(0);

    DOMExperimentGraphMLHandler<TARGET_TYPE,CACHE_TYPE> graphHandler = new DOMExperimentGraphMLHandler<TARGET_TYPE,CACHE_TYPE>(result.config);
      GraphMLFile graphmlFile = new GraphMLFile();
      graphmlFile.setGraphMLFileHandler(graphHandler);
      synchronized(AbstractLearnerGraph.syncObj)
      {// multi-core execution understandably fails if I forget to sync on that object
        try
        {
          graphHandler.startElement(graphElement.getNamespaceURI(), graphElement.getLocalName(), graphElement.getNodeName(), Attributes_DOM_to_SAX(graphElement.getAttributes())); // so as to applease the lack of any clue Jung has about graphml namespaces
View Full Code Here

    AbstractLearnerGraph<TARGET_TYPE,CACHE_TYPE> loadGraph(Reader from,
        AbstractLearnerGraph<TARGET_TYPE,CACHE_TYPE> result)
  {
    synchronized (AbstractLearnerGraph.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<TARGET_TYPE,CACHE_TYPE>(result.config));
        try
        {
          loadGraph(LearnerSimulator.getDocumentOfXML(from).getDocumentElement(), result);
        }
        finally
View Full Code Here

    AbstractLearnerGraph<TARGET_TYPE,CACHE_TYPE> loadGraph(String fileName,
        AbstractLearnerGraph<TARGET_TYPE,CACHE_TYPE> result) throws IOException
  {
    synchronized (AbstractLearnerGraph.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<TARGET_TYPE,CACHE_TYPE>(result.config));
        String fileToLoad = fileName;
        if (!new java.io.File(fileToLoad).canRead()) fileToLoad+=".xml";
        FileReader is = null;
        try
        {
View Full Code Here

TOP

Related Classes of edu.uci.ics.jung.io.GraphMLFile

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.