Class DefaultQuery<I,​D>

  • Type Parameters:
    I - input symbol type
    D - output domain type

    public class DefaultQuery<I,​D>
    extends AbstractQuery<I,​D>
    A query is a container for tests a learning algorithms performs, containing the actual test and the corresponding result.
    • Constructor Detail

      • DefaultQuery

        public DefaultQuery​(Word<I> prefix,
                            Word<I> suffix,
                            D output)
      • DefaultQuery

        public DefaultQuery​(Word<I> prefix,
                            Word<I> suffix)
      • DefaultQuery

        public DefaultQuery​(Word<I> input)
      • DefaultQuery

        public DefaultQuery​(Word<I> input,
                            D output)
      • DefaultQuery

        public DefaultQuery​(Query<I,​?> query)
    • Method Detail

      • getOutput

        public D getOutput()
      • isNormalized

        public boolean isNormalized()
        Checks if the query is normalized, i.e., if all the information is stored in the suffix part of the counterexample.
        Returns:
        true if the counterexample is normalized, false otherwise.
      • answer

        public void answer​(D output)
        Description copied from class: Query
        Answers the query. This method should be called by a MembershipOracle, and only once per query to process. Calling this method more than once may result in undefined behavior, possibly (but not necessarily) throwing an exception.
        Specified by:
        answer in class Query<I,​D>
        Parameters:
        output - the output, i.e., the directly observable response to the query's suffix (cf. main documentation)
      • toString

        public String toString()
        Description copied from class: Query
        Returns the string representation of this query.
        Overrides:
        toString in class Query<I,​D>
        Returns:
        A string of the form "Query[<prefix>|<suffix>]" for queries not containing an answer or "Query[<prefix>|<suffix> / <answer>]" if an answer may be specified.
        See Also:
        AbstractQuery.toStringWithAnswer(Object)