Package-level declarations
Types
Blend crossover (BLX-alpha): the default real-coded crossover operator. For each coordinate i, let cMin = min(p1[i], p2[i]) and cMax = max(p1[i], p2[i]) with spread I = cMax - cMin. Each offspring's coordinate is drawn uniformly from the interval [cMin - alpha*I, cMax + alpha*I], allowing exploration slightly beyond the parents' range. Two offspring are produced per call. The returned points are not clamped or rounded; the solver does that via ksl.simopt.problem.ProblemDefinition.toInputMap.
Strategy interface for the crossover (recombination) step of a genetic algorithm. Given the input values of two parent points, a crossover operator produces one or more offspring points. The offspring are returned as raw coordinate arrays (in the problem's input order) and need not be feasible: the solver converts each offspring with ksl.simopt.problem.ProblemDefinition.toInputMap, which clamps to the input ranges and rounds to granularity. Operators draw any required randomness through the supplied solver's single random number stream (GeneticAlgorithmSolver.rnStream).
Gaussian mutation: the default real-coded mutation operator. Each coordinate i is, with probability perGeneRate, perturbed by adding a zero-mean normal increment whose standard deviation is sigmaFactor * range[i], where range[i] is the width of input i's defined range. Coordinates with a non-positive range (no room to move) are left unchanged. The returned point is a new array; the supplied point is not modified. The result is not clamped or rounded; the solver does that via ksl.simopt.problem.ProblemDefinition.toInputMap.
A generational genetic algorithm (GA) solver with elitism for simulation optimization.
Strategy interface for the mutation step of a genetic algorithm. Given a single offspring point (its coordinate array in the problem's input order), a mutation operator returns a (possibly) perturbed point. The returned point may be infeasible: the solver converts it with ksl.simopt.problem.ProblemDefinition.toInputMap, which clamps to the input ranges and rounds to granularity. Operators must not mutate the supplied array in place; they return a new array. Randomness is drawn through the supplied solver's single random number stream (GeneticAlgorithmSolver.rnStream).
If supplied, this function determines the per-individual mutation rate during the genetic algorithm. Supplying a function permits dynamic changes (e.g., annealing the mutation rate) as the search progresses.
If supplied, this function determines the size of the population (per generation) during the genetic algorithm. Supplying a function permits dynamic changes to the population size as the search progresses.
Linear-rank selection: an alternate selection operator. The population is ranked best-to-worst (using the solver's GeneticAlgorithmSolver.compare, i.e. the minimization sense of the penalized objective). Each individual receives a selection probability that depends only on its rank, not on the magnitude of its fitness, which makes the operator robust to objective scale and sign. With selectionPressure s in [1,2], the best individual (rank 0) has probability s/n and the worst (rank n-1) has probability (2-s)/n; parents are then drawn by roulette over these probabilities. s = 1 gives uniform selection; s = 2 gives the strongest pressure (the worst individual gets probability 0).
Fitness-proportional ("roulette wheel") selection: an alternate selection operator. Because the framework minimizes the (penalized) objective and that value may be negative, raw fitness-proportional weights are not meaningful. This operator therefore uses a windowed weight: for each individual, weight = worst - f, where f is the penalized objective and worst is the largest (worst) penalized objective in the population. The best individual receives the largest weight and the worst receives zero. When all individuals are equal (total weight 0), selection is uniform. Parents are drawn by roulette over the weights.
Strategy interface for the selection step of a genetic algorithm. Given the current evaluated population, a selection operator chooses the parents (the mating pool) that will be recombined to produce the next generation. Operators draw any required randomness through the supplied solver's single random number stream (GeneticAlgorithmSolver.rnStream), keeping a run reproducible.
Single-point crossover: an alternate crossover operator. A cut point k is chosen uniformly in [1, d-1] (where d is the dimension). The first offspring takes coordinates 0..k-1 from parent 1 and k..d-1 from parent 2; the second offspring is the complement. Two offspring are produced. When d == 1 there is no interior cut point, so the parents are copied unchanged. The returned points are not clamped or rounded; the solver does that via ksl.simopt.problem.ProblemDefinition.toInputMap.
Tournament selection: the default selection operator. To select each parent, tournamentSize competitors are drawn uniformly at random (with replacement) from the population, and the best competitor (according to the solver's GeneticAlgorithmSolver.compare, i.e. the minimization sense of the penalized objective) wins. Larger tournaments increase selection pressure.
Uniform crossover: an alternate crossover operator. For each coordinate independently, the two parents' values are swapped with probability swapProbability; otherwise they are inherited as is. Two complementary offspring are produced. The returned points are not clamped or rounded; the solver does that via ksl.simopt.problem.ProblemDefinition.toInputMap.
Uniform-reset mutation: an alternate mutation operator. Each coordinate i is, with probability perGeneRate, replaced by a value drawn uniformly from input i's defined range (so it has no memory of the current value). Coordinates with a non-positive range are left unchanged. The returned point is a new array; the supplied point is not modified. The result is range-feasible by construction, but the solver still passes it through ksl.simopt.problem.ProblemDefinition.toInputMap for granularity rounding.