Engine$Builder.individualCreationRetries
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using io.jenetics.engine.Engine$Builder.individualCreationRetries (Showing top 3 results out of 315)

origin: jenetics/jenetics

public static void main(final String[] args) {
  final RectFill problem = new RectFill(new Rect(0, 100, 0, 100));
  final Engine<AnyGene<Rect>, Double> engine = Engine.builder(problem)
    .individualCreationRetries(10)
    .genotypeValidator(gt -> true)
    .offspringSelector(new RouletteWheelSelector<>())
    .alterers(
      new SwapMutator<>(),
      new SinglePointCrossover<>())
    .build();
  final ISeq<Rect> best = problem.codec().decode(
    engine.stream()
      .limit(byFixedGeneration(10))
      .collect(EvolutionResult.toBestGenotype())
  );
  System.out.println(best);
}
origin: jenetics/jenetics

/**
 * Create a new evolution {@code Engine.Builder} initialized with the values
 * of the current evolution {@code Engine}. With this method, the evolution
 * engine can serve as a template for a new one.
 *
 * @return a new engine builder
 */
public Builder<G, C> builder() {
  return new Builder<G, C>(_genotypeFactory, _fitnessFunction)
    .alterers(_alterer)
    .clock(_clock)
    .evaluator(_evaluator)
    .executor(_executor.get())
    .fitnessScaler(_fitnessScaler)
    .maximalPhenotypeAge(_maximalPhenotypeAge)
    .offspringFraction((double)_offspringCount/(double)getPopulationSize())
    .offspringSelector(_offspringSelector)
    .optimize(_optimize)
    .phenotypeValidator(_validator)
    .populationSize(getPopulationSize())
    .survivorsSelector(_survivorsSelector)
    .individualCreationRetries(_individualCreationRetries)
    .mapping(_mapper);
}
origin: jenetics/jenetics

/**
 * Create a new builder, with the current configuration.
 *
 * @since 3.1
 *
 * @return a new builder, with the current configuration
 */
@Override
public Builder<G, C> copy() {
  return new Builder<G, C>(_genotypeFactory, _fitnessFunction)
    .alterers(_alterer)
    .clock(_clock)
    .executor(_executor)
    .evaluator(_evaluator)
    .fitnessScaler(_fitnessScaler)
    .maximalPhenotypeAge(_maximalPhenotypeAge)
    .offspringFraction(_offspringFraction)
    .offspringSelector(_offspringSelector)
    .phenotypeValidator(_validator)
    .optimize(_optimize)
    .populationSize(_populationSize)
    .survivorsSelector(_survivorsSelector)
    .individualCreationRetries(_individualCreationRetries)
    .mapping(_mapper);
}
io.jenetics.engineEngine$BuilderindividualCreationRetries

Javadoc

The maximal number of attempt before the Engine gives up creating a valid individual ( Phenotype). Default values is set to 10.

Popular methods of Engine$Builder

  • alterers
    The alterers used for alter the offspring population. Default values is set to new SinglePointCrosso
  • build
    Builds an new Engine instance from the set properties.
  • minimizing
    Set to a fitness minimizing strategy.
  • offspringSelector
    The selector used for selecting the offspring population. Default values is set to TournamentSelecto
  • populationSize
    The number of individuals which form the population. Default values is set to 50.
  • survivorsSelector
    The selector used for selecting the survivors population. Default values is set to TournamentSelecto
  • selector
    The selector used for selecting the survivors and offspring population. Default values is set to Tou
  • maximalPhenotypeAge
    The maximal allowed age of a phenotype. Default values is set to 70.
  • offspringFraction
    The offspring fraction. Default values is set to 0.6. This method call is equivalent to survivorsFra
  • optimize
    The optimization strategy used by the engine. Default values is set to Optimize.MAXIMUM.
  • evaluator
    Setting the genotype evaluator used for evaluating the fitness function of the population.
  • executor
    The executor used by the engine.
  • evaluator,
  • executor,
  • genotypeValidator,
  • mapping,
  • phenotypeValidator,
  • survivorsFraction,
  • survivorsSize,
  • <init>,
  • clock

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getApplicationContext (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Join (org.hibernate.mapping)

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)