Package de.learnlib.oracle.membership
Class CLIOutputAdaptiveOracle<I,O>
java.lang.Object
de.learnlib.oracle.membership.CLIOutputAdaptiveOracle<I,O>
- Type Parameters:
I- input symbol typeO- output symbol type
- All Implemented Interfaces:
AdaptiveMembershipOracle<I,,O> BatchProcessor<AdaptiveQuery<I,,O>> SingleAdaptiveMembershipOracle<I,O>
public class CLIOutputAdaptiveOracle<I,O>
extends Object
implements SingleAdaptiveMembershipOracle<I,O>
An oracle that delegates its queries to an external program via the command-line interface. Outputs of the queries
are determined based on the provided output transformer.
Queries are translated to program arguments via the symbol's Object.toString() method. Due to the nature of
AdaptiveMembershipOracles, communication is inherently stateful, i.e., the program is executed multiple times
with a single query symbol each, preceded by a single invocation with only the reset symbol.
The outputTransformer is used to transform responses of the individual invocations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprocessQuery(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, waitMethods inherited from interface de.learnlib.oracle.AdaptiveMembershipOracle
processBatchMethods inherited from interface de.learnlib.oracle.SingleAdaptiveMembershipOracle
processQueries
-
Constructor Details
-
CLIOutputAdaptiveOracle
public CLIOutputAdaptiveOracle(List<String> commandLine, Function<String, O> outputTransformer, String reset) Constructor.- Parameters:
commandLine- the command line, containing the main binary and potential additional argumentsoutputTransformer- the transformer for the program's output. Receives the full (stdout) output of an individual invocation.reset- the symbol passed to the program to indicate a reset
-
-
Method Details
-
processQuery
Description copied from interface:AdaptiveMembershipOracleProcesses 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
AdaptiveQueryin a singletonCollectionusingCollections.singleton(Object). Implementations in subclasses should override this method to circumvent the Collection object creation, if possible.- Specified by:
processQueryin interfaceAdaptiveMembershipOracle<I,O> - Specified by:
processQueryin interfaceSingleAdaptiveMembershipOracle<I,O> - Parameters:
query- the query to process
-