Examples of GraphMLFile


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

    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

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

    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

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

    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

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

  public static void main(String[] args){
    File graphDir = new File(args[0]);//new File(System.getProperty("user.dir")+System.getProperty("file.separator")+"resources"+
    //System.getProperty("file.separator")+"TestGraphs"+System.getProperty("file.separator") +args[0]);
    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

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

  public static void main(String[] args){
    File graphDir = new File(args[0]);//new File(System.getProperty("user.dir")+System.getProperty("file.separator")+"resources"+
    //System.getProperty("file.separator")+"TestGraphs"+System.getProperty("file.separator") +args[0]);
    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,null);
  }
View Full Code Here

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

    protected void loadGraph()
    {
      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 = new DirectedSparseGraph();
          graph.getEdgeConstraints().clear();
          graph = (DirectedSparseGraph)graphmlFile.load(inputFileName);
          if (renumberSeed>=0)
          {
            int []data=DeterministicDirectedSparseGraph.getNonRepeatingNumbers(graph.getVertices().size(),
                renumberSeed);
            int cnt=0;
View Full Code Here

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

    protected void loadGraph()
    {
      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 = new DirectedSparseGraph();
          graph.getEdgeConstraints().clear();
          graph = (DirectedSparseGraph)graphmlFile.load(inputFileName);
      }
    }
View Full Code Here

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

    protected void loadGraph()
    {
      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 = new DirectedSparseGraph();
          graph.getEdgeConstraints().clear();
          graph = (DirectedSparseGraph)graphmlFile.load(inputFileName);
      }
    }
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.