Module de.learnlib.common.util
Package de.learnlib.util
Class Experiment<A extends FiniteRepresentation,I,D>
java.lang.Object
de.learnlib.util.Experiment<A,I,D>
- Type Parameters:
A- the automaton typeI- input symbol typeD- output domain type
- Direct Known Subclasses:
DFAExperiment,MealyExperiment,MooreExperiment
Runs a learning experiment.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final EquivalenceOracle<? super A,I, D> static final StatisticsKeyTheStatisticsKeythis class uses for clocking the duration of the counterexample search of the equivalence oracle.static final StatisticsKeyTheStatisticsKeythis class uses for clocking the duration of the exploration phase of the learning algorithm.static final StatisticsKeyTheStatisticsKeythis class uses for counting the size of the final hypothesis.static final StatisticsKeyTheStatisticsKeythis class uses for counting the number of learning rounds of this experiment.protected final LearningAlgorithm<? extends A,I, D> protected static final org.slf4j.Loggerprotected final @Nullable InputModelSerializer<I,? super A> protected final StatisticsService -
Constructor Summary
ConstructorsConstructorDescriptionExperiment(LearningAlgorithm<? extends A, I, D> learningAlgorithm, EquivalenceOracle<? super A, I, D> equivalenceAlgorithm, Alphabet<I> inputs) Constructor.Experiment(LearningAlgorithm<? extends A, I, D> learningAlgorithm, EquivalenceOracle<? super A, I, D> equivalenceAlgorithm, Alphabet<I> inputs, @Nullable InputModelSerializer<I, ? super A> serializer) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal AReturns the final hypothesis model.protected final intgetRound()Utility method to access to current learning round.protected voidInitializes the learning process.protected voidCalled upon callingLearningAlgorithm.refineHypothesis(DefaultQuery).final Arun()Run the experiment, once.
-
Field Details
-
KEY_DUR_LEARN
TheStatisticsKeythis class uses for clocking the duration of the exploration phase of the learning algorithm. -
KEY_DUR_CEX
TheStatisticsKeythis class uses for clocking the duration of the counterexample search of the equivalence oracle. -
KEY_ROUNDS
TheStatisticsKeythis class uses for counting the number of learning rounds of this experiment. -
KEY_FINAL_SIZE
TheStatisticsKeythis class uses for counting the size of the final hypothesis. -
LOGGER
protected static final org.slf4j.Logger LOGGER -
learningAlgorithm
-
equivalenceAlgorithm
-
inputs
-
serializer
-
statistics
-
-
Constructor Details
-
Experiment
public Experiment(LearningAlgorithm<? extends A, I, D> learningAlgorithm, EquivalenceOracle<? super A, I, D> equivalenceAlgorithm, Alphabet<I> inputs) Constructor. Delegates toExperiment(LearningAlgorithm, EquivalenceOracle, Alphabet, InputModelSerializer)usingnullforserializer.- Parameters:
learningAlgorithm- the learning algorithm to use in this experimentequivalenceAlgorithm- the strategy for finding counterexamplesinputs- the inputs to consider for exploration- See Also:
-
Experiment
public Experiment(LearningAlgorithm<? extends A, I, D> learningAlgorithm, EquivalenceOracle<? super A, I, D> equivalenceAlgorithm, Alphabet<I> inputs, @Nullable InputModelSerializer<I, ? super A> serializer) Constructor. Creates a new experiment to run.- Parameters:
learningAlgorithm- the learning algorithm to use in this experimentequivalenceAlgorithm- the strategy for finding counterexamplesinputs- the inputs to consider for explorationserializer- the serializer for logging intermediate hypotheses (may benullin case no such logging is wanted)
-
-
Method Details
-
getFinalHypothesis
Returns the final hypothesis model.- Returns:
- the final hypothesis model
- Throws:
IllegalStateException- if the experiment has not been run yet
-
run
Run the experiment, once.- Returns:
- the final hypothesis
- Throws:
IllegalStateException- if invoked more than once
-
getRound
protected final int getRound()Utility method to access to current learning round.- Returns:
- the current learning round
-
initializeLearning
protected void initializeLearning()Initializes the learning process. By default, this method callsLearningAlgorithm.startLearning(). -
postRefinementHook
protected void postRefinementHook()Called upon callingLearningAlgorithm.refineHypothesis(DefaultQuery).
-