Class RefinementCounterLearner<M,I,D>
- java.lang.Object
-
- de.learnlib.filter.statistic.learner.RefinementCounterLearner<M,I,D>
-
- Type Parameters:
M
- the automaton type.I
- the input type.D
- the output type.
- All Implemented Interfaces:
LearningAlgorithm<M,I,D>
,StatisticCollector
,StatisticLearner<M,I,D>
- Direct Known Subclasses:
DFARefinementCounterLearner
,MealyRefinementCounterLearner
,MooreRefinementCounterLearner
public class RefinementCounterLearner<M,I,D> extends Object implements StatisticLearner<M,I,D>
Counts the number of hypothesis refinements.The value of the
Counter
returned bygetStatisticalData()
returns the same value as Experiment.getRounds().
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.learnlib.algorithm.LearningAlgorithm
LearningAlgorithm.DFALearner<I>, LearningAlgorithm.MealyLearner<I,O>, LearningAlgorithm.MooreLearner<I,O>, LearningAlgorithm.NFALearner<I>
-
Nested classes/interfaces inherited from interface de.learnlib.statistic.StatisticLearner
StatisticLearner.DFAStatisticLearner<I>, StatisticLearner.MealyStatisticLearner<I,O>, StatisticLearner.MooreStatisticLearner<I,O>
-
-
Constructor Summary
Constructors Constructor Description RefinementCounterLearner(LearningAlgorithm<M,I,D> learningAlgorithm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description M
getHypothesisModel()
Returns the current hypothesis model.Counter
getStatisticalData()
Returns this statistical data gathered by this collector.boolean
refineHypothesis(DefaultQuery<I,D> ceQuery)
Triggers a refinement of the model by providing a counterexample.void
startLearning()
Starts the model inference process, creating an initial hypothesis in the provided model object.
-
-
-
Constructor Detail
-
RefinementCounterLearner
public RefinementCounterLearner(LearningAlgorithm<M,I,D> learningAlgorithm)
-
-
Method Detail
-
startLearning
public void startLearning()
Description copied from interface:LearningAlgorithm
Starts the model inference process, creating an initial hypothesis in the provided model object. Please note that it should be illegal to invoke this method twice.- Specified by:
startLearning
in interfaceLearningAlgorithm<M,I,D>
-
refineHypothesis
public boolean refineHypothesis(DefaultQuery<I,D> ceQuery)
Description copied from interface:LearningAlgorithm
Triggers a refinement of the model by providing a counterexample. A counterexample is a query which exposes different behavior of the real SUL compared to the hypothesis. Please note that invoking this method before an initial invocation ofLearningAlgorithm.startLearning()
should be illegal.- Specified by:
refineHypothesis
in interfaceLearningAlgorithm<M,I,D>
- Parameters:
ceQuery
- the query which exposes diverging behavior, as posed to the real SUL (i.e. with the SULs output).- Returns:
true
if the counterexample triggered a refinement of the hypothesis,false
otherwise (i.e., it was no counterexample).
-
getHypothesisModel
public M getHypothesisModel()
Description copied from interface:LearningAlgorithm
Returns the current hypothesis model.N.B.: By the contract of this interface, the model returned by this method may not be modified (i.e., M generally should refer to an immutable interface), and its validity is retained only until the next invocation of
LearningAlgorithm.refineHypothesis(DefaultQuery)
. If older hypotheses have to be maintained, a copy of the returned model must be made.Please note that it should be illegal to invoke this method before an initial invocation of
LearningAlgorithm.startLearning()
.- Specified by:
getHypothesisModel
in interfaceLearningAlgorithm<M,I,D>
- Returns:
- the current hypothesis model.
-
getStatisticalData
public Counter getStatisticalData()
Description copied from interface:StatisticCollector
Returns this statistical data gathered by this collector.- Specified by:
getStatisticalData
in interfaceStatisticCollector
- Returns:
- the statistical data gathered by this collector
-
-