From: <jen...@us...> - 2007-10-08 13:37:17
|
Revision: 184 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=184&view=rev Author: jenslehmann Date: 2007-10-08 06:37:15 -0700 (Mon, 08 Oct 2007) Log Message: ----------- query mode is back Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/cli/Start.java Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2007-10-08 12:52:31 UTC (rev 183) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2007-10-08 13:37:15 UTC (rev 184) @@ -81,12 +81,18 @@ public class Start { /** + * Entry point for CLI interface. + * * @param args */ public static void main(String[] args) { File file = new File(args[args.length - 1]); String baseDir = file.getParentFile().getPath(); + boolean inQueryMode = false; + if (args.length > 1 && args[0].equals("-q")) + inQueryMode = true; + // create component manager instance System.out.print("starting component manager ... "); long cmStartTime = System.nanoTime(); @@ -133,13 +139,13 @@ ConfFileOption problemOption = parser.getConfOptionsByName("problem"); Class<? extends LearningProblem> lpClass = null; LearningProblem lp = null; - if(problemOption == null || problemOption.getStringValue().equals("posNegDefinition")) + if (problemOption == null || problemOption.getStringValue().equals("posNegDefinition")) lpClass = PosNegDefinitionLP.class; - else if(problemOption.getStringValue().equals("posNegInclusion")) + else if (problemOption.getStringValue().equals("posNegInclusion")) lpClass = PosNegInclusionLP.class; else handleError("Unknown value " + problemOption.getValue() + " for option \"problem\"."); - + lp = cm.learningProblem(lpClass, rs); SortedSet<String> posExamples = parser.getPositiveExamples(); SortedSet<String> negExamples = parser.getNegativeExamples(); @@ -165,7 +171,7 @@ // perform file exports performExports(parser, baseDir, rs); - + // show examples (display each one if they do not take up much space, // otherwise just show the number of examples) boolean oneLineExampleInfo = true; @@ -188,12 +194,17 @@ // handle any CLI options processCLIOptions(cm, parser, rs); - // start algorithm - long algStartTime = System.nanoTime(); - la.start(); - long algDuration = System.nanoTime() - algStartTime; - - printConclusions(rs, algDuration); + if (inQueryMode) + processQueryMode(lp, rs); + else { + // start algorithm + long algStartTime = System.nanoTime(); + la.start(); + long algDuration = System.nanoTime() - algStartTime; + + printConclusions(rs, algDuration); + } + } // creates a mapping from components to option prefix strings @@ -211,7 +222,8 @@ } // convenience method - // basically every prefix (e.g. "refinement" in "refinement.horizontalExpFactor) + // basically every prefix (e.g. "refinement" in + // "refinement.horizontalExpFactor) // corresponds to a specific component - this way the CLI will automatically // support any configuration options supported by the component private static void configureComponent(ComponentManager cm, Component component, @@ -361,9 +373,9 @@ private static void performExports(ConfParser parser, String baseDir, ReasoningService rs) { List<List<String>> exports = parser.getFunctionCalls().get("export"); - if(exports == null) + if (exports == null) return; - for(List<String> export : exports) { + for (List<String> export : exports) { File file = new File(baseDir, export.get(0)); if (export.size() == 1) // use RDF/XML by default @@ -379,72 +391,72 @@ } } } - + private static void processCLIOptions(ComponentManager cm, ConfParser parser, ReasoningService rs) { // 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"); - if(cliOptions != null) { - int maxLineLength = 100; - for (ConfFileOption cliOption : cliOptions) { - String name = cliOption.getSubOption(); - if (name.equals("showIndividuals")) { - if (cliOption.getStringValue().equals("true")) { - int stringLength = rs.getIndividuals().toString().length(); - if (stringLength > maxLineLength) { - System.out.println("individuals[" + rs.getIndividuals().size() + "]: "); - for (Individual ind : rs.getIndividuals()) - System.out.println(" " + ind); - } else - System.out.println("individuals[" + rs.getIndividuals().size() + "]: " - + rs.getIndividuals()); - } - } else if (name.equals("showConcepts")) { - if (cliOption.getStringValue().equals("true")) { - int stringLength = rs.getAtomicConcepts().toString().length(); - if (stringLength > maxLineLength) { - System.out.println("concepts[" + rs.getAtomicConcepts().size() + "]: "); - for (AtomicConcept ac : rs.getAtomicConcepts()) - System.out.println(" " + ac); - } else - System.out.println("concepts[" + rs.getAtomicConcepts().size() + "]: " - + rs.getAtomicConcepts()); - } - } else if (name.equals("showRoles")) { - if (cliOption.getStringValue().equals("true")) { - int stringLength = rs.getAtomicRoles().toString().length(); - if (stringLength > maxLineLength) { - System.out.println("roles[" + rs.getAtomicRoles().size() + "]: "); - for (AtomicRole r : rs.getAtomicRoles()) - System.out.println(" " + r); - } else - System.out.println("roles[" + rs.getAtomicRoles().size() + "]: " - + rs.getAtomicRoles()); - } - } else if (name.equals("showSubsumptionHierarchy")) { - if (cliOption.getStringValue().equals("true")) { - System.out.println("Subsumption Hierarchy:"); - System.out.println(rs.getSubsumptionHierarchy()); - } - // satisfiability check - } else if (name.equals("checkSatisfiability")) { - if (cliOption.getStringValue().equals("true")) { - System.out.print("Satisfiability Check ... "); - long satStartTime = System.nanoTime(); - boolean satisfiable = rs.isSatisfiable(); - long satDuration = System.nanoTime() - satStartTime; + if (cliOptions != null) { + int maxLineLength = 100; + for (ConfFileOption cliOption : cliOptions) { + String name = cliOption.getSubOption(); + if (name.equals("showIndividuals")) { + if (cliOption.getStringValue().equals("true")) { + int stringLength = rs.getIndividuals().toString().length(); + if (stringLength > maxLineLength) { + System.out.println("individuals[" + rs.getIndividuals().size() + "]: "); + for (Individual ind : rs.getIndividuals()) + System.out.println(" " + ind); + } else + System.out.println("individuals[" + rs.getIndividuals().size() + "]: " + + rs.getIndividuals()); + } + } else if (name.equals("showConcepts")) { + if (cliOption.getStringValue().equals("true")) { + int stringLength = rs.getAtomicConcepts().toString().length(); + if (stringLength > maxLineLength) { + System.out.println("concepts[" + rs.getAtomicConcepts().size() + "]: "); + for (AtomicConcept ac : rs.getAtomicConcepts()) + System.out.println(" " + ac); + } else + System.out.println("concepts[" + rs.getAtomicConcepts().size() + "]: " + + rs.getAtomicConcepts()); + } + } else if (name.equals("showRoles")) { + if (cliOption.getStringValue().equals("true")) { + int stringLength = rs.getAtomicRoles().toString().length(); + if (stringLength > maxLineLength) { + System.out.println("roles[" + rs.getAtomicRoles().size() + "]: "); + for (AtomicRole r : rs.getAtomicRoles()) + System.out.println(" " + r); + } else + System.out.println("roles[" + rs.getAtomicRoles().size() + "]: " + + rs.getAtomicRoles()); + } + } else if (name.equals("showSubsumptionHierarchy")) { + if (cliOption.getStringValue().equals("true")) { + System.out.println("Subsumption Hierarchy:"); + System.out.println(rs.getSubsumptionHierarchy()); + } + // satisfiability check + } else if (name.equals("checkSatisfiability")) { + if (cliOption.getStringValue().equals("true")) { + System.out.print("Satisfiability Check ... "); + long satStartTime = System.nanoTime(); + boolean satisfiable = rs.isSatisfiable(); + long satDuration = System.nanoTime() - satStartTime; - String result = satisfiable ? "OK" : "not satisfiable!"; - System.out.println(result + " (" - + Helper.prettyPrintNanoSeconds(satDuration, true, false) + ")"); - if (!satisfiable) - System.exit(0); - } - } else - handleError("Unknown CLI option \"" + name + "\"."); + String result = satisfiable ? "OK" : "not satisfiable!"; + System.out.println(result + " (" + + Helper.prettyPrintNanoSeconds(satDuration, true, false) + ")"); + if (!satisfiable) + System.exit(0); + } + } else + handleError("Unknown CLI option \"" + name + "\"."); + } } - } } private static void initComponent(ComponentManager cm, Component component) { @@ -467,26 +479,22 @@ System.out.println(message + " (" + Helper.prettyPrintNanoSeconds(initTime, false, false) + ")"); } - + private static void printConclusions(ReasoningService rs, long algorithmDuration) { if (rs.getNrOfRetrievals() > 0) { System.out.println("number of retrievals: " + rs.getNrOfRetrievals()); - System.out.println("retrieval reasoning time: " - + Helper.prettyPrintNanoSeconds(rs - .getRetrievalReasoningTimeNs()) + " ( " - + Helper.prettyPrintNanoSeconds(rs.getTimePerRetrievalNs()) - + " per retrieval)"); + System.out + .println("retrieval reasoning time: " + + Helper.prettyPrintNanoSeconds(rs.getRetrievalReasoningTimeNs()) + + " ( " + Helper.prettyPrintNanoSeconds(rs.getTimePerRetrievalNs()) + + " per retrieval)"); } if (rs.getNrOfInstanceChecks() > 0) { - System.out.println("number of instance checks: " - + rs.getNrOfInstanceChecks() + " (" + System.out.println("number of instance checks: " + rs.getNrOfInstanceChecks() + " (" + rs.getNrOfMultiInstanceChecks() + " multiple)"); System.out.println("instance check reasoning time: " - + Helper.prettyPrintNanoSeconds(rs - .getInstanceCheckReasoningTimeNs()) - + " ( " - + Helper.prettyPrintNanoSeconds(rs - .getTimePerInstanceCheckNs()) + + Helper.prettyPrintNanoSeconds(rs.getInstanceCheckReasoningTimeNs()) + " ( " + + Helper.prettyPrintNanoSeconds(rs.getTimePerInstanceCheckNs()) + " per instance check)"); } if (rs.getNrOfSubsumptionHierarchyQueries() > 0) { @@ -497,57 +505,50 @@ * Helper.prettyPrintNanoSeconds(rs * .getSubsumptionHierarchyTimeNs()) + " ( " + * Helper.prettyPrintNanoSeconds(rs - * .getTimePerSubsumptionHierarchyQueryNs()) + " per - * subsumption hierachy query)"); + * .getTimePerSubsumptionHierarchyQueryNs()) + " per subsumption + * hierachy query)"); */ } if (rs.getNrOfSubsumptionChecks() > 0) { - System.out.println("(complex) subsumption checks: " - + rs.getNrOfSubsumptionChecks() + " (" - + rs.getNrOfMultiSubsumptionChecks() + " multiple)"); + System.out.println("(complex) subsumption checks: " + rs.getNrOfSubsumptionChecks() + + " (" + rs.getNrOfMultiSubsumptionChecks() + " multiple)"); System.out.println("subsumption reasoning time: " - + Helper.prettyPrintNanoSeconds(rs - .getSubsumptionReasoningTimeNs()) - + " ( " - + Helper.prettyPrintNanoSeconds(rs - .getTimePerSubsumptionCheckNs()) + + Helper.prettyPrintNanoSeconds(rs.getSubsumptionReasoningTimeNs()) + " ( " + + Helper.prettyPrintNanoSeconds(rs.getTimePerSubsumptionCheckNs()) + " per subsumption check)"); } DecimalFormat df = new DecimalFormat(); double reasoningPercentage = 100 * rs.getOverallReasoningTimeNs() / (double) algorithmDuration; - System.out - .println("overall reasoning time: " - + Helper.prettyPrintNanoSeconds(rs - .getOverallReasoningTimeNs()) + " (" - + df.format(reasoningPercentage) - + "% of overall runtime)"); + System.out.println("overall reasoning time: " + + Helper.prettyPrintNanoSeconds(rs.getOverallReasoningTimeNs()) + " (" + + df.format(reasoningPercentage) + "% of overall runtime)"); System.out.println("overall algorithm runtime: " + Helper.prettyPrintNanoSeconds(algorithmDuration)); } - - // TODO: query mode umschreiben + + // performs a query - used for debugging learning examples private static void processQueryMode(LearningProblem lp, ReasoningService rs) { - System.out - .println("Entering query mode. Enter a concept for performing retrieval or q to quit."); + System.out.println("Entering query mode. Enter a concept for performing " + + "retrieval or q to quit. Use brackets for complex expresssions," + + "e.g. (a AND b)."); String queryStr = ""; do { - System.out.print("enter query: "); // String einlesen + System.out.print("enter query: "); + // read input string BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); - // Eingabestring einlesen try { queryStr = input.readLine(); - } catch (IOException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); } - + if (!queryStr.equals("q")) { - // Konzept parsen + // parse concept Concept concept = null; boolean parsedCorrectly = true; @@ -566,8 +567,7 @@ } if (parsedCorrectly) { - // berechne im Konzept vorkommende atomare Rollen und - // Konzepte + // compute atomic roles and concepts used in concept SortedSet<AtomicConcept> occurringConcepts = new TreeSet<AtomicConcept>( new ConceptComparator()); occurringConcepts.addAll(Helper.getAtomicConcepts(concept)); @@ -575,16 +575,15 @@ new RoleComparator()); occurringRoles.addAll(Helper.getAtomicRoles(concept)); - // ziehe davon die existierenden ab => die resultierenden - // Mengen - // sollten leer sein, ansonsten Fehler (der DIG-Reasoner - // fängt das - // leider nicht selbst ab) - // => momentan etwas umständlich gelöst, da es in Java bei - // removeAll darauf - // ankommt, dass die Argumentmenge den Comparator - // implementiert hat, was hier - // (noch) nicht der Fall ist + // substract existing roles/concepts from detected + // roles/concepts -> the resulting sets should be + // empty, otherwise print a warning (the DIG reasoner + // will just treat them as concepts about which it + // has no knowledge - this makes it hard to + // detect typos + // (note that removeAll currently gives a different + // result here, because the comparator of the argument + // is used) for (AtomicConcept ac : rs.getAtomicConcepts()) occurringConcepts.remove(ac); for (AtomicRole ar : rs.getAtomicRoles()) @@ -595,25 +594,29 @@ System.out .println("You used non-existing atomic concepts or roles. Please correct your query."); if (occurringConcepts.size() > 0) - System.out.println("non-existing concepts: " - + occurringConcepts); + System.out.println("non-existing concepts: " + occurringConcepts); if (occurringRoles.size() > 0) System.out.println("non-existing roles: " + occurringRoles); nonExistingConstructs = true; } if (!nonExistingConstructs) { - // Retrieval stellen + + if(!queryStr.startsWith("(") && (queryStr.contains("AND") || queryStr.contains("OR"))) { + System.out.println("Make sure you did not forget to use outer brackets."); + } + + System.out.println("The query is: " + concept + "."); + + // pose retrieval query Set<Individual> result = null; result = rs.retrieval(concept); - System.out.println(result); + System.out.println("retrieval result: " + result); Score score = lp.computeScore(concept); System.out.println(score); - // feststellen, was zur Lösung noch fehlt - // Set<String> notCoveredPositives } } } @@ -621,7 +624,7 @@ } while (!queryStr.equals("q")); } - + private static void handleError(String message) { System.err.println(message); System.exit(0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-01-18 10:48:35
|
Revision: 389 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=389&view=rev Author: kurzum Date: 2008-01-18 02:48:33 -0800 (Fri, 18 Jan 2008) Log Message: ----------- Bugfix Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/cli/Start.java Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-01-18 10:47:32 UTC (rev 388) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-01-18 10:48:33 UTC (rev 389) @@ -60,7 +60,7 @@ import org.dllearner.core.dl.Individual; import org.dllearner.kb.KBFile; import org.dllearner.kb.OWLFile; -import org.dllearner.kb.sparql.SparqlEndpoint; +import org.dllearner.kb.SparqlKnowledgeSource; import org.dllearner.learningproblems.PosNegDefinitionLP; import org.dllearner.learningproblems.PosNegInclusionLP; import org.dllearner.learningproblems.PosOnlyDefinitionLP; @@ -229,7 +229,7 @@ private static Map<Class<? extends Component>, String> createComponentPrefixMapping() { Map<Class<? extends Component>, String> componentPrefixMapping = new HashMap<Class<? extends Component>, String>(); // knowledge sources - componentPrefixMapping.put(SparqlEndpoint.class, "sparql"); + componentPrefixMapping.put(SparqlKnowledgeSource.class, "sparql"); // reasoners componentPrefixMapping.put(DIGReasoner.class, "digReasoner"); componentPrefixMapping.put(OWLAPIReasoner.class, "owlAPIReasoner"); @@ -383,7 +383,7 @@ else if (formatString.equals("KB")) ksClass = KBFile.class; else if (formatString.equals("SPARQL")) - ksClass = SparqlEndpoint.class; + ksClass = SparqlKnowledgeSource.class; else if (formatString.equals("NT")) ksClass = OWLFile.class; else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-18 12:35:53
|
Revision: 599 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=599&view=rev Author: jenslehmann Date: 2008-02-18 04:35:49 -0800 (Mon, 18 Feb 2008) Log Message: ----------- added cli.logLevel option (allowed values: trace, debug, info [default], warn, error, fatal, off) Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/cli/Start.java Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-02-18 12:32:36 UTC (rev 598) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-02-18 12:35:49 UTC (rev 599) @@ -118,7 +118,7 @@ ConsoleAppender consoleAppender = new ConsoleAppender(layout); logger.removeAllAppenders(); logger.addAppender(consoleAppender); - logger.setLevel(Level.INFO); + logger.setLevel(Level.DEBUG); Start start = null; start = new Start(file); @@ -541,6 +541,22 @@ if (!satisfiable) System.exit(0); } + } else if( name.equals("logLevel")) { + String level = cliOption.getStringValue(); + if(level.equals("off")) + logger.setLevel(Level.OFF); + else if(level.equals("trace")) + logger.setLevel(Level.TRACE); + else if(level.equals("info")) + logger.setLevel(Level.INFO); + else if(level.equals("debug")) + logger.setLevel(Level.DEBUG); + else if(level.equals("warn")) + logger.setLevel(Level.WARN); + else if(level.equals("error")) + logger.setLevel(Level.ERROR); + else if(level.equals("fatal")) + logger.setLevel(Level.FATAL); } else handleError("Unknown CLI option \"" + name + "\"."); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ton...@us...> - 2008-02-21 21:20:14
|
Revision: 622 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=622&view=rev Author: tonytacker Date: 2008-02-21 13:20:02 -0800 (Thu, 21 Feb 2008) Log Message: ----------- some more private methods to use their inside GUI for loading a configuration file Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/cli/Start.java Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-02-21 21:13:33 UTC (rev 621) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-02-21 21:20:02 UTC (rev 622) @@ -94,12 +94,12 @@ */ public class Start { - private static Logger logger = Logger.getRootLogger(); - + private static Logger logger = Logger.getRootLogger(); + private LearningAlgorithm la; private LearningProblem lp; private ReasoningService rs; - + /** * Entry point for CLI interface. * @@ -111,7 +111,7 @@ boolean inQueryMode = false; if (args.length > 1 && args[0].equals("-q")) inQueryMode = true; - + // create logger (a simple logger which outputs // its messages to the console) SimpleLayout layout = new SimpleLayout(); @@ -119,7 +119,7 @@ logger.removeAllAppenders(); logger.addAppender(consoleAppender); logger.setLevel(Level.DEBUG); - + Start start = null; start = new Start(file); start.start(inQueryMode); @@ -127,12 +127,14 @@ /** * Initialise all components based on conf file. - * @param file Conf file to read. - * @throws ComponentInitException + * + * @param file + * Conf file to read. + * @throws ComponentInitException */ public Start(File file) throws ComponentInitException { - String baseDir = file.getParentFile().getPath(); - + String baseDir = file.getParentFile().getPath(); + // create component manager instance String message = "starting component manager ... "; long cmStartTime = System.nanoTime(); @@ -140,7 +142,7 @@ long cmTime = System.nanoTime() - cmStartTime; message += "OK (" + Helper.prettyPrintNanoSeconds(cmTime) + ")"; logger.info(message); - + // create a mapping between components and prefixes in the conf file Map<Class<? extends Component>, String> componentPrefixMapping = createComponentPrefixMapping(); @@ -169,9 +171,9 @@ // default value if (reasonerOption == null || reasonerOption.getStringValue().equals("dig")) reasonerClass = DIGReasoner.class; - else if(reasonerOption.getStringValue().equals("owlAPI")) + else if (reasonerOption.getStringValue().equals("owlAPI")) reasonerClass = OWLAPIReasoner.class; - else if(reasonerOption.getStringValue().equals("fastRetrieval")) + else if (reasonerOption.getStringValue().equals("fastRetrieval")) reasonerClass = FastRetrievalReasoner.class; else { handleError("Unknown value " + reasonerOption.getStringValue() @@ -198,24 +200,24 @@ SortedSet<String> posExamples = parser.getPositiveExamples(); SortedSet<String> negExamples = parser.getNegativeExamples(); cm.applyConfigEntry(lp, "positiveExamples", posExamples); - if(lpClass != PosOnlyDefinitionLP.class) + if (lpClass != PosOnlyDefinitionLP.class) cm.applyConfigEntry(lp, "negativeExamples", negExamples); configureComponent(cm, lp, componentPrefixMapping, parser); initComponent(cm, lp); - + // step 4: detect learning algorithm ConfFileOption algorithmOption = parser.getConfOptionsByName("algorithm"); Class<? extends LearningAlgorithm> laClass = null; if (algorithmOption == null || algorithmOption.getStringValue().equals("refinement")) laClass = ROLearner.class; - else if(algorithmOption.getStringValue().equals("refexamples")) - laClass = ExampleBasedROLComponent.class; - else if(algorithmOption.getStringValue().equals("gp")) + else if (algorithmOption.getStringValue().equals("refexamples")) + laClass = ExampleBasedROLComponent.class; + else if (algorithmOption.getStringValue().equals("gp")) laClass = GP.class; - else if(algorithmOption.getStringValue().equals("bruteForce")) + else if (algorithmOption.getStringValue().equals("bruteForce")) laClass = BruteForceLearner.class; - else if(algorithmOption.getStringValue().equals("randomGuesser")) - laClass = RandomGuesser.class; + else if (algorithmOption.getStringValue().equals("randomGuesser")) + laClass = RandomGuesser.class; else handleError("Unknown value in " + algorithmOption); @@ -232,9 +234,9 @@ performExports(parser, baseDir, sources, rs); // handle any CLI options - processCLIOptions(cm, parser, rs, lp); + processCLIOptions(cm, parser, rs, lp); } - + public void start(boolean inQueryMode) { if (inQueryMode) processQueryMode(lp, rs); @@ -245,11 +247,13 @@ long algDuration = System.nanoTime() - algStartTime; printConclusions(rs, algDuration); - } + } } - - // creates a mapping from components to option prefix strings - private static Map<Class<? extends Component>, String> createComponentPrefixMapping() { + + /** + * creates a mapping from components to option prefix strings + */ + public static Map<Class<? extends Component>, String> createComponentPrefixMapping() { Map<Class<? extends Component>, String> componentPrefixMapping = new HashMap<Class<? extends Component>, String>(); // knowledge sources componentPrefixMapping.put(SparqlKnowledgeSource.class, "sparql"); @@ -265,12 +269,13 @@ return componentPrefixMapping; } - // convenience method - // basically every prefix (e.g. "refinement" in - // "refinement.horizontalExpFactor) - // corresponds to a specific component - this way the CLI will automatically - // support any configuration options supported by the component - private static void configureComponent(ComponentManager cm, Component component, + /** + * convenience method basically every prefix (e.g. "refinement" in + * "refinement.horizontalExpFactor) corresponds to a specific component - + * this way the CLI will automatically support any configuration options + * supported by the component + */ + public static void configureComponent(ComponentManager cm, Component component, Map<Class<? extends Component>, String> componentPrefixMapping, ConfParser parser) { String prefix = componentPrefixMapping.get(component.getClass()); if (prefix != null) @@ -292,7 +297,7 @@ // the name of the option is suboption-part (the first part refers // to its component) String optionName = option.getSubOption(); - + ConfigOption<?> configOption = cm.getConfigOption(component.getClass(), optionName); // check whether such an option exists if (configOption != null) { @@ -339,14 +344,18 @@ (StringSetConfigOption) configOption, option.getSetValues()); cm.applyConfigEntry(component, entry); - } else if (configOption instanceof StringTupleListConfigOption && option.isListOption()) { + } else if (configOption instanceof StringTupleListConfigOption + && option.isListOption()) { ConfigEntry<List<StringTuple>> entry = new ConfigEntry<List<StringTuple>>( (StringTupleListConfigOption) configOption, option.getListTuples()); cm.applyConfigEntry(component, entry); } else { - handleError("The type of conf file entry \"" + option.getFullName() + "\" is not correct: value \"" + option.getValue() + "\" not valid for option type \"" + configOption.getClass().getName() + "\"."); + handleError("The type of conf file entry \"" + option.getFullName() + + "\" is not correct: value \"" + option.getValue() + + "\" not valid for option type \"" + configOption.getClass().getName() + + "\"."); } } catch (InvalidConfigOptionValueException e) { @@ -358,85 +367,88 @@ handleError("Unknow option " + option + "."); } - // detects all imported files and their format + /** + * detects all imported files and their format + */ public static Map<URL, Class<? extends KnowledgeSource>> getImportedFiles(ConfParser parser, String baseDir) { List<List<String>> imports = parser.getFunctionCalls().get("import"); Map<URL, Class<? extends KnowledgeSource>> importedFiles = new HashMap<URL, Class<? extends KnowledgeSource>>(); - if(imports != null) { - for (List<String> arguments : imports) { - // step 1: detect URL - URL url = null; - try { - String fileString = arguments.get(0); - if (fileString.startsWith("http:")) { - url = new URL(fileString); - } else { - File f = new File(baseDir, arguments.get(0)); - url = f.toURI().toURL(); + if (imports != null) { + for (List<String> arguments : imports) { + // step 1: detect URL + URL url = null; + try { + String fileString = arguments.get(0); + if (fileString.startsWith("http:")) { + url = new URL(fileString); + } else { + File f = new File(baseDir, arguments.get(0)); + url = f.toURI().toURL(); + } + } catch (MalformedURLException e) { + e.printStackTrace(); } - } catch (MalformedURLException e) { - e.printStackTrace(); - } - // step 2: detect format - Class<? extends KnowledgeSource> ksClass; - if (arguments.size() == 1) { - String filename = url.getPath(); - String ending = filename.substring(filename.lastIndexOf(".") + 1); + // step 2: detect format + Class<? extends KnowledgeSource> ksClass; + if (arguments.size() == 1) { + String filename = url.getPath(); + String ending = filename.substring(filename.lastIndexOf(".") + 1); - if (ending.equals("rdf") || ending.equals("owl")) - ksClass = OWLFile.class; - else if (ending.equals("nt")) - ksClass = OWLFile.class; - else if (ending.equals("kb")) - ksClass = KBFile.class; - else { - System.err.println("Warning: no format given for " + arguments.get(0) - + " and could not detect it. Chosing RDF/XML."); - ksClass = OWLFile.class; - } + if (ending.equals("rdf") || ending.equals("owl")) + ksClass = OWLFile.class; + else if (ending.equals("nt")) + ksClass = OWLFile.class; + else if (ending.equals("kb")) + ksClass = KBFile.class; + else { + System.err.println("Warning: no format given for " + arguments.get(0) + + " and could not detect it. Chosing RDF/XML."); + ksClass = OWLFile.class; + } - importedFiles.put(url, ksClass); - } else { - String formatString = arguments.get(1); + importedFiles.put(url, ksClass); + } else { + String formatString = arguments.get(1); - if (formatString.equals("RDF/XML")) - ksClass = OWLFile.class; - else if (formatString.equals("KB")) - ksClass = KBFile.class; - else if (formatString.equals("SPARQL")) - ksClass = SparqlKnowledgeSource.class; - else if (formatString.equals("NT")) - ksClass = OWLFile.class; - else { - throw new RuntimeException("Unsupported knowledge source format " - + formatString + ". Exiting."); + if (formatString.equals("RDF/XML")) + ksClass = OWLFile.class; + else if (formatString.equals("KB")) + ksClass = KBFile.class; + else if (formatString.equals("SPARQL")) + ksClass = SparqlKnowledgeSource.class; + else if (formatString.equals("NT")) + ksClass = OWLFile.class; + else { + throw new RuntimeException("Unsupported knowledge source format " + + formatString + ". Exiting."); + } + + importedFiles.put(url, ksClass); } - - importedFiles.put(url, ksClass); } } - } return importedFiles; } - private static void performExports(ConfParser parser, String baseDir, Set<KnowledgeSource> sources, ReasoningService rs) { + private static void performExports(ConfParser parser, String baseDir, + Set<KnowledgeSource> sources, ReasoningService rs) { List<List<String>> exports = parser.getFunctionCalls().get("export"); if (exports == null) return; - + File file = null; - OntologyFormat format = null; + OntologyFormat format = null; for (List<String> export : exports) { file = new File(baseDir, export.get(0)); if (export.size() == 1) // use RDF/XML by default format = OntologyFormat.RDF_XML; - // rs.saveOntology(file, OntologyFileFormat.RDF_XML); + // rs.saveOntology(file, OntologyFileFormat.RDF_XML); else { String formatString = export.get(1); // OntologyFileFormat format; @@ -448,14 +460,14 @@ } } // hack: ideally we would have the possibility to export each knowledge - // source to specified files with specified formats (and maybe including + // source to specified files with specified formats (and maybe including // the option to merge them all in one file) // however implementing this requires quite some effort so for the // moment we just stick to exporting KB files (moreover all but the last // export statement are ignored) - for(KnowledgeSource source : sources) { - if(source instanceof KBFile) - ((KBFile)source).export(file, format); + for (KnowledgeSource source : sources) { + if (source instanceof KBFile) + ((KBFile) source).export(file, format); } } @@ -469,18 +481,21 @@ for (ConfFileOption cliOption : cliOptions) { String name = cliOption.getSubOption(); if (name.equals("showExamples")) { - // show examples (display each one if they do not take up much space, + // 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(); + SortedSet<String> negExamples = parser.getNegativeExamples(); boolean oneLineExampleInfo = true; - int maxExampleStringLength = Math.max(posExamples.toString().length(), negExamples - .toString().length()); + 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); + 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) @@ -488,7 +503,7 @@ 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(); @@ -541,31 +556,32 @@ if (!satisfiable) System.exit(0); } - } else if( name.equals("logLevel")) { + } else if (name.equals("logLevel")) { String level = cliOption.getStringValue(); - if(level.equals("off")) + if (level.equals("off")) logger.setLevel(Level.OFF); - else if(level.equals("trace")) - logger.setLevel(Level.TRACE); - else if(level.equals("info")) + else if (level.equals("trace")) + logger.setLevel(Level.TRACE); + else if (level.equals("info")) logger.setLevel(Level.INFO); - else if(level.equals("debug")) + else if (level.equals("debug")) logger.setLevel(Level.DEBUG); - else if(level.equals("warn")) + else if (level.equals("warn")) logger.setLevel(Level.WARN); - else if(level.equals("error")) + else if (level.equals("error")) logger.setLevel(Level.ERROR); - else if(level.equals("fatal")) - logger.setLevel(Level.FATAL); + else if (level.equals("fatal")) + logger.setLevel(Level.FATAL); } else handleError("Unknown CLI option \"" + name + "\"."); } } } - private static void initComponent(ComponentManager cm, Component component) throws ComponentInitException { - String startMessage = "initialising component \"" + cm.getComponentName(component.getClass()) - + "\" ... "; + private static void initComponent(ComponentManager cm, Component component) + throws ComponentInitException { + String startMessage = "initialising component \"" + + cm.getComponentName(component.getClass()) + "\" ... "; long initStartTime = System.nanoTime(); component.init(); // standard messsage is just "OK" but can be more detailed for certain @@ -580,8 +596,8 @@ } long initTime = System.nanoTime() - initStartTime; - logger.info(startMessage + message + " (" + Helper.prettyPrintNanoSeconds(initTime, false, false) - + ")"); + logger.info(startMessage + message + " (" + + Helper.prettyPrintNanoSeconds(initTime, false, false) + ")"); } private static void printConclusions(ReasoningService rs, long algorithmDuration) { @@ -635,8 +651,8 @@ private static void processQueryMode(LearningProblem lp, ReasoningService rs) { System.out.println("Entering query mode. Enter a concept for performing " - + "retrieval or q to quit. Use brackets for complex expresssions," + - "e.g. (a AND b)."); + + "retrieval or q to quit. Use brackets for complex expresssions," + + "e.g. (a AND b)."); String queryStr = ""; do { @@ -649,7 +665,7 @@ } catch (IOException e) { e.printStackTrace(); } - + if (!queryStr.equals("q")) { // parse concept @@ -682,11 +698,11 @@ // substract existing roles/concepts from detected // roles/concepts -> the resulting sets should be // empty, otherwise print a warning (the DIG reasoner - // will just treat them as concepts about which it + // will just treat them as concepts about which it // has no knowledge - this makes it hard to - // detect typos - // (note that removeAll currently gives a different - // result here, because the comparator of the argument + // detect typos + // (note that removeAll currently gives a different + // result here, because the comparator of the argument // is used) for (NamedClass ac : rs.getAtomicConcepts()) occurringConcepts.remove(ac); @@ -705,13 +721,15 @@ } if (!nonExistingConstructs) { - - if(!queryStr.startsWith("(") && (queryStr.contains("AND") || queryStr.contains("OR"))) { - System.out.println("Make sure you did not forget to use outer brackets."); + + if (!queryStr.startsWith("(") + && (queryStr.contains("AND") || queryStr.contains("OR"))) { + System.out + .println("Make sure you did not forget to use outer brackets."); } - + System.out.println("The query is: " + concept + "."); - + // pose retrieval query Set<Individual> result = null; result = rs.retrieval(concept); @@ -729,7 +747,13 @@ } - private static void handleError(String message) { + /** + * error handling over the logger + * + * @param message + * is a string and you message for problem + */ + public static void handleError(String message) { logger.error(message); System.exit(0); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ton...@us...> - 2008-02-21 21:21:31
|
Revision: 623 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=623&view=rev Author: tonytacker Date: 2008-02-21 13:21:21 -0800 (Thu, 21 Feb 2008) Log Message: ----------- some more PUBLIC methods to use their inside GUI for loading a configuration file Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/cli/Start.java Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-02-21 21:20:02 UTC (rev 622) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-02-21 21:21:21 UTC (rev 623) @@ -368,7 +368,7 @@ } /** - * detects all imported files and their format + * detects all imported files and their format */ public static Map<URL, Class<? extends KnowledgeSource>> getImportedFiles(ConfParser parser, String baseDir) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-04-02 16:02:57
|
Revision: 756 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=756&view=rev Author: kurzum Date: 2008-04-02 09:02:52 -0700 (Wed, 02 Apr 2008) Log Message: ----------- added remaining mappings Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/cli/Start.java Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-04-02 15:52:08 UTC (rev 755) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-04-02 16:02:52 UTC (rev 756) @@ -226,14 +226,23 @@ componentPrefixMapping.put(DIGReasoner.class, "digReasoner"); componentPrefixMapping.put(FastInstanceChecker.class, "fastInstanceChecker"); componentPrefixMapping.put(OWLAPIReasoner.class, "owlAPIReasoner"); + componentPrefixMapping.put(FastRetrievalReasoner.class, "fastRetrieval"); + + // learning problems - configured via + and - flags for examples componentPrefixMapping.put(PosNegDefinitionLP.class, "posNegDefinitionLP"); componentPrefixMapping.put(PosNegInclusionLP.class, "posNegInclusionLP"); componentPrefixMapping.put(PosOnlyDefinitionLP.class, "posOnlyDefinitionLP"); + + // learning algorithms componentPrefixMapping.put(ROLearner.class, "refinement"); componentPrefixMapping.put(ExampleBasedROLComponent.class, "refexamples"); componentPrefixMapping.put(GP.class, "gp"); + componentPrefixMapping.put(BruteForceLearner.class, "bruteForce"); + componentPrefixMapping.put(RandomGuesser.class, "random"); + + return componentPrefixMapping; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-06-04 07:16:43
|
Revision: 936 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=936&view=rev Author: jenslehmann Date: 2008-06-04 00:16:37 -0700 (Wed, 04 Jun 2008) Log Message: ----------- - changed log file from the_log.txt to log/log.txt - changed JAMon output from console to an HTML table in log/jamon.html Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/cli/Start.java Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-06-04 06:58:00 UTC (rev 935) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-06-04 07:16:37 UTC (rev 936) @@ -83,6 +83,7 @@ import org.dllearner.reasoning.FastInstanceChecker; import org.dllearner.reasoning.FastRetrievalReasoner; import org.dllearner.reasoning.OWLAPIReasoner; +import org.dllearner.utilities.Files; import org.dllearner.utilities.Helper; import org.dllearner.utilities.JamonMonitorLogger; import org.dllearner.utilities.datastructures.Datastructures; @@ -90,6 +91,8 @@ import org.dllearner.utilities.owl.ConceptComparator; import org.dllearner.utilities.owl.RoleComparator; +import com.jamonapi.MonitorFactory; + /** * Startup file for Command Line Interface. * @@ -117,25 +120,27 @@ inQueryMode = true; // create logger (a simple logger which outputs - // its messages to the console) + // its messages to the console and a log file) SimpleLayout layout = new SimpleLayout(); ConsoleAppender consoleAppender = new ConsoleAppender(layout); - FileAppender fileAppender =null; ; - try{ - fileAppender = new FileAppender(layout,"the_log.txt",false); - }catch (Exception e) {e.printStackTrace();} - logger.removeAllAppenders(); + FileAppender fileAppender = null; + try { + fileAppender = new FileAppender(layout, "log/log.txt", false); + } catch (IOException e) { + e.printStackTrace(); + } + logger.removeAllAppenders(); logger.addAppender(consoleAppender); logger.addAppender(fileAppender); - logger.setLevel(Level.TRACE); - Logger.getLogger(KnowledgeSource.class).setLevel(Level.WARN); - Logger.getLogger(SparqlKnowledgeSource.class).setLevel(Level.WARN); - Logger.getLogger(TypedSparqlQuery.class).setLevel(Level.WARN); + logger.setLevel(Level.DEBUG); +// Logger.getLogger(KnowledgeSource.class).setLevel(Level.WARN); +// Logger.getLogger(SparqlKnowledgeSource.class).setLevel(Level.WARN); +// Logger.getLogger(TypedSparqlQuery.class).setLevel(Level.WARN); - Start start = null; - start = new Start(file); + Start start = new Start(file); start.start(inQueryMode); - JamonMonitorLogger.printAllSortedByLabel(); + // write JaMON report in HTML file + Files.createFile(new File("log/jamon.html"), MonitorFactory.getReport()); } /** @@ -239,22 +244,19 @@ componentPrefixMapping.put(FastInstanceChecker.class, "fastInstanceChecker"); componentPrefixMapping.put(OWLAPIReasoner.class, "owlAPIReasoner"); componentPrefixMapping.put(FastRetrievalReasoner.class, "fastRetrieval"); - - + // learning problems - configured via + and - flags for examples componentPrefixMapping.put(PosNegDefinitionLP.class, "posNegDefinitionLP"); componentPrefixMapping.put(PosNegInclusionLP.class, "posNegInclusionLP"); componentPrefixMapping.put(PosOnlyDefinitionLP.class, "posOnlyDefinitionLP"); - - + // learning algorithms componentPrefixMapping.put(ROLearner.class, "refinement"); componentPrefixMapping.put(ExampleBasedROLComponent.class, "refexamples"); componentPrefixMapping.put(GP.class, "gp"); componentPrefixMapping.put(BruteForceLearner.class, "bruteForce"); componentPrefixMapping.put(RandomGuesser.class, "random"); - - + return componentPrefixMapping; } @@ -656,7 +658,7 @@ e.printStackTrace(); } - if (!(queryStr.equalsIgnoreCase("q") ||queryStr.equalsIgnoreCase("quit"))) { + if (!(queryStr.equalsIgnoreCase("q") || queryStr.equalsIgnoreCase("quit"))) { // parse concept Description concept = null; @@ -701,7 +703,8 @@ boolean nonExistingConstructs = false; if (occurringConcepts.size() != 0 || occurringRoles.size() != 0) { - logger.debug("You used non-existing atomic concepts or roles. Please correct your query."); + logger + .debug("You used non-existing atomic concepts or roles. Please correct your query."); if (occurringConcepts.size() > 0) logger.debug("non-existing concepts: " + occurringConcepts); if (occurringRoles.size() > 0) @@ -722,16 +725,16 @@ Set<Individual> result = null; result = rs.retrieval(concept); - logger.info("retrieval result ("+result.size()+"): " + result); + logger.info("retrieval result (" + result.size() + "): " + result); Score score = lp.computeScore(concept); logger.info(score); } } - }//end if + }// end if - } while (!(queryStr.equalsIgnoreCase("q")||queryStr.equalsIgnoreCase("quit"))); + } while (!(queryStr.equalsIgnoreCase("q") || queryStr.equalsIgnoreCase("quit"))); } @@ -776,7 +779,7 @@ else if (reasonerOption.getStringValue().equals("fastRetrieval")) reasonerClass = FastRetrievalReasoner.class; else if (reasonerOption.getStringValue().equals("fastInstanceChecker")) - reasonerClass = FastInstanceChecker.class; + reasonerClass = FastInstanceChecker.class; else { handleError("Unknown value " + reasonerOption.getStringValue() + " for option \"reasoner\"."); @@ -791,7 +794,8 @@ * from config file * @return lpClass learning problem class */ - public static Class<? extends LearningProblem> getLearningProblemClass(ConfFileOption problemOption) { + public static Class<? extends LearningProblem> getLearningProblemClass( + ConfFileOption problemOption) { Class<? extends LearningProblem> lpClass = null; if (problemOption == null || problemOption.getStringValue().equals("posNegDefinitionLP")) lpClass = PosNegDefinitionLP.class; @@ -812,7 +816,8 @@ * from config file * @return laClass learning algorithm class */ - public static Class<? extends LearningAlgorithm> getLearningAlgorithm(ConfFileOption algorithmOption) { + public static Class<? extends LearningAlgorithm> getLearningAlgorithm( + ConfFileOption algorithmOption) { Class<? extends LearningAlgorithm> laClass = null; if (algorithmOption == null || algorithmOption.getStringValue().equals("refinement")) laClass = ROLearner.class; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-06-05 05:28:08
|
Revision: 940 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=940&view=rev Author: jenslehmann Date: 2008-06-04 22:28:04 -0700 (Wed, 04 Jun 2008) Log Message: ----------- changed CLI defaults: reasoner = fastInstanceChecker; algorithm = refexamples Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/cli/Start.java Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-06-04 17:02:14 UTC (rev 939) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-06-05 05:28:04 UTC (rev 940) @@ -204,7 +204,6 @@ try { la = cm.learningAlgorithm(getLearningAlgorithm(algorithmOption), lp, rs); } catch (LearningProblemUnsupportedException e) { - // TODO Auto-generated catch block e.printStackTrace(); } configureComponent(cm, la, componentPrefixMapping, parser); @@ -759,8 +758,6 @@ return rs; } - // edit by Tilo Hielscher - /** * Set Reasoner class. Define here all possible reasoners. * @@ -770,14 +767,14 @@ */ public static Class<? extends ReasonerComponent> getReasonerClass(ConfFileOption reasonerOption) { Class<? extends ReasonerComponent> reasonerClass = null; - if (reasonerOption == null || reasonerOption.getStringValue().equals("dig")) - reasonerClass = DIGReasoner.class; + if (reasonerOption == null || reasonerOption.getStringValue().equals("fastInstanceChecker")) + reasonerClass = FastInstanceChecker.class; else if (reasonerOption.getStringValue().equals("owlAPI")) reasonerClass = OWLAPIReasoner.class; else if (reasonerOption.getStringValue().equals("fastRetrieval")) reasonerClass = FastRetrievalReasoner.class; - else if (reasonerOption.getStringValue().equals("fastInstanceChecker")) - reasonerClass = FastInstanceChecker.class; + else if (reasonerOption.getStringValue().equals("dig")) + reasonerClass = DIGReasoner.class; else { handleError("Unknown value " + reasonerOption.getStringValue() + " for option \"reasoner\"."); @@ -817,10 +814,10 @@ public static Class<? extends LearningAlgorithm> getLearningAlgorithm( ConfFileOption algorithmOption) { Class<? extends LearningAlgorithm> laClass = null; - if (algorithmOption == null || algorithmOption.getStringValue().equals("refinement")) - laClass = ROLearner.class; - else if (algorithmOption.getStringValue().equals("refexamples")) + if (algorithmOption == null || algorithmOption.getStringValue().equals("refexamples")) laClass = ExampleBasedROLComponent.class; + else if (algorithmOption.getStringValue().equals("refinement")) + laClass = ROLearner.class; else if (algorithmOption.getStringValue().equals("gp")) laClass = GP.class; else if (algorithmOption.getStringValue().equals("bruteForce")) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |