Class IndirectAlgorithmProvider

java.lang.Object
org.moeaframework.core.spi.AlgorithmProvider
org.moeaframework.core.spi.IndirectAlgorithmProvider

public class IndirectAlgorithmProvider extends AlgorithmProvider
Algorithm provider that avoids creating runtime dependencies on external libraries. It accomplishes this by attempting to load the class dynamically and, if unable to do so, treats it as if the provider simply does not exist.
  • Constructor Details

    • IndirectAlgorithmProvider

      public IndirectAlgorithmProvider(String className)
      Creates an indirect provider for the given algorithm provider.
      Parameters:
      className - the fully-qualified class name for the algorithm provider we want to reference without creating runtime dependencies
  • Method Details

    • getAlgorithm

      public Algorithm getAlgorithm(String name, TypedProperties properties, Problem problem)
      Description copied from class: AlgorithmProvider
      Returns the algorithm with the specified name, or null if this provider does not support the algorithm. An optional set of properties may be provided to further define the algorithm; however, the provider is expected to supply default properties if none are provided.
      Specified by:
      getAlgorithm in class AlgorithmProvider
      Parameters:
      name - the algorithm name
      properties - optional properties for the algorithm
      problem - the problem
      Returns:
      the algorithm with the specified name, or null if this provider does not support the algorithm