Esempio n. 1
0
  /** Load all the data. */
  public static void init(Resolver loader, String file) {
    if (initialized) return;

    inclGraph = new SimpleDirectedGraph<GraphClass, Inclusion>(Inclusion.class);
    problems = new Vector<Problem>();
    load(loader, file, inclGraph, problems);

    // Sort problems
    Collections.sort(
        problems,
        new Comparator<Problem>() {
          public int compare(Problem o1, Problem o2) {
            return o1.getName().compareTo(o2.getName());
          }
        });

    // Gather the classnames
    names = new TreeMap<String, GraphClass>(new LessLatex());
    for (GraphClass gclass : inclGraph.vertexSet()) names.put(gclass.toString(), gclass);

    // Gather the SCCs
    sccs = GAlg.calcSCCMap(inclGraph);

    initialized = true;
  }
Esempio n. 2
0
 ProblemOnNode(Problem p, GraphClass n) {
   if (!p.validFor(n))
     throw new IllegalArgumentException(p.getName() + " not applicable to " + n.getID());
   problem = p;
   node = n;
   algos = new HashSet<Algorithm>();
   complexity = new Complexity[STEPS];
   for (int i = 0; i < complexity.length; i++) complexity[i] = Complexity.UNKNOWN;
 }