Class EASystemFactory

java.lang.Object
net.bmahe.genetics4j.core.EASystemFactory

public class EASystemFactory extends Object
Suite of helper methods to create instances of EASystem
  • Constructor Details

    • EASystemFactory

      private EASystemFactory()
      Prevents instantiation since it's a bunch of static methods
  • Method Details

    • from

      public static <T extends Comparable<T>> EASystem<T> from(AbstractEAConfiguration<T> eaConfiguration, AbstractEAExecutionContext<T> eaExecutionContext, ExecutorService executorService, FitnessEvaluator<T> fitnessEvaluator)
    • from

      public static <T extends Comparable<T>> EASystem<T> from(EAConfiguration<T> eaConfigurationSync, EAExecutionContext<T> eaExecutionContext, ExecutorService executorService)
      Factory method to create a EASystem with a simple fitness computation method

      This is the most common and straight forward approach and ideal when computing the fitness is fast and straightforward

      Type Parameters:
      T -
      Parameters:
      eaConfigurationSync -
      eaExecutionContext -
      executorService -
      Returns:
    • from

      public static <T extends Comparable<T>> EASystem<T> from(EAConfiguration<T> eaConfigurationSync, EAExecutionContext<T> eaExecutionContext)
      Factory method to create a EASystem with a simple fitness computation method.

      This is the most common and straight forward approach and ideal when computing the fitness is fast and straightforward

      Type Parameters:
      T -
      Parameters:
      eaConfigurationSync -
      eaExecutionContext -
      Returns:
    • from

      public static <T extends Comparable<T>> EASystem<T> from(EAConfigurationBulkAsync<T> eaConfigurationBulkAsync, EAExecutionContext<T> eaExecutionContext, ExecutorService executorService)
      Factory method to create a EASystem with an asynchronous fitness computation method

      This is an ideal approach when computing fitnesses requires external requests or could benefit from bulk processing, such as leveraging GPUs

      Type Parameters:
      T -
      Parameters:
      eaConfigurationBulkAsync -
      eaExecutionContext -
      executorService -
      Returns:
    • from

      public static <T extends Comparable<T>> EASystem<T> from(EAConfigurationBulkAsync<T> eaConfigurationBulkAsync, EAExecutionContext<T> eaExecutionContext)
      Factory method to create a EASystem with an asynchronous fitness computation method

      This is an ideal approach when computing fitnesses requires external requests or could benefit from bulk processing, such as leveraging GPUs

      Type Parameters:
      T -
      Parameters:
      eaConfigurationBulkAsync -
      eaExecutionContext -
      Returns: