From: <jen...@us...> - 2008-07-28 09:21:14
|
Revision: 1019 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1019&view=rev Author: jenslehmann Date: 2008-07-28 09:21:08 +0000 (Mon, 28 Jul 2008) Log Message: ----------- - added isRunning() method to abstract learning algorithm class - removed getReasoningService() from learning problem base class and changed all affected classes - documentation improvements Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java trunk/src/dl-learner/org/dllearner/algorithms/RandomGuesser.java trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java trunk/src/dl-learner/org/dllearner/algorithms/gp/GP.java trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/Psi.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java trunk/src/dl-learner/org/dllearner/core/Component.java trunk/src/dl-learner/org/dllearner/core/ComponentInitException.java trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java trunk/src/dl-learner/org/dllearner/core/LearningProblem.java trunk/src/dl-learner/org/dllearner/core/config/ConfigOption.java trunk/src/dl-learner/org/dllearner/core/owl/DatatypePropertyHierarchy.java trunk/src/dl-learner/org/dllearner/core/owl/DatatypeQuantorRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/Description.java trunk/src/dl-learner/org/dllearner/core/owl/ObjectPropertyHierarchy.java trunk/src/dl-learner/org/dllearner/learningproblems/EvaluationCache.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/ScoreThreeValued.java trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java trunk/src/dl-learner/org/dllearner/refinementoperators/MathOperations.java trunk/src/dl-learner/org/dllearner/refinementoperators/PsiDown.java trunk/src/dl-learner/org/dllearner/refinementoperators/PsiUp.java trunk/src/dl-learner/org/dllearner/server/ClientState.java trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -59,6 +59,7 @@ public class BruteForceLearner extends LearningAlgorithm { private LearningProblem learningProblem; + private ReasoningService rs; private Description bestDefinition; private Score bestScore; @@ -67,12 +68,14 @@ private String returnType; private boolean stop = false; + private boolean isRunning = false; // list of all generated concepts sorted by length private Map<Integer,List<Description>> generatedDefinitions = new HashMap<Integer,List<Description>>(); public BruteForceLearner(LearningProblem learningProblem, ReasoningService rs) { this.learningProblem = learningProblem; + this.rs = rs; } public static String getName() { @@ -121,6 +124,7 @@ @Override public void start() { + isRunning = true; // FlatABox abox = FlatABox.getInstance(); System.out.print("Generating definitions up to length " + maxLength + " ... "); @@ -148,7 +152,7 @@ //System.out.println("false negatives: " + Helper.intersection(bestDefNegSet,posExamples)); //System.out.print("Score: " + bestScore + " Max: " + maxScore + " Difference: " + (maxScore-bestScore)); //System.out.println(" Accuracy: " + df.format((double)bestScore/maxScore*100) + "%"); - + isRunning = false; } private void testGeneratedDefinitions(int maxLength) { @@ -203,7 +207,7 @@ if(length==1) { generatedDefinitions.get(1).add(new Thing()); generatedDefinitions.get(1).add(new Nothing()); - for(NamedClass atomicConcept : learningProblem.getReasoningService().getAtomicConcepts()) { + for(NamedClass atomicConcept : rs.getAtomicConcepts()) { generatedDefinitions.get(1).add(atomicConcept); } } @@ -261,7 +265,7 @@ // EXISTS and ALL for(Description childNode : generatedDefinitions.get(length-2)) { - for(ObjectProperty atomicRole : learningProblem.getReasoningService().getAtomicRoles()) { + for(ObjectProperty atomicRole : rs.getAtomicRoles()) { Description root1 = new ObjectSomeRestriction(atomicRole,childNode); generatedDefinitions.get(length).add(root1); @@ -310,4 +314,12 @@ } + /* (non-Javadoc) + * @see org.dllearner.core.LearningAlgorithm#isRunning() + */ + @Override + public boolean isRunning() { + return isRunning; + } + } Modified: trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -177,4 +177,13 @@ // TODO Auto-generated method stub } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningAlgorithm#isRunning() + */ + @Override + public boolean isRunning() { + // TODO Auto-generated method stub + return false; + } } Modified: trunk/src/dl-learner/org/dllearner/algorithms/RandomGuesser.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/RandomGuesser.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/algorithms/RandomGuesser.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -42,6 +42,7 @@ private Score bestScore; private double bestFitness = Double.NEGATIVE_INFINITY; private LearningProblem learningProblem; + private ReasoningService rs; private int numberOfTrees; private int maxDepth; @@ -49,6 +50,7 @@ public RandomGuesser(LearningProblem learningProblem, ReasoningService rs) { this.learningProblem = learningProblem; + this.rs = rs; } public static String getName() { @@ -99,7 +101,7 @@ for(int i=0; i<numberOfTrees; i++) { // p = GPUtilities.createGrowRandomProgram(learningProblem, maxDepth); - p = GPUtilities.createGrowRandomProgram(learningProblem, maxDepth, false); + p = GPUtilities.createGrowRandomProgram(learningProblem, rs, maxDepth, false); if(p.getFitness()>bestFitness) { bestFitness = p.getFitness(); bestScore = p.getScore(); @@ -133,4 +135,13 @@ } + /* (non-Javadoc) + * @see org.dllearner.core.LearningAlgorithm#isRunning() + */ + @Override + public boolean isRunning() { + // TODO Auto-generated method stub + return false; + } + } Modified: trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -100,4 +100,13 @@ } return simpleSuggestions; } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningAlgorithm#isRunning() + */ + @Override + public boolean isRunning() { + // TODO Auto-generated method stub + return false; + } } Modified: trunk/src/dl-learner/org/dllearner/algorithms/gp/GP.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/gp/GP.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/algorithms/gp/GP.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -274,7 +274,7 @@ @Override public void start() { // falls refinement-Wahrscheinlichkeit größer 0, dann erzeuge psi - psi = new Psi(learningProblem); + psi = new Psi(learningProblem, rs); System.out.println(); System.out.println("Starting Genetic Programming Learner"); @@ -437,11 +437,11 @@ i++; // mutation } else if(rand >= crossoverBoundary && rand < mutationBoundary) { - newIndividuals[i] = GPUtilities.mutation(learningProblem, individuals[selectedIndividuals[i]]); + newIndividuals[i] = GPUtilities.mutation(learningProblem, rs, individuals[selectedIndividuals[i]]); // hill climbing } else if(rand >= mutationBoundary && rand < hillClimbingBoundary) { // System.out.println("hill climbing"); - newIndividuals[i] = GPUtilities.hillClimbing(learningProblem, individuals[selectedIndividuals[i]]); + newIndividuals[i] = GPUtilities.hillClimbing(learningProblem, rs, individuals[selectedIndividuals[i]]); // refinement operator } else if(rand >= hillClimbingBoundary && rand < refinementBoundary) { newIndividuals[i] = psi.applyOperator(individuals[selectedIndividuals[i]]); @@ -615,9 +615,9 @@ // int depth = rand.nextInt(initMaxDepth-initMinDepth)+initMinDepth; if(grow) - individuals[i] = GPUtilities.createGrowRandomProgram(learningProblem,depth, adc); + individuals[i] = GPUtilities.createGrowRandomProgram(learningProblem, rs, depth, adc); else - individuals[i] = GPUtilities.createFullRandomProgram(learningProblem, depth, adc); + individuals[i] = GPUtilities.createFullRandomProgram(learningProblem, rs, depth, adc); } /* @@ -965,6 +965,15 @@ } + /* (non-Javadoc) + * @see org.dllearner.core.LearningAlgorithm#isRunning() + */ + @Override + public boolean isRunning() { + // TODO Auto-generated method stub + return false; + } + /** * This allows to set the number of individuals in the whole population. A * higher value slows down the algorithm, but will in general improve Modified: trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -9,6 +9,7 @@ import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasoningMethodUnsupportedException; +import org.dllearner.core.ReasoningService; import org.dllearner.core.Score; import org.dllearner.core.owl.ObjectAllRestriction; import org.dllearner.core.owl.NamedClass; @@ -134,31 +135,31 @@ * Perform a point mutation on the given program. * @param p The program to be mutated. */ - public static Program mutation(LearningProblem learningProblem, Program p) { + public static Program mutation(LearningProblem learningProblem, ReasoningService rs, Program p) { mutation++; if(p.getAdc() != null) { // TODO: hier kann man noch mehr Feinabstimmung machen, d.h. // Mutation abh�ngig von Knotenanzahl if(Math.random()<0.5) { - Description mainTree = mutation(learningProblem, p.getTree(),true); + Description mainTree = mutation(learningProblem, rs, p.getTree(),true); Description adc = p.getAdc(); Score score = calculateFitness(learningProblem,mainTree,adc); return new Program(score, mainTree, adc); } else { Description mainTree = p.getTree(); - Description adc = mutation(learningProblem, p.getAdc(),false); + Description adc = mutation(learningProblem, rs, p.getAdc(),false); Score score = calculateFitness(learningProblem,mainTree,adc); return new Program(score, mainTree, adc); } } else { - Description tree = mutation(learningProblem, p.getTree(),false); + Description tree = mutation(learningProblem, rs,p.getTree(),false); Score score = calculateFitness(learningProblem, tree); return new Program(score, tree); } } - private static Description mutation(LearningProblem learningProblem, Description tree, boolean useADC) { + private static Description mutation(LearningProblem learningProblem, ReasoningService rs, Description tree, boolean useADC) { // auch bei Mutation muss darauf geachtet werden, dass // Baum nicht modifiziert wird (sonst w�rde man automatisch auch // andere "selected individuals" modifizieren) @@ -185,11 +186,11 @@ Description st = t.getSubtree(randNr); Description stParent = st.getParent(); stParent.getChildren().remove(st); - Description treeNew = createGrowRandomTree(learningProblem,3, useADC); + Description treeNew = createGrowRandomTree(learningProblem, rs, 3, useADC); stParent.addChild(treeNew); } else // return createLeafNode(useADC); - return pickTerminalSymbol(learningProblem,useADC); + return pickTerminalSymbol(learningProblem,rs,useADC); return t; } @@ -303,10 +304,10 @@ // m�sste auch mit ADC funktionieren, da nur am Hauptbaum etwas // ver�ndert wird - public static Program hillClimbing(LearningProblem learningProblem, Program p) { + public static Program hillClimbing(LearningProblem learningProblem, ReasoningService rs, Program p) { hillClimbing++; // checken, ob Bedingungen f�r hill-climbing erf�llt sind - if(!learningProblem.getReasoningService().getReasonerType().equals(ReasonerType.FAST_RETRIEVAL) + if(!rs.getReasonerType().equals(ReasonerType.FAST_RETRIEVAL) || !(p.getScore() instanceof ScoreThreeValued)) { throw new Error("Hill climbing can only be used with the fast-retrieval-algorithm on a three valued learning problem."); } @@ -316,9 +317,9 @@ // parent-Link ver�ndert) Description treecloned = (Description) p.getTree().clone(); if(p.getAdc() != null) - return createProgram(learningProblem,hillClimbing(learningProblem,treecloned,(ScoreThreeValued)p.getScore()),p.getAdc()); + return createProgram(learningProblem,hillClimbing(learningProblem,rs,treecloned,(ScoreThreeValued)p.getScore()),p.getAdc()); else - return createProgram(learningProblem,hillClimbing(learningProblem,treecloned,(ScoreThreeValued)p.getScore())); + return createProgram(learningProblem,hillClimbing(learningProblem,rs,treecloned,(ScoreThreeValued)p.getScore())); } // one-step hill-climbing @@ -326,7 +327,7 @@ // Alternativen zu speichern und dann ein Element zuf�llig auszuw�hlen, // aber w�rde man das nicht machen, dann w�re das ein starker Bias // zu z.B. Disjunktion (weil die als erstes getestet wird) - private static Description hillClimbing(LearningProblem learningProblem, Description node, ScoreThreeValued score) { + private static Description hillClimbing(LearningProblem learningProblem, ReasoningService rs, Description node, ScoreThreeValued score) { SortedSetTuple<Individual> tuple = new SortedSetTuple<Individual>(score.getPosClassified(),score.getNegClassified()); SortedSetTuple<String> stringTuple = Helper.getStringTuple(tuple); // FlatABox abox = FlatABox.getInstance(); @@ -345,7 +346,7 @@ // FlatABox abox = Main.getFlatAbox(); FlatABox abox = null; try { - abox = Helper.createFlatABox(learningProblem.getReasoningService()); + abox = Helper.createFlatABox(rs); } catch (ReasoningMethodUnsupportedException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -361,14 +362,14 @@ // TODO: double retrieval nutzen tmp2 = FastRetrieval.calculateDisjunctionSets(stringTuple, tmp); - tmpScore = getScore(node.getLength()+2, learningProblem,Helper.getIndividualSet(tmp2.getPosSet()),Helper.getIndividualSet(tmp2.getNegSet())); + tmpScore = getScore(node.getLength()+2, learningProblem, rs, Helper.getIndividualSet(tmp2.getPosSet()),Helper.getIndividualSet(tmp2.getNegSet())); if(tmpScore.getScore()==bestScore) bestNeighbours = updateMap(bestNeighbours,1,concept,false); else if(tmpScore.getScore()>bestScore) bestNeighbours = updateMap(bestNeighbours,1,concept,true); tmp2 = FastRetrieval.calculateConjunctionSets(stringTuple, tmp); - tmpScore = getScore(node.getLength()+2,learningProblem,Helper.getIndividualSet(tmp2.getPosSet()),Helper.getIndividualSet(tmp2.getNegSet())); + tmpScore = getScore(node.getLength()+2,learningProblem, rs, Helper.getIndividualSet(tmp2.getPosSet()),Helper.getIndividualSet(tmp2.getNegSet())); if(tmpScore.getScore()==bestScore) bestNeighbours = updateMap(bestNeighbours,2,concept,false); else if(tmpScore.getScore()>bestScore) @@ -378,14 +379,14 @@ // Tests f�r All und Exists for(String role : abox.roles) { tmp = FastRetrieval.calculateAllSet(abox,role,stringTuple); - tmpScore = getScore(node.getLength()+2,learningProblem,Helper.getIndividualSet(tmp.getPosSet()),Helper.getIndividualSet(tmp.getNegSet())); + tmpScore = getScore(node.getLength()+2,learningProblem, rs, Helper.getIndividualSet(tmp.getPosSet()),Helper.getIndividualSet(tmp.getNegSet())); if(tmpScore.getScore()==bestScore) bestNeighbours = updateMap(bestNeighbours,3,role,false); else if(tmpScore.getScore()>bestScore) bestNeighbours = updateMap(bestNeighbours,3,role,true); tmp = FastRetrieval.calculateExistsSet(abox,role,stringTuple); - tmpScore = getScore(node.getLength()+2,learningProblem,Helper.getIndividualSet(tmp.getPosSet()),Helper.getIndividualSet(tmp.getNegSet())); + tmpScore = getScore(node.getLength()+2,learningProblem, rs, Helper.getIndividualSet(tmp.getPosSet()),Helper.getIndividualSet(tmp.getNegSet())); if(tmpScore.getScore()==bestScore) bestNeighbours = updateMap(bestNeighbours,4,role,false); else if(tmpScore.getScore()>bestScore) @@ -451,10 +452,10 @@ } } - private static ScoreThreeValued getScore(int conceptLength, LearningProblem learningProblem, SortedSet<Individual> posClassified, SortedSet<Individual> negClassified) { + private static ScoreThreeValued getScore(int conceptLength, LearningProblem learningProblem, ReasoningService rs, SortedSet<Individual> posClassified, SortedSet<Individual> negClassified) { // es muss hier die Helper-Methode verwendet werden, sonst werden // Individuals gel�scht !! - SortedSet<Individual> neutClassified = Helper.intersection(learningProblem.getReasoningService().getIndividuals(),posClassified); + SortedSet<Individual> neutClassified = Helper.intersection(rs.getIndividuals(),posClassified); // learningProblem.getReasoner().getIndividuals(); // neutClassified.retainAll(posClassified); neutClassified.retainAll(negClassified); @@ -488,10 +489,10 @@ return returnMap; } - private static Description pickTerminalSymbol(LearningProblem learningProblem, boolean useADC) { + private static Description pickTerminalSymbol(LearningProblem learningProblem, ReasoningService rs, boolean useADC) { // FlatABox abox = FlatABox.getInstance(); int nr; - int nrOfConcepts = learningProblem.getReasoningService().getAtomicConcepts().size(); + int nrOfConcepts = rs.getAtomicConcepts().size(); // ein Blattknoten kann folgendes sein: // Top, Bottom, Konzept => alles am Besten gleichwahrscheinlich @@ -510,7 +511,7 @@ return new ADC(); } else - return (NamedClass) learningProblem.getReasoningService().getAtomicConceptsList().get(nr-2).clone(); + return (NamedClass) rs.getAtomicConceptsList().get(nr-2).clone(); } // Funktion nach Umstelllung der Konstruktoren nicht mehr ben�tigt @@ -618,28 +619,28 @@ * @param depth Depth of the tree. * @return The created program. */ - public static Program createFullRandomProgram(LearningProblem learningProblem, int depth, boolean adc) { + public static Program createFullRandomProgram(LearningProblem learningProblem, ReasoningService rs, int depth, boolean adc) { if(adc) { // erster Baum Hauptbaum, zweiter Baum ADC - return createProgram(learningProblem, createFullRandomTree(learningProblem, depth, true), - createFullRandomTree(learningProblem, depth, false)); + return createProgram(learningProblem, createFullRandomTree(learningProblem, rs, depth, true), + createFullRandomTree(learningProblem, rs, depth, false)); } else - return createProgram(learningProblem, createFullRandomTree(learningProblem, depth, false)); + return createProgram(learningProblem, createFullRandomTree(learningProblem, rs, depth, false)); } - private static Description createFullRandomTree(LearningProblem learningProblem, int depth, boolean useADC) { + private static Description createFullRandomTree(LearningProblem learningProblem, ReasoningService rs, int depth, boolean useADC) { // FlatABox abox = FlatABox.getInstance(); - int numberOfRoles = learningProblem.getReasoningService().getAtomicRoles().size(); // abox.roles.size(); + int numberOfRoles = rs.getAtomicRoles().size(); // abox.roles.size(); if (depth > 1) { int nr = rand.nextInt(3+2*numberOfRoles); // System.out.println(nr); // Node node = createNonLeafNodeEqualProp(); // Concept node = pickFunctionSymbol(); - Description child1 = createFullRandomTree(learningProblem, depth-1, useADC); + Description child1 = createFullRandomTree(learningProblem, rs, depth-1, useADC); if(nr == 0 || nr == 1) { - Description child2 = createFullRandomTree(learningProblem, depth-1, useADC); + Description child2 = createFullRandomTree(learningProblem, rs, depth-1, useADC); if(nr == 0) { // if(useMultiStructures) return new Union(child1,child2); @@ -654,9 +655,9 @@ } else if(nr==2) { return new Negation(child1); } else if(nr - 3 < numberOfRoles) - return new ObjectSomeRestriction(learningProblem.getReasoningService().getAtomicRolesList().get(nr-3),child1); + return new ObjectSomeRestriction(rs.getAtomicRolesList().get(nr-3),child1); else - return new ObjectAllRestriction(learningProblem.getReasoningService().getAtomicRolesList().get(nr-3-numberOfRoles),child1); + return new ObjectAllRestriction(rs.getAtomicRolesList().get(nr-3-numberOfRoles),child1); /* if(node instanceof Disjunction || node instanceof Conjunction) { @@ -670,7 +671,7 @@ // return node; } else { // return createLeafNode(useADC); - return pickTerminalSymbol(learningProblem, useADC); + return pickTerminalSymbol(learningProblem, rs, useADC); } } @@ -679,17 +680,17 @@ * @param depth The maximum depth of the program tree. * @return The created program. */ - public static Program createGrowRandomProgram(LearningProblem learningProblem, int depth, boolean adc) { + public static Program createGrowRandomProgram(LearningProblem learningProblem, ReasoningService rs, int depth, boolean adc) { if(adc) { // erster Baum Hauptbaum, zweiter Baum ADC - return createProgram(learningProblem, createGrowRandomTree(learningProblem,depth,true), - createGrowRandomTree(learningProblem,depth,false)); + return createProgram(learningProblem, createGrowRandomTree(learningProblem,rs,depth,true), + createGrowRandomTree(learningProblem,rs,depth,false)); } else - return createProgram(learningProblem, createGrowRandomTree(learningProblem, depth,false)); + return createProgram(learningProblem, createGrowRandomTree(learningProblem, rs, depth,false)); } - private static Description createGrowRandomTree(LearningProblem learningProblem, int depth, boolean useADC) { + private static Description createGrowRandomTree(LearningProblem learningProblem, ReasoningService rs, int depth, boolean useADC) { /* private static Concept pickAlphabetSymbol(boolean useADC) { FlatABox abox = FlatABox.getInstance(); @@ -724,8 +725,8 @@ */ // FlatABox abox = FlatABox.getInstance(); - int numberOfConcepts = learningProblem.getReasoningService().getAtomicConcepts().size(); - int numberOfRoles = learningProblem.getReasoningService().getAtomicRoles().size(); + int numberOfConcepts = rs.getAtomicConcepts().size(); + int numberOfRoles = rs.getAtomicRoles().size(); // TODO: ev. größere Wahrscheinlichkeit für Konjunktion/Disjunktion (?), // mit größerer Konzept-, und Rollenanzahl kommen die sonst kaum noch vor int numberOfAlphabetSymbols = numberOfConcepts + 2*numberOfRoles + 5; //7;// 5; @@ -768,23 +769,23 @@ else if(nr==numberOfConcepts + 2*numberOfRoles + 5) return new ADC(); else if(nr>=2 && nr < numberOfConcepts+2) - return (NamedClass)learningProblem.getReasoningService().getAtomicConceptsList().get(nr-2).clone(); + return (NamedClass)rs.getAtomicConceptsList().get(nr-2).clone(); else if(nr==numberOfConcepts+2) { // if(useMultiStructures) - return new Intersection(createGrowRandomTree(learningProblem, depth-1, useADC),createGrowRandomTree(learningProblem, depth-1, useADC)); + return new Intersection(createGrowRandomTree(learningProblem, rs, depth-1, useADC),createGrowRandomTree(learningProblem, rs, depth-1, useADC)); // else // return new Conjunction(createGrowRandomTree(learningProblem, depth-1, useADC),createGrowRandomTree(learningProblem, depth-1, useADC)); } else if(nr==numberOfConcepts+3) { // if(useMultiStructures) - return new Union(createGrowRandomTree(learningProblem, depth-1, useADC),createGrowRandomTree(learningProblem, depth-1, useADC)); + return new Union(createGrowRandomTree(learningProblem, rs, depth-1, useADC),createGrowRandomTree(learningProblem, rs, depth-1, useADC)); // else // return new Disjunction(createGrowRandomTree(learningProblem, depth-1, useADC),createGrowRandomTree(learningProblem, depth-1, useADC)); } else if(nr==numberOfConcepts+4) - return new Negation(createGrowRandomTree(learningProblem, depth-1, useADC)); + return new Negation(createGrowRandomTree(learningProblem, rs, depth-1, useADC)); else if(nr>=numberOfConcepts+5 && nr<numberOfConcepts+5+numberOfRoles) - return new ObjectSomeRestriction(learningProblem.getReasoningService().getAtomicRolesList().get(nr-numberOfConcepts-5),createGrowRandomTree(learningProblem,depth-1, useADC)); + return new ObjectSomeRestriction(rs.getAtomicRolesList().get(nr-numberOfConcepts-5),createGrowRandomTree(learningProblem, rs, depth-1, useADC)); else - return new ObjectAllRestriction(learningProblem.getReasoningService().getAtomicRolesList().get(nr-numberOfConcepts-5-numberOfRoles),createGrowRandomTree(learningProblem,depth-1, useADC)); + return new ObjectAllRestriction(rs.getAtomicRolesList().get(nr-numberOfConcepts-5-numberOfRoles),createGrowRandomTree(learningProblem, rs, depth-1, useADC)); /* if(node instanceof Disjunction || node instanceof Conjunction) { @@ -798,7 +799,7 @@ // return node; } else { // return createLeafNode(useADC); - return pickTerminalSymbol(learningProblem, useADC); + return pickTerminalSymbol(learningProblem, rs, useADC); } } Modified: trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/Psi.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/Psi.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/Psi.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -6,6 +6,7 @@ import java.util.TreeMap; import org.dllearner.algorithms.gp.Program; +import org.dllearner.core.ReasoningService; import org.dllearner.core.Score; import org.dllearner.core.owl.Description; import org.dllearner.learningproblems.PosNegLP; @@ -48,12 +49,12 @@ private long someTimeStart = 0; public long someTime = 0; - public Psi(PosNegLP learningProblem) { //, PsiUp pu, PsiDown pd) { + public Psi(PosNegLP learningProblem, ReasoningService reasoningService) { //, PsiUp pu, PsiDown pd) { // this.pu = pu; // this.pd = pd; this.learningProblem = learningProblem; - pu = new PsiUp(learningProblem); - pd = new PsiDown(learningProblem); + pu = new PsiUp(learningProblem, reasoningService); + pd = new PsiDown(learningProblem, reasoningService); nrOfPositiveExamples = learningProblem.getPositiveExamples().size(); nrOfNegativeExamples = learningProblem.getNegativeExamples().size(); random = new Random(); Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -430,5 +430,13 @@ public void resume() { // TODO: not implemented } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningAlgorithm#isRunning() + */ + @Override + public boolean isRunning() { + return algorithm.isRunning(); + } } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -143,6 +143,7 @@ // setting to true gracefully stops the algorithm private boolean stop = false; + private boolean isRunning = false; // node from which algorithm has started private ExampleBasedNode startNode; @@ -287,6 +288,7 @@ } public void start() { + isRunning = true; runtime=System.currentTimeMillis(); JamonMonitorLogger.getTimeMonitor(ExampleBasedROLComponent.class, "totalLearningTime").start(); // TODO: write a JUnit test for this problem (long-lasting or infinite loops because @@ -483,6 +485,7 @@ logger.info("Algorithm terminated succesfully."); JamonMonitorLogger.getTimeMonitor(ExampleBasedROLComponent.class, "totalLearningTime").stop(); + isRunning = false; } @@ -1222,5 +1225,9 @@ else return false; } + + public boolean isRunning() { + return isRunning; + } } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -93,6 +93,7 @@ private boolean quiet = false; private boolean stop = false; + private boolean isRunning = false; private ReasoningService rs; @@ -388,6 +389,7 @@ @Override @SuppressWarnings("unchecked") public void start() { + isRunning = true; runtime=System.currentTimeMillis(); // Suche wird mit Top-Konzept gestartet Thing top = new Thing(); @@ -582,6 +584,8 @@ System.out.println("Algorithm stopped."); else System.out.println("Algorithm terminated succesfully."); + + isRunning = false; } // einfache Erweiterung des Knotens (ohne properness) @@ -1147,4 +1151,12 @@ } + /* (non-Javadoc) + * @see org.dllearner.core.LearningAlgorithm#isRunning() + */ + @Override + public boolean isRunning() { + return isRunning; + } + } Modified: trunk/src/dl-learner/org/dllearner/core/Component.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/Component.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/core/Component.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -68,5 +68,6 @@ * @param option A configuration option of this component. * @return Current value of the configuration option. */ +// now implemented in ComponentManager // public abstract <T> T getConfigValue(ConfigOption<T> option) throws UnknownConfigOptionException; } Modified: trunk/src/dl-learner/org/dllearner/core/ComponentInitException.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/ComponentInitException.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/core/ComponentInitException.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -21,9 +21,9 @@ /** * Exception which is thrown when a component cannot be intialised, - * e.g. due to bad configuration parameteres or unforeseen - * circumstances unreachable web files. It can encapsulate arbitrary - * exceptions occuring during initialisation. + * e.g. due to bad configuration parameters, or unforeseen + * circumstances, e.g. unreachable web files. It can encapsulate arbitrary + * exceptions occurring during initialisation. * * @author Jens Lehmann * @@ -32,15 +32,31 @@ private static final long serialVersionUID = -3550079897929658317L; + /** + * Creates a <code>ComponentInitException</code> with the specified message. + * @param message The specified detail message. + */ public ComponentInitException(String message) { super(message); } - public ComponentInitException(Exception exception) { - super(exception); + /** + * Creates a <code>ComponentInitException</code> with the + * specified cause. + * @param cause The cause of this exception. + */ + public ComponentInitException(Throwable cause) { + super(cause); + } + + /** + * Creates a <code>ComponentInitException</code> with the + * specified message and cause. + * @param message The specified detail message. + * @param cause The cause of this exception. + */ + public ComponentInitException(String message, Throwable cause) { + super(message, cause); } - - public ComponentInitException(String message, Exception exception) { - super(message, exception); - } + } Modified: trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -72,6 +72,14 @@ public abstract void stop(); /** + * Returns whether the learning algorithm is running. Implementation + * should use a boolean status variable in their implementations of + * the start and resume methods. + * @return True if the algorithm is running, false otherwise. + */ + public abstract boolean isRunning(); + + /** * Every algorithm must be able to return the score of the * best solution found. * Modified: trunk/src/dl-learner/org/dllearner/core/LearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/LearningProblem.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/core/LearningProblem.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007, Jens Lehmann + * Copyright (C) 2007-2008, Jens Lehmann * * This file is part of DL-Learner. * @@ -23,18 +23,19 @@ /** * Base class for all learning problems. + * See also the wiki page for + * <a href="http://dl-learner.org/Projects/DLLearner/Architecture">DL-Learner-Architecture</a>. + * Currently, we assume that all learning problems have the goal + * of learning class descriptions. However, this may be extended + * to other scenarios if desired. * - * @todo The current learning problem implementations - * assume that we learn a concept, which does not exist - * in the knowledge base so far. However, often we want - * to learn a complex definition for a concept which - * is already integrated in a subsumption hierarchy. This - * means it would make sense to specifiy the list of these - * superclasses as an additional argument of the learning - * problem. The learning algorithms could then make use of - * this to optimise their search for a solution. (More - * generally, one could specify the name of the concept, which - * should be improved.) + * TODO: The current learning problem implementations assume that + * we learn a description for a class, which does not exist + * in the knowledge base so far (if it exists, it needs to be ignored + * explicitly). However, often we want to learn a complex definition + * for a concept which is already integrated in a subsumption hierarchy + * or may already have an associated description. It may make sense + * to use this knowledge for (re-)learning descriptions. * * @author Jens Lehmann * @@ -43,16 +44,25 @@ protected ReasoningService reasoningService; + /** + * Constructs a learning problem using a reasoning service for + * querying the background knowledge. It can be used for + * evaluating solution candidates. + * @param reasoningService The reasoning service used as + * background knowledge. + */ public LearningProblem(ReasoningService reasoningService) { this.reasoningService = reasoningService; } - public abstract Score computeScore(Description concept); + /** + * Computes the <code>Score</code> of a given class description + * with respect to this learning problem. + * This can (but does not need to) be used by learning algorithms + * to measure how good the description fits the learning problem. + * @param description A class description (as solution candidate for this learning problem). + * @return A <code>Score</code> object. + */ + public abstract Score computeScore(Description description); - // TODO: remove? reasoning service should probably not be accessed via - // learning problem - public ReasoningService getReasoningService() { - return reasoningService; - } - } Modified: trunk/src/dl-learner/org/dllearner/core/config/ConfigOption.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/config/ConfigOption.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/core/config/ConfigOption.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -71,7 +71,7 @@ * * @param object * The object to check. - * @return + * @return True of the type is correct, false otherwise. */ public abstract boolean checkType(Object object); Modified: trunk/src/dl-learner/org/dllearner/core/owl/DatatypePropertyHierarchy.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/DatatypePropertyHierarchy.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/core/owl/DatatypePropertyHierarchy.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -29,7 +29,7 @@ /** * Represents a hierarchy of datatype properties. * - * @todo. Currently, the role hierarchy pruning algorithm (analogous to the + * TODO: Currently, the role hierarchy pruning algorithm (analogous to the * subsumption hierarchy) is not implemented. * * @author Jens Lehmann Modified: trunk/src/dl-learner/org/dllearner/core/owl/DatatypeQuantorRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/DatatypeQuantorRestriction.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/core/owl/DatatypeQuantorRestriction.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -20,13 +20,19 @@ package org.dllearner.core.owl; /** + * Represents datatype quantor restrictions. For instance, + * \exists salary < 100.000 can be used to specify + * those objects (persons) which have a salary of below 100.000. + * * @author Jens Lehmann * */ public abstract class DatatypeQuantorRestriction extends QuantorRestriction { /** - * @param propertyExpression + * Creates a <code>DatatypeQuantorRestriction</code> along the + * given property. + * @param propertyExpression The datatype property along which this restriction acts. */ public DatatypeQuantorRestriction(DatatypeProperty datatypeProperty) { super(datatypeProperty); Modified: trunk/src/dl-learner/org/dllearner/core/owl/Description.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/Description.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/core/owl/Description.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -127,14 +127,16 @@ /** * Adds a description as child of this one. The parent link - * of the concept will point to this one. + * of the description will point to this one. For instance, + * if the description is an intersection, then this method adds + * an element to the intersection, e.g. A AND B becomes A AND B + * AND C. * - * @param child - * @return + * @param child The child description. */ - public boolean addChild(Description child) { + public void addChild(Description child) { child.setParent(this); - return children.add(child); + children.add(child); } /** Modified: trunk/src/dl-learner/org/dllearner/core/owl/ObjectPropertyHierarchy.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ObjectPropertyHierarchy.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/core/owl/ObjectPropertyHierarchy.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -29,7 +29,7 @@ /** * Represents a hierarchy of roles. * - * @todo Currently, the role hierarchy pruning algorithm (analogous to the + * TODO: Currently, the role hierarchy pruning algorithm (analogous to the * subsumption hierarchy) is not implemented. * * @author Jens Lehmann Modified: trunk/src/dl-learner/org/dllearner/learningproblems/EvaluationCache.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/EvaluationCache.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/learningproblems/EvaluationCache.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -37,7 +37,7 @@ * which tries to infer the covered examples of a given concept * from previous results. * - * @todo Under construction. + * TODO Under construction. * @author Jens Lehmann * */ Modified: trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLP.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLP.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLP.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -75,8 +75,8 @@ * If it is not weak, it returns the number of covered negative example. It * can use retrieval or instance checks for classification. * - * @see org.dllearner.learningproblems.DefinitionLP.MultiInstanceChecks - * @todo Performance could be slightly improved by counting the number of + * @see org.dllearner.learningproblems.PosNegLP.MultiInstanceChecks + * TODO: Performance could be slightly improved by counting the number of * covers instead of using sets and counting their size. * @param concept * The concept to test. @@ -154,7 +154,7 @@ * to implement TWO_CHECKS in this function, because we have to test all * examples to create a score object anyway). * - * @see org.dllearner.learningproblems.DefinitionLP.MultiInstanceChecks + * @see org.dllearner.learningproblems.PosNegLP.MultiInstanceChecks * @param concept * The concept to test. * @return Corresponding Score object. Modified: trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -101,7 +101,7 @@ * concept. Thus, this methods uses a different notion of coverage than * the one for the standard definition learning problem. * - * @see org.dllearner.learningproblems.DefinitionLP.MultiInstanceChecks + * @see org.dllearner.learningproblems.PosNegLP.MultiInstanceChecks * @param concept * The concept to test. * @return -1 if concept is too weak and the number of covered negative @@ -173,7 +173,7 @@ * Calls the same method on the standard definition learning problem, but * negates the concept before and permutes positive and negative examples. * - * @see org.dllearner.core.LearningProblemNew#computeScore(org.dllearner.core.owl.Description) + * @see org.dllearner.core.LearningProblem#computeScore(org.dllearner.core.owl.Description) */ @Override public Score computeScore(Description concept) { Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ScoreThreeValued.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ScoreThreeValued.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ScoreThreeValued.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -32,7 +32,7 @@ * Computes the score (a negative value) by comparing the classification results * with ideal results. * - * @todo: The implementation is not very efficient, because some things are + * TODO: The implementation is not very efficient, because some things are * only computed to be able to present the score results. This means that * it would be better to compute only the necessary computations and do * the other ones only when they are needed to calculate statistical values. Modified: trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -256,7 +256,7 @@ * Constructs a role hierarchy using DIG queries. After calling this method, * one can query parents or children of roles. * - * @todo Does not yet take ignored roles into account. + * TODO Does not yet take ignored roles into account. */ @Override public void prepareRoleHierarchy(Set<ObjectProperty> allowedRoles) { Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/MathOperations.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/MathOperations.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/MathOperations.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -107,21 +107,24 @@ * number = 6: [[6], [4, 1], [3, 2], [2, 1, 1]] * number = 7: [[7], [5, 1], [4, 2], [3, 3], [3, 1, 1], [2, 2, 1], [1, 1, 1, 1]] * - * @param length - * @return + * @param number A natural number. + * @return A two dimensional list constructed as described above. */ - public static List<List<Integer>> getCombos(int length) { + public static List<List<Integer>> getCombos(int number) { // on Notebook: length 70 in 17 seconds, length 50 in 800ms, length 30 in 15ms LinkedList<List<Integer>> combosTmp = new LinkedList<List<Integer>>(); - decompose(length, length, new LinkedList<Integer>(), combosTmp); + decompose(number, number, new LinkedList<Integer>(), combosTmp); return combosTmp; } /** + * Methods for computing combinations with the additional restriction + * that <code>maxValue</code> is the highest natural number, which can + * occur. * @see #getCombos(int) * @param length Length of construct. * @param maxValue Maximum value which can occur in sum. - * @return + * @return A two dimensional list constructed in {@link #getCombos(int)}. */ public static List<List<Integer>> getCombos(int length, int maxValue) { LinkedList<List<Integer>> combosTmp = new LinkedList<List<Integer>>(); Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/PsiDown.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/PsiDown.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/PsiDown.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -44,9 +44,9 @@ private TreeSet<Description> topSet; - public PsiDown(PosNegLP learningProblem) { + public PsiDown(PosNegLP learningProblem, ReasoningService reasoningService) { this.learningProblem = learningProblem; - reasoningService = learningProblem.getReasoningService(); + this.reasoningService = reasoningService; // Top-Menge erstellen createTopSet(); @@ -65,7 +65,7 @@ topSet.addAll(reasoningService.getMoreSpecialConcepts(new Thing())); // negierte speziellste Konzepte - Set<Description> tmp = learningProblem.getReasoningService().getMoreGeneralConcepts(new Nothing()); + Set<Description> tmp = reasoningService.getMoreGeneralConcepts(new Nothing()); for(Description c : tmp) topSet.add(new Negation(c)); Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/PsiUp.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/PsiUp.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/PsiUp.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -32,9 +32,9 @@ private TreeSet<Description> bottomSet; - public PsiUp(PosNegLP learningProblem) { + public PsiUp(PosNegLP learningProblem, ReasoningService reasoningService) { this.learningProblem = learningProblem; - reasoningService = learningProblem.getReasoningService(); + this.reasoningService = reasoningService; // Top-Menge erstellen createBottomSet(); Modified: trunk/src/dl-learner/org/dllearner/server/ClientState.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/ClientState.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/server/ClientState.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -94,6 +94,7 @@ /** * @return the isAlgorithmRunning */ + @Deprecated public boolean isAlgorithmRunning() { return isAlgorithmRunning; } @@ -101,6 +102,7 @@ /** * @param isAlgorithmRunning the isAlgorithmRunning to set */ + @Deprecated public void setAlgorithmRunning(boolean isAlgorithmRunning) { this.isAlgorithmRunning = isAlgorithmRunning; } @@ -199,8 +201,8 @@ } /** - * @param key - * @return + * @param is A component ID. + * @return The component associated with this ID. * @see java.util.Map#get(java.lang.Object) */ public Component getComponent(int id) { @@ -208,8 +210,10 @@ } /** - * @param e - * @return + * Adds a knowledge source to the client session. Use the + * returned value to refer to this knowledge source. + * @param ks The knowledge source to add. + * @return The component ID for the newly added knowledge source. */ public int addKnowledgeSource(KnowledgeSource ks) { knowledgeSources.add(ks); Modified: trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -348,9 +348,9 @@ Thread learningThread = new Thread() { @Override public void run() { - state.setAlgorithmRunning(true); +// state.setAlgorithmRunning(true); state.getLearningAlgorithm().start(); - state.setAlgorithmRunning(false); +// state.setAlgorithmRunning(false); } }; learningThread.start(); @@ -393,7 +393,7 @@ @WebMethod public boolean isAlgorithmRunning(int id) throws ClientNotKnownException { - return getState(id).isAlgorithmRunning(); + return getState(id).getLearningAlgorithm().isRunning(); } /** Modified: trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2008-07-24 16:42:40 UTC (rev 1018) +++ trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2008-07-28 09:21:08 UTC (rev 1019) @@ -11,7 +11,6 @@ import org.dllearner.core.owl.Description; -import org.semanticweb.owl.model.OWLDescription; /** * * @author Heero Yuy This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |