Package translator

Examples of translator.DOTWriter


            FileWriter fstream = new FileWriter(dotoutpath);
            BufferedWriter out = new BufferedWriter(fstream);
     
     

            out.write(new DOTWriter().getDOT(results.getClustering(),results.getProgram()));
            out.close();
        }
        if (fitnessoutpath != null) {
            if (!fitnessoutpath.exists()) {
                fitnessoutpath.getParentFile().mkdirs();
View Full Code Here


    }

    public Graph doKTails() {
        boolean go = true;
        int iter = 0;
        DOTWriter writer = new DOTWriter();
        int startSize = nodes.size();
        long startTime = System.currentTimeMillis();

        g = getGraph();
        dump(String.format("iter%d.dot", iter), writer.getRepresentation(g));

        long start = System.currentTimeMillis();
        int oldSize = nodes.size();
        while (go) {

            iter++;
            go = doStep();
            pruneNodes();



            double time = (System.currentTimeMillis() - start) / 1000;
            if (time > 5) {
                int size = nodes.size();
                int delta = oldSize - size;
                oldSize = size;
                double rate = (delta / (0.000001 + time));
                System.err.println(
                        String.format(
                        "[doKTails] %d merges have been made in %.2fs [%.2f/sec], machine has %d nodes.", delta, time, rate, size));

                start = System.currentTimeMillis();
            }
        }
        g = getGraph();
        double time = (System.currentTimeMillis() - startTime) / 1000.0;
        long delta = startSize - nodes.size();
        double rate = delta / (0.000001 + time);
        System.err.println(
                String.format(
                "%d merges have been made in %.2fs [%.2f/sec], machine has %d nodes.", delta, time, rate, nodes.size()));
        dump("final.dot", writer.getRepresentation(g));

        return g;

    }
View Full Code Here

  }
 
  public static void main (String args[]){
    if(args[0].equals("stripreflexive") && args.length >= 2){
      try {
        System.out.println( new DOTWriter().getDOT(stripReflexiveEdges(args[1])));
      } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
View Full Code Here

TOP

Related Classes of translator.DOTWriter

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.