public static void main(String[] args) {
    String[] infos = IdentifierExpertSystem.instance().getKernelInformations();
    String[] titles = IdentifierExpertSystem.instance().getKernelTitles();
    Hashtable attributes = new Hashtable();
    int kernelHash = IdentifierExpertSystem.instance().getKernelHash();
    StringBuffer buffer = new StringBuffer(10000);
    String title;
    String delimiterHuge =
        "===========================================================================\n";
    String delimiterSmall =
        "---------------------------------------------------------------------------\n";

    buffer.append(delimiterHuge);
    buffer.append(("Date: " + (new Date()).toGMTString()) + "\n");
    buffer.append("JOELib2 chemistry kernel (expert systems) ID: " + kernelHash + "\n");
    buffer.append("The following expert systems are used:\n");
    buffer.append(delimiterSmall);

    for (int i = 0; i < infos.length; i++) {
      attributes.clear();
      title = IdentifierExpertSystem.CML_KERNEL_REFERENCE_PREFIX + kernelHash + ":" + titles[i];

      //            if (i < (infos.length - 1))
      //            {
      //                buffer.append(", ");
      //            }

      buffer.append(title + " (" + infos[i].hashCode() + ") \n");
      buffer.append(infos[i] + "\n");
    }

    buffer.append(delimiterHuge);

    String[] asList = IdentifierExpertSystem.getDependencyTreeClassNames();

    for (int i = 0; i < asList.length; i++) {
      buffer.append("dependency class is: \t\t\t\t" + asList[i] + "\n");
      buffer.append(
          "dependency version hash code is: \t\t"
              + IdentifierExpertSystem.getDependencyTreeHash(asList[i])
              + " (including chemistry kernel hash: "
              + kernelHash
              + ")\n");
      buffer.append(
          "dependency algorithm complexity is at least: \t"
              + IdentifierExpertSystem.getDependencyTreeComplexity(asList[i])
              + " (+ basic user input graph, + cyclic dependencies, + data structure , + forgotten dependencies)\n");
      buffer.append("\n" + IdentifierExpertSystem.getDependencyTree(asList[i]) + "\n");

      if (i < (asList.length - 1)) {
        buffer.append(delimiterSmall);
      }
    }

    buffer.append(delimiterHuge);

    System.out.println(buffer.toString());
  }
Exemplo n.º 2
0
 public int hashedDependencyTreeVersion() {
   return IdentifierExpertSystem.getDependencyTreeHash(getName());
 }