org.dllearner.algorithms
Class RandomGuesser

java.lang.Object
  extended by org.dllearner.core.AbstractComponent
      extended by org.dllearner.core.AbstractCELA
          extended by org.dllearner.algorithms.RandomGuesser
All Implemented Interfaces:
ClassExpressionLearningAlgorithm, Component, LearningAlgorithm, StoppableLearningAlgorithm

public class RandomGuesser
extends AbstractCELA

This learning algorithm provides a random guessing technique to solve learning problems in description logics/OWL. Solutions of such problems are concepts, which can be viewed as trees. The algorithm takes as input the number of guesses (how many concepts to generate) and the maximum depth of the concepts/trees. Using this, it randomly creates trees by calling the "grow" method of a genetic programming algorithm. The target language is currently ALC.

Author:
Jens Lehmann

Field Summary
 
Fields inherited from class org.dllearner.core.AbstractCELA
MAX_NR_OF_RESULTS
 
Constructor Summary
RandomGuesser(AbstractLearningProblem learningProblem, AbstractReasonerComponent rs)
           
 
Method Summary
<T> void
applyConfigEntry(ConfigEntry<T> entry)
          Applies a configuration option to this component.
static Collection<ConfigOption<?>> createConfigOptions()
           
 RandomGuesserConfigurator getConfigurator()
          For each component, a configurator class is generated in package org.dllearner.core.configurators using the script { org.dllearner.scripts.ConfigJavaGenerator}.
 Description getCurrentlyBestDescription()
           
 EvaluatedDescription getCurrentlyBestEvaluatedDescription()
          Returns the best descriptions obtained so far.
static String getName()
           
 Score getSolutionScore()
           
 void init()
          Method to be called after the component has been configured.
 boolean isRunning()
          Returns whether the learning algorithm is running.
 void start()
          Starts the algorithm.
 void stop()
          Stops the algorithm gracefully.
static Collection<Class<? extends AbstractLearningProblem>> supportedLearningProblems()
           
 
Methods inherited from class org.dllearner.core.AbstractCELA
changeLearningProblem, changeReasonerComponent, getCurrentlyBestDescriptions, getCurrentlyBestDescriptions, getCurrentlyBestDescriptions, getCurrentlyBestEvaluatedDescriptions, getCurrentlyBestEvaluatedDescriptions, getCurrentlyBestEvaluatedDescriptions, getCurrentlyBestEvaluatedDescriptions, getCurrentlyBestMostGeneralEvaluatedDescriptions
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomGuesser

public RandomGuesser(AbstractLearningProblem learningProblem,
                     AbstractReasonerComponent rs)
Method Detail

getConfigurator

public RandomGuesserConfigurator getConfigurator()
Description copied from class: AbstractComponent
For each component, a configurator class is generated in package org.dllearner.core.configurators using the script { org.dllearner.scripts.ConfigJavaGenerator}. The configurator provides set and get methods for the configuration options of a component.

Specified by:
getConfigurator in class AbstractComponent
Returns:
An object allowing to configure this component.

getName

public static String getName()

supportedLearningProblems

public static Collection<Class<? extends AbstractLearningProblem>> supportedLearningProblems()

createConfigOptions

public static Collection<ConfigOption<?>> createConfigOptions()

applyConfigEntry

public <T> void applyConfigEntry(ConfigEntry<T> entry)
                      throws InvalidConfigOptionValueException
Description copied from class: AbstractComponent
Applies a configuration option to this component. Implementations of components should use option and value of the config entry to perform an action (usually setting an internal variable to an appropriate value). Since the availability of configurators, it is optional for components to implement this method. Instead of using this method to take an action based on a configuration value, components can also use the getters defined in the components configurator. Important note: Never call this method directly. All calls are done via the ComponentManager.

Type Parameters:
T - Type of the config entry (Integer, String etc.).
Parameters:
entry - A configuration entry.
Throws:
InvalidConfigOptionValueException - This exception is thrown if the value of the config entry is not valid. For instance, a config option may only accept values, which are within intervals 0.1 to 0.3 or 0.5 to 0.8. If the value is outside of those intervals, an exception is thrown. Note that many of the common cases are already caught in the constructor of ConfigEntry (for instance for a DoubleConfigOption you can specify an interval for the value). This means that, as a component developer, you often do not need to implement further validity checks.
See Also:
AbstractComponent.getConfigurator()

init

public void init()
Description copied from interface: Component
Method to be called after the component has been configured. Implementation of components can overwrite this method to perform setup and initialisation tasks for this component.


start

public void start()
Description copied from interface: LearningAlgorithm
Starts the algorithm. It runs until paused, stopped, or a termination criterion has been reached.


getSolutionScore

public Score getSolutionScore()

getCurrentlyBestDescription

public Description getCurrentlyBestDescription()
Specified by:
getCurrentlyBestDescription in class AbstractCELA
Returns:
The best class description found by the learning algorithm so far.
See Also:
AbstractCELA.getCurrentlyBestEvaluatedDescription()

getCurrentlyBestEvaluatedDescription

public EvaluatedDescription getCurrentlyBestEvaluatedDescription()
Description copied from class: AbstractCELA
Returns the best descriptions obtained so far.

Specified by:
getCurrentlyBestEvaluatedDescription in class AbstractCELA
Returns:
Best class description found so far.

stop

public void stop()
Description copied from interface: StoppableLearningAlgorithm
Stops the algorithm gracefully. A stopped algorithm cannot be resumed anymore. Use this method for cleanup and freeing memory.


isRunning

public boolean isRunning()
Description copied from interface: StoppableLearningAlgorithm
Returns whether the learning algorithm is running. Implementation should use a boolean status variable in their implementations of the start and resume methods.

Returns:
True if the algorithm is running, false otherwise.


SourceForge.net Logo DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2011 Jens Lehmann