Package de.learnlib.filter.cache.dfa
Class ThreadSafeDFACaches
- java.lang.Object
-
- de.learnlib.filter.cache.dfa.ThreadSafeDFACaches
-
public final class ThreadSafeDFACaches extends Object
A factory for creating thread-safe caches forDFA-basedMembershipOracles. Parameters and return types are tailored towards the use withParallelOracleBuilders.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <I> Collection<ThreadSafeDFACacheOracle<I>>createCache(net.automatalib.alphabet.Alphabet<I> alphabet, Collection<? extends MembershipOracle<I,Boolean>> oracles)Enhances each oracle of a given collection with a shared, thread-safe cache for a DFA learning setup.static <I> Supplier<ThreadSafeDFACacheOracle<I>>createCache(net.automatalib.alphabet.Alphabet<I> alphabet, Supplier<? extends MembershipOracle<I,Boolean>> oracleSupplier)Enhances a given oracle supplier with a shared, thread-safe cache for a DFA learning setup.static <I> Collection<ThreadSafeDFACacheOracle<I>>createDAGCache(net.automatalib.alphabet.Alphabet<I> alphabet, Collection<? extends MembershipOracle<I,Boolean>> oracles)Enhances each oracle of a given collection with a shared, thread-safe cache for a DFA learning setup, using a DAG for internal cache organization.static <I> Supplier<ThreadSafeDFACacheOracle<I>>createDAGCache(net.automatalib.alphabet.Alphabet<I> alphabet, Supplier<? extends MembershipOracle<I,Boolean>> oracleSupplier)Enhances a given oracle supplier with a shared, thread-safe cache for a DFA learning setup, using a DAG for internal cache organization.static <I> Collection<ThreadSafeDFACacheOracle<I>>createDAGPCCache(net.automatalib.alphabet.Alphabet<I> alphabet, Collection<? extends MembershipOracle<I,Boolean>> oracles)The prefix-closed version ofcreateDAGCache(Alphabet, Collection).static <I> Supplier<ThreadSafeDFACacheOracle<I>>createDAGPCCache(net.automatalib.alphabet.Alphabet<I> alphabet, Supplier<? extends MembershipOracle<I,Boolean>> oracleSupplier)The prefix-closed version ofcreateDAGCache(Alphabet, Supplier).static <I> Collection<ThreadSafeDFACacheOracle<I>>createTreeCache(net.automatalib.alphabet.Alphabet<I> alphabet, Collection<? extends MembershipOracle<I,Boolean>> oracles)Enhances each oracle of a given collection with a shared, thread-safe cache for a DFA learning setup, using a tree for internal cache organization.static <I> Supplier<ThreadSafeDFACacheOracle<I>>createTreeCache(net.automatalib.alphabet.Alphabet<I> alphabet, Supplier<? extends MembershipOracle<I,Boolean>> oracleSupplier)Enhances a given oracle supplier with a shared, thread-safe cache for a DFA learning setup, using a tree for internal cache organization.static <I> Collection<ThreadSafeDFACacheOracle<I>>createTreePCCache(net.automatalib.alphabet.Alphabet<I> alphabet, Collection<? extends MembershipOracle<I,Boolean>> oracles)Prefix-closed version ofcreateTreeCache(Alphabet, Collection).static <I> Supplier<ThreadSafeDFACacheOracle<I>>createTreePCCache(net.automatalib.alphabet.Alphabet<I> alphabet, Supplier<? extends MembershipOracle<I,Boolean>> oracleSupplier)Prefix-closed version ofcreateTreeCache(Alphabet, Supplier).
-
-
-
Method Detail
-
createCache
public static <I> Supplier<ThreadSafeDFACacheOracle<I>> createCache(net.automatalib.alphabet.Alphabet<I> alphabet, Supplier<? extends MembershipOracle<I,Boolean>> oracleSupplier)
Enhances a given oracle supplier with a shared, thread-safe cache for a DFA learning setup.Note that this method does not specify the implementation to use for the cache. Currently, a DAG (
createDAGCache(Alphabet, Supplier)) is used; however, this may change in the future.- Type Parameters:
I- input symbol type- Parameters:
alphabet- the alphabet containing the symbols of possible queriesoracleSupplier- the supplier that is used to construct the delegate oracle for the cache, in case of a cache-miss.- Returns:
- a supplier for
ThreadSafeDFACacheOracles.
-
createCache
public static <I> Collection<ThreadSafeDFACacheOracle<I>> createCache(net.automatalib.alphabet.Alphabet<I> alphabet, Collection<? extends MembershipOracle<I,Boolean>> oracles)
Enhances each oracle of a given collection with a shared, thread-safe cache for a DFA learning setup.Note that this method does not specify the implementation to use for the cache. Currently, a DAG (
createDAGCache(Alphabet, Collection)) is used; however, this may change in the future.- Type Parameters:
I- input symbol type- Parameters:
alphabet- the alphabet containing the symbols of possible queriesoracles- the collection of oracles which will be used as delegates (in case of a cache-miss) by the corresponding oracles caches.- Returns:
- a collection of
ThreadSafeDFACacheOracles.
-
createDAGCache
public static <I> Supplier<ThreadSafeDFACacheOracle<I>> createDAGCache(net.automatalib.alphabet.Alphabet<I> alphabet, Supplier<? extends MembershipOracle<I,Boolean>> oracleSupplier)
Enhances a given oracle supplier with a shared, thread-safe cache for a DFA learning setup, using a DAG for internal cache organization.- Type Parameters:
I- input symbol type- Parameters:
alphabet- the alphabet containing the symbols of possible queriesoracleSupplier- the supplier that is used to construct the delegate oracle for the cache, in case of a cache-miss.- Returns:
- a supplier for
ThreadSafeDFACacheOracles. - See Also:
IncrementalDFADAGBuilder
-
createDAGCache
public static <I> Collection<ThreadSafeDFACacheOracle<I>> createDAGCache(net.automatalib.alphabet.Alphabet<I> alphabet, Collection<? extends MembershipOracle<I,Boolean>> oracles)
Enhances each oracle of a given collection with a shared, thread-safe cache for a DFA learning setup, using a DAG for internal cache organization.- Type Parameters:
I- input symbol type- Parameters:
alphabet- the alphabet containing the symbols of possible queriesoracles- the collection of oracles which will be used as delegates (in case of a cache-miss) by the corresponding oracles caches.- Returns:
- a collection of
ThreadSafeDFACacheOracles. - See Also:
IncrementalDFADAGBuilder
-
createDAGPCCache
public static <I> Supplier<ThreadSafeDFACacheOracle<I>> createDAGPCCache(net.automatalib.alphabet.Alphabet<I> alphabet, Supplier<? extends MembershipOracle<I,Boolean>> oracleSupplier)
The prefix-closed version ofcreateDAGCache(Alphabet, Supplier).- Type Parameters:
I- input symbol type- Parameters:
alphabet- the alphabet containing the symbols of possible queriesoracleSupplier- the supplier that is used to construct the delegate oracle for the cache, in case of a cache-miss.- Returns:
- a supplier for
ThreadSafeDFACacheOracles. - See Also:
IncrementalPCDFADAGBuilder
-
createDAGPCCache
public static <I> Collection<ThreadSafeDFACacheOracle<I>> createDAGPCCache(net.automatalib.alphabet.Alphabet<I> alphabet, Collection<? extends MembershipOracle<I,Boolean>> oracles)
The prefix-closed version ofcreateDAGCache(Alphabet, Collection).- Type Parameters:
I- input symbol type- Parameters:
alphabet- the alphabet containing the symbols of possible queriesoracles- the collection of oracles which will be used as delegates (in case of a cache-miss) by the corresponding oracles caches.- Returns:
- a collection of
ThreadSafeDFACacheOracles. - See Also:
IncrementalPCDFADAGBuilder
-
createTreeCache
public static <I> Supplier<ThreadSafeDFACacheOracle<I>> createTreeCache(net.automatalib.alphabet.Alphabet<I> alphabet, Supplier<? extends MembershipOracle<I,Boolean>> oracleSupplier)
Enhances a given oracle supplier with a shared, thread-safe cache for a DFA learning setup, using a tree for internal cache organization.- Type Parameters:
I- input symbol type- Parameters:
alphabet- the alphabet containing the symbols of possible queriesoracleSupplier- the supplier that is used to construct the delegate oracle for the cache, in case of a cache-miss.- Returns:
- a supplier for
ThreadSafeDFACacheOracles. - See Also:
IncrementalDFATreeBuilder
-
createTreeCache
public static <I> Collection<ThreadSafeDFACacheOracle<I>> createTreeCache(net.automatalib.alphabet.Alphabet<I> alphabet, Collection<? extends MembershipOracle<I,Boolean>> oracles)
Enhances each oracle of a given collection with a shared, thread-safe cache for a DFA learning setup, using a tree for internal cache organization.- Type Parameters:
I- input symbol type- Parameters:
alphabet- the alphabet containing the symbols of possible queriesoracles- the collection of oracles which will be used as delegates (in case of a cache-miss) by the corresponding oracles caches.- Returns:
- a collection of
ThreadSafeDFACacheOracles. - See Also:
IncrementalDFATreeBuilder
-
createTreePCCache
public static <I> Supplier<ThreadSafeDFACacheOracle<I>> createTreePCCache(net.automatalib.alphabet.Alphabet<I> alphabet, Supplier<? extends MembershipOracle<I,Boolean>> oracleSupplier)
Prefix-closed version ofcreateTreeCache(Alphabet, Supplier).- Type Parameters:
I- input symbol type- Parameters:
alphabet- the alphabet containing the symbols of possible queriesoracleSupplier- the supplier that is used to construct the delegate oracle for the cache, in case of a cache-miss.- Returns:
- a supplier for
ThreadSafeDFACacheOracles. - See Also:
IncrementalPCDFATreeBuilder
-
createTreePCCache
public static <I> Collection<ThreadSafeDFACacheOracle<I>> createTreePCCache(net.automatalib.alphabet.Alphabet<I> alphabet, Collection<? extends MembershipOracle<I,Boolean>> oracles)
Prefix-closed version ofcreateTreeCache(Alphabet, Collection).- Type Parameters:
I- input symbol type- Parameters:
alphabet- the alphabet containing the symbols of possible queriesoracles- the collection of oracles which will be used as delegates (in case of a cache-miss) by the corresponding oracles caches.- Returns:
- a supplier for
ThreadSafeDFACacheOracles. - See Also:
IncrementalPCDFATreeBuilder
-
-