From: <jen...@us...> - 2011-08-24 09:34:41
|
Revision: 3108 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3108&view=rev Author: jenslehmann Date: 2011-08-24 09:34:32 +0000 (Wed, 24 Aug 2011) Log Message: ----------- removed the OCELConfigurator class and rewrote dozens of code snippets using it Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/ExampleBasedNode.java trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/MultiHeuristic.java trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/OCEL.java trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/ROLearner2.java trunk/components-core/src/main/java/org/dllearner/core/config/BooleanEditor.java trunk/components-core/src/main/java/org/dllearner/core/configurators/ComponentFactory.java trunk/components-core/src/main/java/org/dllearner/reasoning/FastInstanceChecker.java trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDRDown.java trunk/components-core/src/main/java/org/dllearner/refinementoperators/fuzzydll/FuzzyRhoDRDown.java trunk/components-core/src/main/java/org/dllearner/utilities/examples/ExampleDataCollector.java trunk/components-core/src/test/java/org/dllearner/test/junit/RefinementOperatorTests.java trunk/examples/family/father.conf trunk/scripts/src/main/java/org/dllearner/scripts/ConfigJavaGenerator.java trunk/scripts/src/main/java/org/dllearner/scripts/DumbLPFinder.java trunk/scripts/src/main/java/org/dllearner/scripts/NewSample.java trunk/scripts/src/main/java/org/dllearner/scripts/SemanticBibleComparison.java trunk/scripts/src/main/java/org/dllearner/scripts/WikipediaCategoryCleaner.java trunk/scripts/src/main/java/org/dllearner/scripts/tiger/TestIterativeLearning.java Removed Paths: ------------- trunk/components-core/src/main/java/org/dllearner/core/configurators/OCELConfigurator.java Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java 2011-08-24 09:14:11 UTC (rev 3107) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java 2011-08-24 09:34:32 UTC (rev 3108) @@ -229,8 +229,26 @@ singleSuggestionMode = configurator.getSingleSuggestionMode(); + // TODO: 1. turn those into instance variables / fields 2. provide getters/setters; + // 3. annotate them with @ConfigOption => this all needs to be done in FuzzyRhoDRDown, + // not in this class + boolean useExistsConstructor = true; + int valueFrequencyThreshold = 2; + boolean useCardinalityRestrictions = false; + int cardinalityLimit = 1; + boolean useHasValueConstructor = false; + boolean useNegation = true; + boolean useStringDatatypes = false; + boolean useBooleanDatatypes = false; + boolean useDoubleDatatypes = false; + boolean instanceBasedDisjoints = true; + boolean applyAllFilter = true; + boolean applyExistsFilter = true; + boolean useAllConstructor = true; + // create refinement operator - operator = new FuzzyRhoDRDown(reasoner, classHierarchy, startClass, configurator); + operator = new FuzzyRhoDRDown(reasoner, classHierarchy, cardinalityLimit, useHasValueConstructor, useStringDatatypes, instanceBasedDisjoints, applyAllFilter, applyExistsFilter, useAllConstructor, + useExistsConstructor, valueFrequencyThreshold, useCardinalityRestrictions, useNegation, useBooleanDatatypes, useDoubleDatatypes, (NamedClass) startClass); baseURI = reasoner.getBaseURI(); prefixes = reasoner.getPrefixes(); if(configurator.getWriteSearchTree()) { Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/ExampleBasedNode.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/ExampleBasedNode.java 2011-08-24 09:14:11 UTC (rev 3107) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/ExampleBasedNode.java 2011-08-24 09:34:32 UTC (rev 3108) @@ -26,7 +26,6 @@ import java.util.TreeSet; import org.dllearner.algorithms.SearchTreeNode; -import org.dllearner.core.configurators.OCELConfigurator; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.utilities.owl.ConceptComparator; @@ -45,7 +44,7 @@ // public static long exampleMemoryCounter = 0; - private OCELConfigurator configurator; +// private OCELConfigurator configurator; private static DecimalFormat df = new DecimalFormat(); @@ -68,6 +67,11 @@ private boolean isQualityEvaluated; private boolean isRedundant; + private double negativeWeight; + private double startNodeBonus; + private double expansionPenaltyFactor; + private int negationPenalty; + private static ConceptComparator conceptComparator = new ConceptComparator(); private static NodeComparatorStable nodeComparator = new NodeComparatorStable(); @@ -80,11 +84,15 @@ // a flag whether this could be a solution for a posonly learning problem private boolean isPosOnlyCandidate = true; - public ExampleBasedNode(OCELConfigurator configurator, Description concept) { - this.configurator = configurator; + public ExampleBasedNode(Description concept, double negativeWeight, double startNodeBonus, double expansionPenaltyFactor, int negationPenalty) { +// this.configurator = configurator; this.concept = concept; horizontalExpansion = 0; isQualityEvaluated = false; + this.negativeWeight = negativeWeight; + this.startNodeBonus = startNodeBonus; + this.expansionPenaltyFactor = expansionPenaltyFactor; + this.negationPenalty = negationPenalty; } public void setHorizontalExpansion(int horizontalExpansion) { @@ -180,7 +188,7 @@ ret += "acc:" + df.format(accuracy) + "% "; // comment this out to display the heuristic score with default parameters - double heuristicScore = MultiHeuristic.getNodeScore(this, nrOfPositiveExamples, nrOfNegativeExamples, configurator); + double heuristicScore = MultiHeuristic.getNodeScore(this, nrOfPositiveExamples, nrOfNegativeExamples, negativeWeight, startNodeBonus, expansionPenaltyFactor, negationPenalty); ret += "h:" +df.format(heuristicScore) + " "; int wrongPositives = nrOfPositiveExamples - coveredPositives.size(); @@ -203,7 +211,7 @@ ret += "<b>acc: " + df.format(accuracy) + "% </b>"; // comment this out to display the heuristic score with default parameters - double heuristicScore = MultiHeuristic.getNodeScore(this, nrOfPositiveExamples, nrOfNegativeExamples, configurator); + double heuristicScore = MultiHeuristic.getNodeScore(this, nrOfPositiveExamples, nrOfNegativeExamples, negativeWeight, startNodeBonus, expansionPenaltyFactor, negationPenalty); ret += "h:" +df.format(heuristicScore) + " "; int wrongPositives = nrOfPositiveExamples - coveredPositives.size(); @@ -227,7 +235,7 @@ ret += "acc:" + df.format(accuracy) + "% "; // comment this out to display the heuristic score with default parameters - double heuristicScore = MultiHeuristic.getNodeScore(this, nrOfPositiveExamples, nrOfNegativeExamples, configurator); + double heuristicScore = MultiHeuristic.getNodeScore(this, nrOfPositiveExamples, nrOfNegativeExamples, negativeWeight, startNodeBonus, expansionPenaltyFactor, negationPenalty); ret += "h:" +df.format(heuristicScore) + " "; int wrongPositives = nrOfPositiveExamples - coveredPositives.size(); Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/MultiHeuristic.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/MultiHeuristic.java 2011-08-24 09:14:11 UTC (rev 3107) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/MultiHeuristic.java 2011-08-24 09:34:32 UTC (rev 3108) @@ -21,7 +21,6 @@ import java.util.List; -import org.dllearner.core.configurators.OCELConfigurator; import org.dllearner.core.owl.DatatypeSomeRestriction; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Negation; @@ -70,7 +69,7 @@ public class MultiHeuristic implements ExampleBasedHeuristic { private ConceptComparator conceptComparator = new ConceptComparator(); - private OCELConfigurator configurator; +// private OCELConfigurator configurator; // heuristic parameters private double expansionPenaltyFactor = 0.02; @@ -80,6 +79,7 @@ // penalise errors on positive examples harder than on negative examples // (positive weight = 1) private double negativeWeight = 1.0; // was 0.8; + private int negationPenalty = 0; // examples private int nrOfNegativeExamples; @@ -92,13 +92,13 @@ // this(nrOfPositiveExamples, nrOfNegativeExamples, 0.02, 0.5); } - public MultiHeuristic(int nrOfPositiveExamples, int nrOfNegativeExamples, OCELConfigurator configurator) { + public MultiHeuristic(int nrOfPositiveExamples, int nrOfNegativeExamples, double negativeWeight, double startNodeBonus, double expansionPenaltyFactor, int negationPenalty) { this.nrOfNegativeExamples = nrOfNegativeExamples; nrOfExamples = nrOfPositiveExamples + nrOfNegativeExamples; - this.configurator = configurator; - negativeWeight = configurator.getNegativeWeight(); - startNodeBonus = configurator.getStartNodeBonus(); - expansionPenaltyFactor = configurator.getExpansionPenaltyFactor(); +// this.configurator = configurator; + this.negativeWeight = negativeWeight; + this.startNodeBonus = startNodeBonus; + this.expansionPenaltyFactor = expansionPenaltyFactor; } // public MultiHeuristic(int nrOfPositiveExamples, int nrOfNegativeExamples, double expansionPenaltyFactor, double gainBonusFactor) { @@ -144,8 +144,8 @@ return (coveredPositives + negativeWeight * (nrOfNegativeExamples - coveredNegatives))/(double)nrOfExamples; } - public static double getNodeScore(ExampleBasedNode node, int nrOfPositiveExamples, int nrOfNegativeExamples, OCELConfigurator configurator) { - MultiHeuristic multi = new MultiHeuristic(nrOfPositiveExamples, nrOfNegativeExamples, configurator); + public static double getNodeScore(ExampleBasedNode node, int nrOfPositiveExamples, int nrOfNegativeExamples, double negativeWeight, double startNodeBonus, double expansionPenaltyFactor, int negationPenalty) { + MultiHeuristic multi = new MultiHeuristic(nrOfPositiveExamples, nrOfNegativeExamples, negativeWeight, startNodeBonus, expansionPenaltyFactor, negationPenalty); return multi.getNodeScore(node); } @@ -162,7 +162,7 @@ // we put a penalty on negations, because they often overfit // (TODO: make configurable) else if(description instanceof Negation) { - bonus = -configurator.getNegationPenalty(); + bonus = -negationPenalty; } // if(description instanceof BooleanValueRestriction) Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/OCEL.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/OCEL.java 2011-08-24 09:14:11 UTC (rev 3107) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/OCEL.java 2011-08-24 09:34:32 UTC (rev 3108) @@ -28,11 +28,10 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; -import org.dllearner.core.ComponentInitException; import org.dllearner.core.AbstractCELA; import org.dllearner.core.AbstractLearningProblem; import org.dllearner.core.AbstractReasonerComponent; -import org.dllearner.core.configurators.OCELConfigurator; +import org.dllearner.core.ComponentInitException; import org.dllearner.core.options.BooleanConfigOption; import org.dllearner.core.options.CommonConfigMappings; import org.dllearner.core.options.CommonConfigOptions; @@ -82,16 +81,15 @@ */ public class OCEL extends AbstractCELA { - private OCELConfigurator configurator; - - public OCELConfigurator getConfigurator(){ - return configurator; - } +// private OCELConfigurator configurator; +// +// public OCELConfigurator getConfigurator(){ +// return configurator; +// } // actual algorithm private ROLearner2 algorithm; - private static Logger logger = Logger - .getLogger(OCEL.class); + private static Logger logger = Logger.getLogger(OCEL.class); private String logLevel = CommonConfigOptions.logLevelDefault; RhoDRDown operator; @@ -125,6 +123,7 @@ private static double noisePercentageDefault = 0.0; private double noisePercentage = noisePercentageDefault; private NamedClass startClass = null; + private boolean useDataHasValueConstructor = false; //refactor this private static boolean usePropernessChecksDefault = false; private boolean usePropernessChecks = usePropernessChecksDefault; @@ -139,11 +138,20 @@ private int guaranteeXgoodDescriptions = CommonConfigOptions.guaranteeXgoodDescriptionsDefault; private int maxClassDescriptionTests = CommonConfigOptions.maxClassDescriptionTestsDefault; + private double negativeWeight; + private double startNodeBonus; + private double expansionPenaltyFactor; + private int negationPenalty; + private boolean terminateOnNoiseReached = true; + // Variablen zur Einstellung der Protokollierung // boolean quiet = false; boolean showBenchmarkInformation = false; // boolean createTreeString = false; // String searchTree = new String(); + private int cardinalityLimit; + private boolean useStringDatatypes; + private boolean instanceBasedDisjoints; // Konfiguration des Algorithmus // Faktor für horizontale Erweiterung (notwendig für completeness) @@ -153,12 +161,12 @@ // public ROLearner(LearningProblem learningProblem, LearningProblem learningProblem2) { public OCEL(PosNegLP learningProblem, AbstractReasonerComponent reasoningService) { super(learningProblem, reasoningService); - this.configurator = new OCELConfigurator(this); +// this.configurator = new OCELConfigurator(this); } public OCEL(PosOnlyLP learningProblem, AbstractReasonerComponent reasoningService) { super(learningProblem, reasoningService); - this.configurator = new OCELConfigurator(this); +// this.configurator = new OCELConfigurator(this); } public static Collection<Class<? extends AbstractLearningProblem>> supportedLearningProblems() { @@ -332,9 +340,9 @@ } else { if(learningProblem instanceof PosOnlyLP) { // throw new RuntimeException("does not work with positive examples only yet"); - algHeuristic = new MultiHeuristic(((PosOnlyLP)learningProblem).getPositiveExamples().size(),0, configurator); + algHeuristic = new MultiHeuristic(((PosOnlyLP)learningProblem).getPositiveExamples().size(),0, negativeWeight, startNodeBonus, expansionPenaltyFactor, negationPenalty); } else { - algHeuristic = new MultiHeuristic(((PosNegLP)learningProblem).getPositiveExamples().size(),((PosNegLP)learningProblem).getNegativeExamples().size(), configurator); + algHeuristic = new MultiHeuristic(((PosNegLP)learningProblem).getPositiveExamples().size(),((PosNegLP)learningProblem).getNegativeExamples().size(), negativeWeight, startNodeBonus, expansionPenaltyFactor, negationPenalty); } } @@ -392,7 +400,7 @@ operator = new RhoDRDown( reasoner, classHierarchy, - configurator, +// configurator, applyAllFilter, applyExistsFilter, useAllConstructor, @@ -403,13 +411,16 @@ useNegation, useBooleanDatatypes, useDoubleDatatypes, - startClass + startClass, + cardinalityLimit, + useStringDatatypes, + instanceBasedDisjoints ); // create an algorithm object and pass all configuration // options to it algorithm = new ROLearner2( - configurator, +// configurator, learningProblem, reasoner, operator, @@ -430,7 +441,12 @@ minExecutionTimeInSeconds, guaranteeXgoodDescriptions, maxClassDescriptionTests, - forceRefinementLengthIncrease + forceRefinementLengthIncrease, + terminateOnNoiseReached, + negativeWeight, + startNodeBonus, + expansionPenaltyFactor, + negationPenalty ); // note: used concepts and roles do not need to be passed // as argument, because it is sufficient to prepare the @@ -498,4 +514,332 @@ public RhoDRDown getRefinementOperator() { return operator; } + + public RhoDRDown getOperator() { + return operator; + } + + public void setOperator(RhoDRDown operator) { + this.operator = operator; + } + + public boolean isWriteSearchTree() { + return writeSearchTree; + } + + public void setWriteSearchTree(boolean writeSearchTree) { + this.writeSearchTree = writeSearchTree; + } + + public File getSearchTreeFile() { + return searchTreeFile; + } + + public void setSearchTreeFile(File searchTreeFile) { + this.searchTreeFile = searchTreeFile; + } + + public boolean isReplaceSearchTree() { + return replaceSearchTree; + } + + public void setReplaceSearchTree(boolean replaceSearchTree) { + this.replaceSearchTree = replaceSearchTree; + } + + public String getHeuristic() { + return heuristic; + } + + public void setHeuristic(String heuristic) { + this.heuristic = heuristic; + } + + public Set<NamedClass> getAllowedConcepts() { + return allowedConcepts; + } + + public void setAllowedConcepts(Set<NamedClass> allowedConcepts) { + this.allowedConcepts = allowedConcepts; + } + + public Set<ObjectProperty> getAllowedRoles() { + return allowedRoles; + } + + public void setAllowedRoles(Set<ObjectProperty> allowedRoles) { + this.allowedRoles = allowedRoles; + } + + public Set<NamedClass> getIgnoredConcepts() { + return ignoredConcepts; + } + + public void setIgnoredConcepts(Set<NamedClass> ignoredConcepts) { + this.ignoredConcepts = ignoredConcepts; + } + + public Set<ObjectProperty> getIgnoredRoles() { + return ignoredRoles; + } + + public void setIgnoredRoles(Set<ObjectProperty> ignoredRoles) { + this.ignoredRoles = ignoredRoles; + } + + public Set<NamedClass> getUsedConcepts() { + return usedConcepts; + } + + public void setUsedConcepts(Set<NamedClass> usedConcepts) { + this.usedConcepts = usedConcepts; + } + + public Set<ObjectProperty> getUsedRoles() { + return usedRoles; + } + + public void setUsedRoles(Set<ObjectProperty> usedRoles) { + this.usedRoles = usedRoles; + } + + public boolean isApplyAllFilter() { + return applyAllFilter; + } + + public void setApplyAllFilter(boolean applyAllFilter) { + this.applyAllFilter = applyAllFilter; + } + + public boolean isApplyExistsFilter() { + return applyExistsFilter; + } + + public void setApplyExistsFilter(boolean applyExistsFilter) { + this.applyExistsFilter = applyExistsFilter; + } + + public boolean isUseTooWeakList() { + return useTooWeakList; + } + + public void setUseTooWeakList(boolean useTooWeakList) { + this.useTooWeakList = useTooWeakList; + } + + public boolean isUseOverlyGeneralList() { + return useOverlyGeneralList; + } + + public void setUseOverlyGeneralList(boolean useOverlyGeneralList) { + this.useOverlyGeneralList = useOverlyGeneralList; + } + + public boolean isUseShortConceptConstruction() { + return useShortConceptConstruction; + } + + public void setUseShortConceptConstruction(boolean useShortConceptConstruction) { + this.useShortConceptConstruction = useShortConceptConstruction; + } + + public boolean isImproveSubsumptionHierarchy() { + return improveSubsumptionHierarchy; + } + + public void setImproveSubsumptionHierarchy(boolean improveSubsumptionHierarchy) { + this.improveSubsumptionHierarchy = improveSubsumptionHierarchy; + } + + public boolean isUseAllConstructor() { + return useAllConstructor; + } + + public void setUseAllConstructor(boolean useAllConstructor) { + this.useAllConstructor = useAllConstructor; + } + + public boolean isUseExistsConstructor() { + return useExistsConstructor; + } + + public void setUseExistsConstructor(boolean useExistsConstructor) { + this.useExistsConstructor = useExistsConstructor; + } + + public boolean isUseHasValueConstructor() { + return useHasValueConstructor; + } + + public void setUseHasValueConstructor(boolean useHasValueConstructor) { + this.useHasValueConstructor = useHasValueConstructor; + } + + public int getValueFrequencyThreshold() { + return valueFrequencyThreshold; + } + + public void setValueFrequencyThreshold(int valueFrequencyThreshold) { + this.valueFrequencyThreshold = valueFrequencyThreshold; + } + + public boolean isUseCardinalityRestrictions() { + return useCardinalityRestrictions; + } + + public void setUseCardinalityRestrictions(boolean useCardinalityRestrictions) { + this.useCardinalityRestrictions = useCardinalityRestrictions; + } + + public boolean isUseNegation() { + return useNegation; + } + + public void setUseNegation(boolean useNegation) { + this.useNegation = useNegation; + } + + public boolean isUseBooleanDatatypes() { + return useBooleanDatatypes; + } + + public void setUseBooleanDatatypes(boolean useBooleanDatatypes) { + this.useBooleanDatatypes = useBooleanDatatypes; + } + + public boolean isUseDoubleDatatypes() { + return useDoubleDatatypes; + } + + public void setUseDoubleDatatypes(boolean useDoubleDatatypes) { + this.useDoubleDatatypes = useDoubleDatatypes; + } + + public double getNoisePercentage() { + return noisePercentage; + } + + public void setNoisePercentage(double noisePercentage) { + this.noisePercentage = noisePercentage; + } + + public NamedClass getStartClass() { + return startClass; + } + + public void setStartClass(NamedClass startClass) { + this.startClass = startClass; + } + + public boolean isUsePropernessChecks() { + return usePropernessChecks; + } + + public void setUsePropernessChecks(boolean usePropernessChecks) { + this.usePropernessChecks = usePropernessChecks; + } + + public int getMaxPosOnlyExpansion() { + return maxPosOnlyExpansion; + } + + public void setMaxPosOnlyExpansion(int maxPosOnlyExpansion) { + this.maxPosOnlyExpansion = maxPosOnlyExpansion; + } + + public boolean isForceRefinementLengthIncrease() { + return forceRefinementLengthIncrease; + } + + public void setForceRefinementLengthIncrease(boolean forceRefinementLengthIncrease) { + this.forceRefinementLengthIncrease = forceRefinementLengthIncrease; + } + + public int getMaxExecutionTimeInSeconds() { + return maxExecutionTimeInSeconds; + } + + public void setMaxExecutionTimeInSeconds(int maxExecutionTimeInSeconds) { + this.maxExecutionTimeInSeconds = maxExecutionTimeInSeconds; + } + + public int getMinExecutionTimeInSeconds() { + return minExecutionTimeInSeconds; + } + + public void setMinExecutionTimeInSeconds(int minExecutionTimeInSeconds) { + this.minExecutionTimeInSeconds = minExecutionTimeInSeconds; + } + + public int getGuaranteeXgoodDescriptions() { + return guaranteeXgoodDescriptions; + } + + public void setGuaranteeXgoodDescriptions(int guaranteeXgoodDescriptions) { + this.guaranteeXgoodDescriptions = guaranteeXgoodDescriptions; + } + + public int getMaxClassDescriptionTests() { + return maxClassDescriptionTests; + } + + public void setMaxClassDescriptionTests(int maxClassDescriptionTests) { + this.maxClassDescriptionTests = maxClassDescriptionTests; + } + + public boolean isShowBenchmarkInformation() { + return showBenchmarkInformation; + } + + public void setShowBenchmarkInformation(boolean showBenchmarkInformation) { + this.showBenchmarkInformation = showBenchmarkInformation; + } + + public double getNegativeWeight() { + return negativeWeight; + } + + public void setNegativeWeight(double negativeWeight) { + this.negativeWeight = negativeWeight; + } + + public double getStartNodeBonus() { + return startNodeBonus; + } + + public void setStartNodeBonus(double startNodeBonus) { + this.startNodeBonus = startNodeBonus; + } + + public double getExpansionPenaltyFactor() { + return expansionPenaltyFactor; + } + + public void setExpansionPenaltyFactor(double expansionPenaltyFactor) { + this.expansionPenaltyFactor = expansionPenaltyFactor; + } + + public double getNegationPenalty() { + return negationPenalty; + } + + public void setNegationPenalty(int negationPenalty) { + this.negationPenalty = negationPenalty; + } + + public boolean isUseDataHasValueConstructor() { + return useDataHasValueConstructor; + } + + public void setUseDataHasValueConstructor(boolean useDataHasValueConstructor) { + this.useDataHasValueConstructor = useDataHasValueConstructor; + } + + public boolean isTerminateOnNoiseReached() { + return terminateOnNoiseReached; + } + + public void setTerminateOnNoiseReached(boolean terminateOnNoiseReached) { + this.terminateOnNoiseReached = terminateOnNoiseReached; + } } Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/ROLearner2.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/ROLearner2.java 2011-08-24 09:14:11 UTC (rev 3107) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/ROLearner2.java 2011-08-24 09:34:32 UTC (rev 3108) @@ -35,7 +35,6 @@ import org.apache.log4j.Logger; import org.dllearner.core.AbstractLearningProblem; import org.dllearner.core.AbstractReasonerComponent; -import org.dllearner.core.configurators.OCELConfigurator; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.Intersection; @@ -64,7 +63,7 @@ public class ROLearner2 { private static Logger logger = Logger.getLogger(ROLearner2.class); - private OCELConfigurator configurator; +// private OCELConfigurator configurator; // basic setup: learning problem and reasoning service private AbstractReasonerComponent rs; @@ -211,8 +210,18 @@ private String baseURI; private Map<String, String> prefixes; + private boolean terminateOnNoiseReached; + + private double negativeWeight; + + private double startNodeBonus; + + private double expansionPenaltyFactor; + + private int negationPenalty; + public ROLearner2( - OCELConfigurator configurator, +// OCELConfigurator configurator, AbstractLearningProblem learningProblem, AbstractReasonerComponent rs, RefinementOperator operator, @@ -224,7 +233,9 @@ boolean useTooWeakList, boolean useOverlyGeneralList, boolean useShortConceptConstruction, boolean usePropernessChecks, int maxPosOnlyExpansion, int maxExecutionTimeInSeconds, int minExecutionTimeInSeconds, - int guaranteeXgoodDescriptions, int maxClassDescriptionTests, boolean forceRefinementLengthIncrease) { + int guaranteeXgoodDescriptions, int maxClassDescriptionTests, boolean forceRefinementLengthIncrease, + boolean terminateOnNoiseReached, + double negativeWeight, double startNodeBonus, double expansionPenaltyFactor, int negationPenalty) { PosNegLP lp = (PosNegLP) learningProblem; @@ -234,11 +245,17 @@ nrOfPositiveExamples = positiveExamples.size(); nrOfNegativeExamples = negativeExamples.size(); + this.negativeWeight = negativeWeight; + this.startNodeBonus = startNodeBonus; + this.expansionPenaltyFactor = expansionPenaltyFactor; + this.negationPenalty = negationPenalty; + // System.out.println(nrOfPositiveExamples); // System.out.println(nrOfNegativeExamples); // System.exit(0); - this.configurator = configurator; +// this.configurator = configurator; + this.terminateOnNoiseReached = terminateOnNoiseReached; nrOfExamples = nrOfPositiveExamples + nrOfNegativeExamples; this.rs = rs; this.operator = (RhoDRDown) operator; @@ -353,10 +370,10 @@ // start search with start class if (startDescription == null) { - startNode = new ExampleBasedNode(configurator, Thing.instance); + startNode = new ExampleBasedNode(Thing.instance, negativeWeight, startNodeBonus, expansionPenaltyFactor, negationPenalty); startNode.setCoveredExamples(positiveExamples, negativeExamples); } else { - startNode = new ExampleBasedNode(configurator, startDescription); + startNode = new ExampleBasedNode(startDescription, negativeWeight, startNodeBonus, expansionPenaltyFactor, negationPenalty); Set<Individual> coveredNegatives = rs.hasType(startDescription, negativeExamples); Set<Individual> coveredPositives = rs.hasType(startDescription, positiveExamples); startNode.setCoveredExamples(coveredPositives, coveredNegatives); @@ -627,7 +644,7 @@ properRefinements.add(refinement); tooWeakList.add(refinement); - ExampleBasedNode newNode = new ExampleBasedNode(configurator, refinement); + ExampleBasedNode newNode = new ExampleBasedNode(refinement, negativeWeight, startNodeBonus, expansionPenaltyFactor, negationPenalty); newNode.setHorizontalExpansion(refinement.getLength() - 1); newNode.setTooWeak(true); newNode @@ -717,7 +734,7 @@ if (nonRedundant) { // newly created node - ExampleBasedNode newNode = new ExampleBasedNode(configurator, refinement); + ExampleBasedNode newNode = new ExampleBasedNode(refinement, negativeWeight, startNodeBonus, expansionPenaltyFactor, negationPenalty); // die -1 ist wichtig, da sonst keine gleich langen Refinements // für den neuen Knoten erlaubt wären z.B. person => male newNode.setHorizontalExpansion(refinement.getLength() - 1); @@ -1326,7 +1343,7 @@ // reached - unless this termination criterion is switched off using terminateOnNoiseReached = false if (guaranteeXgoodAlreadyReached){ result = true; - } else if(solutions.size() >= guaranteeXgoodDescriptions && configurator.getTerminateOnNoiseReached()) { + } else if(solutions.size() >= guaranteeXgoodDescriptions && terminateOnNoiseReached) { if(guaranteeXgoodDescriptions != 1) { logger.info("Minimum number (" + guaranteeXgoodDescriptions + ") of good descriptions reached."); Modified: trunk/components-core/src/main/java/org/dllearner/core/config/BooleanEditor.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/config/BooleanEditor.java 2011-08-24 09:14:11 UTC (rev 3107) +++ trunk/components-core/src/main/java/org/dllearner/core/config/BooleanEditor.java 2011-08-24 09:34:32 UTC (rev 3108) @@ -8,6 +8,8 @@ public class BooleanEditor implements PropertyEditor { + private Boolean value; + @Override public void addPropertyChangeListener(PropertyChangeListener listener) { // TODO Auto-generated method stub @@ -16,8 +18,7 @@ @Override public String getAsText() { - // TODO Auto-generated method stub - return null; + return value.toString(); } @Override @@ -64,8 +65,7 @@ @Override public void setAsText(String text) throws IllegalArgumentException { - // TODO Auto-generated method stub - + value = Boolean.valueOf(text); } @Override Modified: trunk/components-core/src/main/java/org/dllearner/core/configurators/ComponentFactory.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/configurators/ComponentFactory.java 2011-08-24 09:14:11 UTC (rev 3107) +++ trunk/components-core/src/main/java/org/dllearner/core/configurators/ComponentFactory.java 2011-08-24 09:34:32 UTC (rev 3108) @@ -290,9 +290,9 @@ * @throws LearningProblemUnsupportedException see * @return a component ready for initialization OCEL **/ -public static OCEL getOCEL(AbstractLearningProblem learningProblem, AbstractReasonerComponent reasoningService) throws LearningProblemUnsupportedException { -return OCELConfigurator.getOCEL(learningProblem, reasoningService); -} +//public static OCEL getOCEL(AbstractLearningProblem learningProblem, AbstractReasonerComponent reasoningService) throws LearningProblemUnsupportedException { +//return OCELConfigurator.getOCEL(learningProblem, reasoningService); +//} /** * @param learningProblem see LearningProblem Deleted: trunk/components-core/src/main/java/org/dllearner/core/configurators/OCELConfigurator.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/configurators/OCELConfigurator.java 2011-08-24 09:14:11 UTC (rev 3107) +++ trunk/components-core/src/main/java/org/dllearner/core/configurators/OCELConfigurator.java 2011-08-24 09:34:32 UTC (rev 3108) @@ -1,811 +0,0 @@ -/** - * Copyright (C) 2007-2011, Jens Lehmann - * - * This file is part of DL-Learner. - * - * DL-Learner is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * DL-Learner is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -package org.dllearner.core.configurators; - -import java.util.Set; -import org.dllearner.algorithms.ocel.OCEL; -import org.dllearner.core.ComponentManager; -import org.dllearner.core.AbstractLearningProblem; -import org.dllearner.core.LearningProblemUnsupportedException; -import org.dllearner.core.AbstractReasonerComponent; -import org.dllearner.core.configurators.RefinementOperatorConfigurator; - -/** -* automatically generated, do not edit manually. -* run org.dllearner.scripts.ConfigJavaGenerator to update -**/ -@SuppressWarnings("all") -public class OCELConfigurator extends RefinementOperatorConfigurator implements Configurator { - -private boolean reinitNecessary = false; -private OCEL oCEL; - -/** -* @param oCEL see OCEL -**/ -public OCELConfigurator(OCEL oCEL){ -this.oCEL = oCEL; -} - -/** -* @param reasoningService see reasoningService -* @param learningProblem see learningProblem -* @throws LearningProblemUnsupportedException see -* @return OCEL -**/ -public static OCEL getOCEL(AbstractLearningProblem learningProblem, AbstractReasonerComponent reasoningService) throws LearningProblemUnsupportedException{ -OCEL component = ComponentManager.getInstance().learningAlgorithm(OCEL.class, learningProblem, reasoningService); -return component; -} - -/** -* writeSearchTree specifies whether to write a search tree. -* mandatory: false| reinit necessary: true -* default value: false -* @return boolean -**/ -public boolean getWriteSearchTree() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "writeSearchTree") ; -} -/** -* searchTreeFile file to use for the search tree. -* mandatory: false| reinit necessary: true -* default value: log/searchTree.txt -* @return String -**/ -public String getSearchTreeFile() { -return (String) ComponentManager.getInstance().getConfigOptionValue(oCEL, "searchTreeFile") ; -} -/** -* replaceSearchTree specifies whether to replace the search tree in the log file after each run or append the new search tree. -* mandatory: false| reinit necessary: true -* default value: false -* @return boolean -**/ -public boolean getReplaceSearchTree() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "replaceSearchTree") ; -} -/** -* heuristic specifiy the heuristic to use. -* mandatory: false| reinit necessary: true -* default value: lexicographic -* @return String -**/ -public String getHeuristic() { -return (String) ComponentManager.getInstance().getConfigOptionValue(oCEL, "heuristic") ; -} -/** -* applyAllFilter usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D). -* mandatory: false| reinit necessary: true -* default value: true -* @return boolean -**/ -public boolean getApplyAllFilter() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "applyAllFilter") ; -} -/** -* applyExistsFilter usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D). -* mandatory: false| reinit necessary: true -* default value: true -* @return boolean -**/ -public boolean getApplyExistsFilter() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "applyExistsFilter") ; -} -/** -* useTooWeakList try to filter out too weak concepts without sending them to the reasoner. -* mandatory: false| reinit necessary: true -* default value: true -* @return boolean -**/ -public boolean getUseTooWeakList() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "useTooWeakList") ; -} -/** -* useOverlyGeneralList try to find overly general concept without sending them to the reasoner. -* mandatory: false| reinit necessary: true -* default value: true -* @return boolean -**/ -public boolean getUseOverlyGeneralList() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "useOverlyGeneralList") ; -} -/** -* useShortConceptConstruction shorten concept to see whether they already exist. -* mandatory: false| reinit necessary: true -* default value: true -* @return boolean -**/ -public boolean getUseShortConceptConstruction() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "useShortConceptConstruction") ; -} -/** -* horizontalExpansionFactor horizontal expansion factor (see publication for description). -* mandatory: false| reinit necessary: true -* default value: 0.6 -* @return double -**/ -public double getHorizontalExpansionFactor() { -return (Double) ComponentManager.getInstance().getConfigOptionValue(oCEL, "horizontalExpansionFactor") ; -} -/** -* improveSubsumptionHierarchy simplify subsumption hierarchy to reduce search space (see publication for description). -* mandatory: false| reinit necessary: true -* default value: true -* @return boolean -**/ -public boolean getImproveSubsumptionHierarchy() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "improveSubsumptionHierarchy") ; -} -/** -* allowedConcepts concepts the algorithm is allowed to use. -* mandatory: false| reinit necessary: true -* default value: null -* @return Set(String) -**/ -@SuppressWarnings("unchecked") -public Set<String> getAllowedConcepts() { -return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(oCEL, "allowedConcepts") ; -} -/** -* ignoredConcepts concepts the algorithm must ignore. -* mandatory: false| reinit necessary: true -* default value: null -* @return Set(String) -**/ -@SuppressWarnings("unchecked") -public Set<String> getIgnoredConcepts() { -return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(oCEL, "ignoredConcepts") ; -} -/** -* allowedRoles roles the algorithm is allowed to use. -* mandatory: false| reinit necessary: true -* default value: null -* @return Set(String) -**/ -@SuppressWarnings("unchecked") -public Set<String> getAllowedRoles() { -return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(oCEL, "allowedRoles") ; -} -/** -* ignoredRoles roles the algorithm must ignore. -* mandatory: false| reinit necessary: true -* default value: null -* @return Set(String) -**/ -@SuppressWarnings("unchecked") -public Set<String> getIgnoredRoles() { -return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(oCEL, "ignoredRoles") ; -} -/** -* useAllConstructor specifies whether the universal concept constructor is used in the learning algorithm. -* mandatory: false| reinit necessary: true -* default value: true -* @return boolean -**/ -public boolean getUseAllConstructor() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "useAllConstructor") ; -} -/** -* useExistsConstructor specifies whether the existential concept constructor is used in the learning algorithm. -* mandatory: false| reinit necessary: true -* default value: true -* @return boolean -**/ -public boolean getUseExistsConstructor() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "useExistsConstructor") ; -} -/** -* useHasValueConstructor specifies whether the hasValue constructor is used in the learning algorithm. -* mandatory: false| reinit necessary: true -* default value: false -* @return boolean -**/ -public boolean getUseHasValueConstructor() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "useHasValueConstructor") ; -} -/** -* useDataHasValueConstructor specifies whether the hasValue constructor is used in the learning algorithm in combination with data properties. -* mandatory: false| reinit necessary: true -* default value: false -* @return boolean -**/ -public boolean getUseDataHasValueConstructor() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "useDataHasValueConstructor") ; -} -/** -* valueFrequencyThreshold specifies how often an object must occur as value in order to be considered for hasValue restrictions. -* mandatory: false| reinit necessary: true -* default value: 3 -* @return int -**/ -public int getValueFrequencyThreshold() { -return (Integer) ComponentManager.getInstance().getConfigOptionValue(oCEL, "valueFrequencyThreshold") ; -} -/** -* useCardinalityRestrictions specifies whether CardinalityRestrictions is used in the learning algorithm. -* mandatory: false| reinit necessary: true -* default value: true -* @return boolean -**/ -public boolean getUseCardinalityRestrictions() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "useCardinalityRestrictions") ; -} -/** -* cardinalityLimit Gives the maximum number used in cardinality restrictions.. -* mandatory: false| reinit necessary: true -* default value: 5 -* @return int -**/ -public int getCardinalityLimit() { -return (Integer) ComponentManager.getInstance().getConfigOptionValue(oCEL, "cardinalityLimit") ; -} -/** -* useNegation specifies whether negation is used in the learning algorothm. -* mandatory: false| reinit necessary: true -* default value: true -* @return boolean -**/ -public boolean getUseNegation() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "useNegation") ; -} -/** -* useBooleanDatatypes specifies whether boolean datatypes are used in the learning algorothm. -* mandatory: false| reinit necessary: true -* default value: true -* @return boolean -**/ -public boolean getUseBooleanDatatypes() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "useBooleanDatatypes") ; -} -/** -* useDoubleDatatypes specifies whether double datatypes are used in the learning algorothm. -* mandatory: false| reinit necessary: true -* default value: true -* @return boolean -**/ -public boolean getUseDoubleDatatypes() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "useDoubleDatatypes") ; -} -/** -* useStringDatatypes specifies whether string datatypes are used in the learning algorothm. -* mandatory: false| reinit necessary: true -* default value: false -* @return boolean -**/ -public boolean getUseStringDatatypes() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "useStringDatatypes") ; -} -/** -* maxExecutionTimeInSeconds algorithm will stop after specified seconds. -* mandatory: false| reinit necessary: true -* default value: 0 -* @return int -**/ -public int getMaxExecutionTimeInSeconds() { -return (Integer) ComponentManager.getInstance().getConfigOptionValue(oCEL, "maxExecutionTimeInSeconds") ; -} -/** -* minExecutionTimeInSeconds algorithm will run at least specified seconds. -* mandatory: false| reinit necessary: true -* default value: 0 -* @return int -**/ -public int getMinExecutionTimeInSeconds() { -return (Integer) ComponentManager.getInstance().getConfigOptionValue(oCEL, "minExecutionTimeInSeconds") ; -} -/** -* guaranteeXgoodDescriptions algorithm will run until X good (100%) concept descritpions are found. -* mandatory: false| reinit necessary: true -* default value: 1 -* @return int -**/ -public int getGuaranteeXgoodDescriptions() { -return (Integer) ComponentManager.getInstance().getConfigOptionValue(oCEL, "guaranteeXgoodDescriptions") ; -} -/** -* maxClassDescriptionTests The maximum number of candidate hypothesis the algorithm is allowed to test (0 = no limit). The algorithm will stop afterwards. (The real number of tests can be slightly higher, because this criterion usually won't be checked after each single test.). -* mandatory: false| reinit necessary: true -* default value: 0 -* @return int -**/ -public int getMaxClassDescriptionTests() { -return (Integer) ComponentManager.getInstance().getConfigOptionValue(oCEL, "maxClassDescriptionTests") ; -} -/** -* logLevel determines the logLevel for this component, can be {TRACE, DEBUG, INFO}. -* mandatory: false| reinit necessary: true -* default value: DEBUG -* @return String -**/ -public String getLogLevel() { -return (String) ComponentManager.getInstance().getConfigOptionValue(oCEL, "logLevel") ; -} -/** -* usePropernessChecks specifies whether to check for equivalence (i.e. discard equivalent refinements). -* mandatory: false| reinit necessary: true -* default value: false -* @return boolean -**/ -public boolean getUsePropernessChecks() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "usePropernessChecks") ; -} -/** -* noisePercentage the (approximated) percentage of noise within the examples. -* mandatory: false| reinit necessary: true -* default value: 0.0 -* @return double -**/ -public double getNoisePercentage() { -return (Double) ComponentManager.getInstance().getConfigOptionValue(oCEL, "noisePercentage") ; -} -/** -* terminateOnNoiseReached specifies whether to terminate when noise criterion is met. -* mandatory: false| reinit necessary: true -* default value: true -* @return boolean -**/ -public boolean getTerminateOnNoiseReached() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "terminateOnNoiseReached") ; -} -/** -* startClass the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class). -* mandatory: false| reinit necessary: true -* default value: null -* @return String -**/ -public String getStartClass() { -return (String) ComponentManager.getInstance().getConfigOptionValue(oCEL, "startClass") ; -} -/** -* forceRefinementLengthIncrease specifies whether nodes should be expanded until only longer refinements are reached. -* mandatory: false| reinit necessary: true -* default value: null -* @return boolean -**/ -public boolean getForceRefinementLengthIncrease() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "forceRefinementLengthIncrease") ; -} -/** -* negativeWeight Used to penalise errors on negative examples different from those of positive examples (lower = less importance for negatives).. -* mandatory: false| reinit necessary: true -* default value: 1.0 -* @return double -**/ -public double getNegativeWeight() { -return (Double) ComponentManager.getInstance().getConfigOptionValue(oCEL, "negativeWeight") ; -} -/** -* startNodeBonus You can use this to give a heuristic bonus on the start node (= initially broader exploration of search space).. -* mandatory: false| reinit necessary: true -* default value: 0.0 -* @return double -**/ -public double getStartNodeBonus() { -return (Double) ComponentManager.getInstance().getConfigOptionValue(oCEL, "startNodeBonus") ; -} -/** -* negationPenalty Penalty on negations (TODO: better explanation).. -* mandatory: false| reinit necessary: true -* default value: 0 -* @return int -**/ -public int getNegationPenalty() { -return (Integer) ComponentManager.getInstance().getConfigOptionValue(oCEL, "negationPenalty") ; -} -/** -* expansionPenaltyFactor describes the reduction in heuristic score one is willing to accept for reducing the length of the concept by one. -* mandatory: false| reinit necessary: true -* default value: 0.02 -* @return double -**/ -public double getExpansionPenaltyFactor() { -return (Double) ComponentManager.getInstance().getConfigOptionValue(oCEL, "expansionPenaltyFactor") ; -} -/** -* instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator.. -* mandatory: false| reinit necessary: true -* default value: true -* @return boolean -**/ -public boolean getInstanceBasedDisjoints() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(oCEL, "instanceBasedDisjoints") ; -} - -/** -* @param writeSearchTree specifies whether to write a search tree. -* mandatory: false| reinit necessary: true -* default value: false -**/ -public void setWriteSearchTree(boolean writeSearchTree) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "writeSearchTree", writeSearchTree); -reinitNecessary = true; -} -/** -* @param searchTreeFile file to use for the search tree. -* mandatory: false| reinit necessary: true -* default value: log/searchTree.txt -**/ -public void setSearchTreeFile(String searchTreeFile) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "searchTreeFile", searchTreeFile); -reinitNecessary = true; -} -/** -* @param replaceSearchTree specifies whether to replace the search tree in the log file after each run or append the new search tree. -* mandatory: false| reinit necessary: true -* default value: false -**/ -public void setReplaceSearchTree(boolean replaceSearchTree) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "replaceSearchTree", replaceSearchTree); -reinitNecessary = true; -} -/** -* @param heuristic specifiy the heuristic to use. -* mandatory: false| reinit necessary: true -* default value: lexicographic -**/ -public void setHeuristic(String heuristic) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "heuristic", heuristic); -reinitNecessary = true; -} -/** -* @param applyAllFilter usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D). -* mandatory: false| reinit necessary: true -* default value: true -**/ -public void setApplyAllFilter(boolean applyAllFilter) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "applyAllFilter", applyAllFilter); -reinitNecessary = true; -} -/** -* @param applyExistsFilter usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D). -* mandatory: false| reinit necessary: true -* default value: true -**/ -public void setApplyExistsFilter(boolean applyExistsFilter) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "applyExistsFilter", applyExistsFilter); -reinitNecessary = true; -} -/** -* @param useTooWeakList try to filter out too weak concepts without sending them to the reasoner. -* mandatory: false| reinit necessary: true -* default value: true -**/ -public void setUseTooWeakList(boolean useTooWeakList) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "useTooWeakList", useTooWeakList); -reinitNecessary = true; -} -/** -* @param useOverlyGeneralList try to find overly general concept without sending them to the reasoner. -* mandatory: false| reinit necessary: true -* default value: true -**/ -public void setUseOverlyGeneralList(boolean useOverlyGeneralList) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "useOverlyGeneralList", useOverlyGeneralList); -reinitNecessary = true; -} -/** -* @param useShortConceptConstruction shorten concept to see whether they already exist. -* mandatory: false| reinit necessary: true -* default value: true -**/ -public void setUseShortConceptConstruction(boolean useShortConceptConstruction) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "useShortConceptConstruction", useShortConceptConstruction); -reinitNecessary = true; -} -/** -* @param horizontalExpansionFactor horizontal expansion factor (see publication for description). -* mandatory: false| reinit necessary: true -* default value: 0.6 -**/ -public void setHorizontalExpansionFactor(double horizontalExpansionFactor) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "horizontalExpansionFactor", horizontalExpansionFactor); -reinitNecessary = true; -} -/** -* @param improveSubsumptionHierarchy simplify subsumption hierarchy to reduce search space (see publication for description). -* mandatory: false| reinit necessary: true -* default value: true -**/ -public void setImproveSubsumptionHierarchy(boolean improveSubsumptionHierarchy) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "improveSubsumptionHierarchy", improveSubsumptionHierarchy); -reinitNecessary = true; -} -/** -* @param allowedConcepts concepts the algorithm is allowed to use. -* mandatory: false| reinit necessary: true -* default value: null -**/ -public void setAllowedConcepts(Set<String> allowedConcepts) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "allowedConcepts", allowedConcepts); -reinitNecessary = true; -} -/** -* @param ignoredConcepts concepts the algorithm must ignore. -* mandatory: false| reinit necessary: true -* default value: null -**/ -public void setIgnoredConcepts(Set<String> ignoredConcepts) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "ignoredConcepts", ignoredConcepts); -reinitNecessary = true; -} -/** -* @param allowedRoles roles the algorithm is allowed to use. -* mandatory: false| reinit necessary: true -* default value: null -**/ -public void setAllowedRoles(Set<String> allowedRoles) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "allowedRoles", allowedRoles); -reinitNecessary = true; -} -/** -* @param ignoredRoles roles the algorithm must ignore. -* mandatory: false| reinit necessary: true -* default value: null -**/ -public void setIgnoredRoles(Set<String> ignoredRoles) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "ignoredRoles", ignoredRoles); -reinitNecessary = true; -} -/** -* @param useAllConstructor specifies whether the universal concept constructor is used in the learning algorithm. -* mandatory: false| reinit necessary: true -* default value: true -**/ -public void setUseAllConstructor(boolean useAllConstructor) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "useAllConstructor", useAllConstructor); -reinitNecessary = true; -} -/** -* @param useExistsConstructor specifies whether the existential concept constructor is used in the learning algorithm. -* mandatory: false| reinit necessary: true -* default value: true -**/ -public void setUseExistsConstructor(boolean useExistsConstructor) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "useExistsConstructor", useExistsConstructor); -reinitNecessary = true; -} -/** -* @param useHasValueConstructor specifies whether the hasValue constructor is used in the learning algorithm. -* mandatory: false| reinit necessary: true -* default value: false -**/ -public void setUseHasValueConstructor(boolean useHasValueConstructor) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "useHasValueConstructor", useHasValueConstructor); -reinitNecessary = true; -} -/** -* @param useDataHasValueConstructor specifies whether the hasValue constructor is used in the learning algorithm in combination with data properties. -* mandatory: false| reinit necessary: true -* default value: false -**/ -public void setUseDataHasValueConstructor(boolean useDataHasValueConstructor) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "useDataHasValueConstructor", useDataHasValueConstructor); -reinitNecessary = true; -} -/** -* @param valueFrequencyThreshold specifies how often an object must occur as value in order to be considered for hasValue restrictions. -* mandatory: false| reinit necessary: true -* default value: 3 -**/ -public void setValueFrequencyThreshold(int valueFrequencyThreshold) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "valueFrequencyThreshold", valueFrequencyThreshold); -reinitNecessary = true; -} -/** -* @param useCardinalityRestrictions specifies whether CardinalityRestrictions is used in the learning algorithm. -* mandatory: false| reinit necessary: true -* default value: true -**/ -public void setUseCardinalityRestrictions(boolean useCardinalityRestrictions) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "useCardinalityRestrictions", useCardinalityRestrictions); -reinitNecessary = true; -} -/** -* @param cardinalityLimit Gives the maximum number used in cardinality restrictions.. -* mandatory: false| reinit necessary: true -* default value: 5 -**/ -public void setCardinalityLimit(int cardinalityLimit) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "cardinalityLimit", cardinalityLimit); -reinitNecessary = true; -} -/** -* @param useNegation specifies whether negation is used in the learning algorothm. -* mandatory: false| reinit necessary: true -* default value: true -**/ -public void setUseNegation(boolean useNegation) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "useNegation", useNegation); -reinitNecessary = true; -} -/** -* @param useBooleanDatatypes specifies whether boolean datatypes are used in the learning algorothm. -* mandatory: false| reinit necessary: true -* default value: true -**/ -public void setUseBooleanDatatypes(boolean useBooleanDatatypes) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "useBooleanDatatypes", useBooleanDatatypes); -reinitNecessary = true; -} -/** -* @param useDoubleDatatypes specifies whether double datatypes are used in the learning algorothm. -* mandatory: false| reinit necessary: true -* default value: true -**/ -public void setUseDoubleDatatypes(boolean useDoubleDatatypes) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "useDoubleDatatypes", useDoubleDatatypes); -reinitNecessary = true; -} -/** -* @param useStringDatatypes specifies whether string datatypes are used in the learning algorothm. -* mandatory: false| reinit necessary: true -* default value: false -**/ -public void setUseStringDatatypes(boolean useStringDatatypes) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "useStringDatatypes", useStringDatatypes); -reinitNecessary = true; -} -/** -* @param maxExecutionTimeInSeconds algorithm will stop after specified seconds. -* mandatory: false| reinit necessary: true -* default value: 0 -**/ -public void setMaxExecutionTimeInSeconds(int maxExecutionTimeInSeconds) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "maxExecutionTimeInSeconds", maxExecutionTimeInSeconds); -reinitNecessary = true; -} -/** -* @param minExecutionTimeInSeconds algorithm will run at least specified seconds. -* mandatory: false| reinit necessary: true -* default value: 0 -**/ -public void setMinExecutionTimeInSeconds(int minExecutionTimeInSeconds) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "minExecutionTimeInSeconds", minExecutionTimeInSeconds); -reinitNecessary = true; -} -/** -* @param guaranteeXgoodDescriptions algorithm will run until X good (100%) concept descritpions are found. -* mandatory: false| reinit necessary: true -* default value: 1 -**/ -public void setGuaranteeXgoodDescriptions(int guaranteeXgoodDescriptions) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "guaranteeXgoodDescriptions", guaranteeXgoodDescriptions); -reinitNecessary = true; -} -/** -* @param maxClassDescriptionTests The maximum number of candidate hypothesis the algorithm is allowed to test (0 = no limit). The algorithm will stop afterwards. (The real number of tests can be slightly higher, because this criterion usually won't be checked after each single test.). -* mandatory: false| reinit necessary: true -* default value: 0 -**/ -public void setMaxClassDescriptionTests(int maxClassDescriptionTests) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "maxClassDescriptionTests", maxClassDescriptionTests); -reinitNecessary = true; -} -/** -* @param logLevel determines the logLevel for this component, can be {TRACE, DEBUG, INFO}. -* mandatory: false| reinit necessary: true -* default value: DEBUG -**/ -public void setLogLevel(String logLevel) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "logLevel", logLevel); -reinitNecessary = true; -} -/** -* @param usePropernessChecks specifies whether to check for equivalence (i.e. discard equivalent refinements). -* mandatory: false| reinit necessary: true -* default value: false -**/ -public void setUsePropernessChecks(boolean usePropernessChecks) { -ComponentManager.getInstance().applyConfigEntry(oCEL, "usePropernessChecks", usePropernessChecks); -reinitNecessary = true; -} -/** -* @param noisePercentage the (approximated) percentage of noise within the examples. -* mandatory: false| rein... [truncated message content] |