Class BruteForce<D,​R>

  • Type Parameters:
    D - the domain type
    R - the result type

    public class BruteForce<D,​R>
    extends Object
    A brute force algorithm, or brute-force search or exhaustive search, also known as generate and test, is a very general problem-solving technique that consists of systematically enumerating all possible candidates for the solution and checking whether each candidate satisfies the problem's statement. In addition, it allows a quick scan of the search space before further refined investigation.
    See Also:
    Wikipedia: Brute-force search
    • Constructor Detail

      • BruteForce

        public BruteForce​(Function<D,​R> function)
        Constructs a brute force search for a function.
        Parameters:
        function - a function
    • Method Detail

      • getResults

        public List<R> getResults​(List<D> domain)
        Runs in parallel the brute force algorithm on the function for a given domain.
        Parameters:
        domain - a domain
        Returns:
        the results of applying the domains to the function
      • getResultsSerially

        @Deprecated
        public List<R> getResultsSerially​(List<D> domain)
        Deprecated.
        Runs serially the brute force algorithm on the function for a given domain. This function is mainly for testing and debugging. Otherwise, use getResults(java.util.List).
        Parameters:
        domain - a domain
        Returns:
        the results of applying the domains to the function