- java.lang.Object
-
- de.learnlib.testsupport.MQ2AQWrapper<I,O>
-
- Type Parameters:
I
- input symbol typeO
- output symbol type
- All Implemented Interfaces:
AdaptiveMembershipOracle<I,O>
,BatchProcessor<AdaptiveQuery<I,O>>
public class MQ2AQWrapper<I,O> extends Object implements AdaptiveMembershipOracle<I,O>
Utility class that wraps a givenMembershipOracle
into anAdaptiveMembershipOracle
by translating each step of anAdaptiveQuery
into a separateDefaultQuery
. Not very performant, but good enough to test adaptive learners in preset testing scenarios.
-
-
Constructor Summary
Constructors Constructor Description MQ2AQWrapper(MembershipOracle<I,net.automatalib.word.Word<O>> oracle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
processQueries(Collection<? extends AdaptiveQuery<I,O>> adaptiveQueries)
Processes the specified collection of queries.void
processQuery(AdaptiveQuery<I,O> query)
Processes a single query.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.learnlib.oracle.AdaptiveMembershipOracle
processBatch
-
-
-
-
Constructor Detail
-
MQ2AQWrapper
public MQ2AQWrapper(MembershipOracle<I,net.automatalib.word.Word<O>> oracle)
-
-
Method Detail
-
processQueries
public void processQueries(Collection<? extends AdaptiveQuery<I,O>> adaptiveQueries)
Description copied from interface:AdaptiveMembershipOracle
Processes the specified collection of queries. When this method returns, the provided inputs of theAdaptiveQuery.getInput()
method will have been evaluated on the system under learning and its responses will have been forwarded to theAdaptiveQuery.processOutput(Object)
method until the method has returnedAdaptiveQuery.Response.FINISHED
.- Specified by:
processQueries
in interfaceAdaptiveMembershipOracle<I,O>
- Parameters:
adaptiveQueries
- the queries to process
-
processQuery
public void processQuery(AdaptiveQuery<I,O> query)
Description copied from interface:AdaptiveMembershipOracle
Processes a single query. When this method returns, the provided inputs of theAdaptiveQuery.getInput()
method will have been evaluated on the system under learning and its responses will have been forwarded to theAdaptiveQuery.processOutput(Object)
method until the method has returnedAdaptiveQuery.Response.FINISHED
.The default implementation of this method will simply wrap the provided
AdaptiveQuery
in a singletonCollection
usingCollections.singleton(Object)
. Implementations in subclasses should override this method to circumvent the Collection object creation, if possible.- Specified by:
processQuery
in interfaceAdaptiveMembershipOracle<I,O>
- Parameters:
query
- the query to process
-
-