From: <jen...@us...> - 2008-02-17 18:09:40
|
Revision: 593 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=593&view=rev Author: jenslehmann Date: 2008-02-17 10:09:32 -0800 (Sun, 17 Feb 2008) Log Message: ----------- minor output changes Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java trunk/src/dl-learner/org/dllearner/cli/Start.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2008-02-17 17:30:58 UTC (rev 592) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2008-02-17 18:09:32 UTC (rev 593) @@ -115,6 +115,10 @@ // Variablen zur Einstellung der Protokollierung // boolean quiet = false; boolean showBenchmarkInformation = false; + // the previous best node (used only for logging, such that we can + // detect whether a new best node has been found since the last time + // statistics were printed) + private Node previousBestNode; // boolean createTreeString = false; // String searchTree = new String(); TreeSet<Node> expandedNodes = new TreeSet<Node>(nodeComparatorStable); @@ -865,10 +869,20 @@ long algorithmRuntime = System.nanoTime() - algorithmStartTime; if(!finalStats) { + Node bestNode = candidatesStable.last(); + boolean newBestNodeFound = false; + if(!bestNode.equals(previousBestNode)) { + newBestNodeFound = true; + previousBestNode = bestNode; + } + if(newBestNodeFound) + logger.info("currently best node: " + bestNode); + // Refinementoperator auf Konzept anwenden String bestNodeString = "currently best node: " + candidatesStable.last(); // searchTree += bestNodeString + "\n"; - logger.info(bestNodeString); + if(!newBestNodeFound) + logger.debug(bestNodeString); String expandedNodeString = "next expanded node: " + candidates.last(); // searchTree += expandedNodeString + "\n"; logger.debug(expandedNodeString); Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-02-17 17:30:58 UTC (rev 592) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-02-17 18:09:32 UTC (rev 593) @@ -231,27 +231,8 @@ // perform file exports performExports(parser, baseDir, sources, rs); - // show examples (display each one if they do not take up much space, - // otherwise just show the number of examples) - boolean oneLineExampleInfo = true; - int maxExampleStringLength = Math.max(posExamples.toString().length(), negExamples - .toString().length()); - if (maxExampleStringLength > 100) - oneLineExampleInfo = false; - if (oneLineExampleInfo) { - System.out.println("positive examples[" + posExamples.size() + "]: " + posExamples); - System.out.println("negative examples[" + negExamples.size() + "]: " + negExamples); - } else { - System.out.println("positive examples[" + posExamples.size() + "]: "); - for (String ex : posExamples) - System.out.println(" " + ex); - System.out.println("negative examples[" + negExamples.size() + "]: "); - for (String ex : negExamples) - System.out.println(" " + ex); - } - // handle any CLI options - processCLIOptions(cm, parser, rs); + processCLIOptions(cm, parser, rs, lp); } public void start(boolean inQueryMode) { @@ -479,7 +460,7 @@ } private static void processCLIOptions(ComponentManager cm, ConfParser parser, - ReasoningService rs) { + ReasoningService rs, LearningProblem lp) { // CLI options (i.e. options which are related to the CLI // user interface but not to one of the components) List<ConfFileOption> cliOptions = parser.getConfOptionsByPrefix("cli"); @@ -487,7 +468,28 @@ int maxLineLength = 100; for (ConfFileOption cliOption : cliOptions) { String name = cliOption.getSubOption(); - if (name.equals("showIndividuals")) { + if (name.equals("showExamples")) { + // show examples (display each one if they do not take up much space, + // otherwise just show the number of examples) + SortedSet<String> posExamples = parser.getPositiveExamples(); + SortedSet<String> negExamples = parser.getNegativeExamples(); + boolean oneLineExampleInfo = true; + int maxExampleStringLength = Math.max(posExamples.toString().length(), negExamples + .toString().length()); + if (maxExampleStringLength > 100) + oneLineExampleInfo = false; + if (oneLineExampleInfo) { + System.out.println("positive examples[" + posExamples.size() + "]: " + posExamples); + System.out.println("negative examples[" + negExamples.size() + "]: " + negExamples); + } else { + System.out.println("positive examples[" + posExamples.size() + "]: "); + for (String ex : posExamples) + System.out.println(" " + ex); + System.out.println("negative examples[" + negExamples.size() + "]: "); + for (String ex : negExamples) + System.out.println(" " + ex); + } + } else if (name.equals("showIndividuals")) { if (cliOption.getStringValue().equals("true")) { int stringLength = rs.getIndividuals().toString().length(); if (stringLength > maxLineLength) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |