From: <lor...@us...> - 2011-11-30 22:12:14
|
Revision: 3455 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3455&view=rev Author: lorenz_b Date: 2011-11-30 22:12:07 +0000 (Wed, 30 Nov 2011) Log Message: ----------- Continued bug fixing of example confs. Modified Paths: -------------- trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java trunk/interfaces/src/main/java/org/dllearner/cli/QuickStart.java trunk/interfaces/src/test/java/org/dllearner/test/junit/ExampleTests.java Modified: trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java 2011-11-30 22:11:54 UTC (rev 3454) +++ trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java 2011-11-30 22:12:07 UTC (rev 3455) @@ -41,6 +41,7 @@ import org.dllearner.confparser3.ParseException; import org.dllearner.core.AbstractCELA; import org.dllearner.core.AbstractReasonerComponent; +import org.dllearner.core.KnowledgeSource; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.ReasoningMethodUnsupportedException; import org.dllearner.learningproblems.PosNegLP; @@ -65,6 +66,9 @@ private IConfiguration configuration; private File confFile; + private LearningAlgorithm algorithm; + private KnowledgeSource knowledgeSource; + // some CLI options private boolean writeSpringConfiguration = false; private boolean performCrossValidation = false; @@ -119,7 +123,8 @@ AbstractCELA la = context.getBean(AbstractCELA.class); new CrossValidation(la,lp,rs,nrOfFolds,false); } else { - LearningAlgorithm algorithm = context.getBean(LearningAlgorithm.class); + knowledgeSource = context.getBean(KnowledgeSource.class); + algorithm = context.getBean(LearningAlgorithm.class); algorithm.start(); } @@ -221,5 +226,13 @@ public void setNrOfFolds(int nrOfFolds) { this.nrOfFolds = nrOfFolds; } + + public LearningAlgorithm getLearningAlgorithm() { + return algorithm; + } + + public KnowledgeSource getKnowledgeSource() { + return knowledgeSource; + } } Modified: trunk/interfaces/src/main/java/org/dllearner/cli/QuickStart.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/cli/QuickStart.java 2011-11-30 22:11:54 UTC (rev 3454) +++ trunk/interfaces/src/main/java/org/dllearner/cli/QuickStart.java 2011-11-30 22:12:07 UTC (rev 3455) @@ -30,6 +30,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Map; /** * A tool to quickly start a learning example. It detects all conf files in the @@ -173,7 +174,7 @@ // System.out.println(f.isDirectory()+f.getAbsolutePath()); } - public static void getAllConfs(File f, String path, HashMap<String, ArrayList<String>> confs) { + public static void getAllConfs(File f, String path, Map<String, ArrayList<String>> confs) { path = path + File.separator; // System.out.println(path); String[] act = f.list(); Modified: trunk/interfaces/src/test/java/org/dllearner/test/junit/ExampleTests.java =================================================================== --- trunk/interfaces/src/test/java/org/dllearner/test/junit/ExampleTests.java 2011-11-30 22:11:54 UTC (rev 3454) +++ trunk/interfaces/src/test/java/org/dllearner/test/junit/ExampleTests.java 2011-11-30 22:12:07 UTC (rev 3455) @@ -30,6 +30,8 @@ import java.util.Map; import java.util.Random; import java.util.Set; +import java.util.SortedMap; +import java.util.TreeMap; import java.util.TreeSet; import org.apache.log4j.ConsoleAppender; @@ -72,7 +74,7 @@ // if true, then examples are executed in random order (avoids the problem // that the same examples are tested first on several runs); otherwise // it runs the examples in alphabetical order - boolean randomize = true; + boolean randomize = false; // GPs can be excluded temporarily (because those tests are very time-consuming) boolean testGP = false; @@ -90,7 +92,7 @@ logger.setLevel(Level.WARN); // map containing a list of conf files for each path - HashMap<String, ArrayList<String>> confFiles = new HashMap<String, ArrayList<String>>(); + Map<String, ArrayList<String>> confFiles = new TreeMap<String, ArrayList<String>>(); String exampleDir = ".." + File.separator + "examples"; File f = new File(exampleDir); QuickStart.getAllConfs(f, exampleDir, confFiles); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |