Jenetics - Genetic Algorithm, Genetic Programming, Grammatical Evolution, Evolutionary Algorithm, and Multi-objective Optimization
Engine
(see code snippet below), the previous behaviour has been preserverd.final Engine<DoubleGene, Double> engine = Engine.builder(ff)
.fitnessExecutor(BatchExecutor.ofVirtualThreads())
.build();
CharStore
sort.ShiftMutator
, ShuffleMutator
and UniformOrderBasedCrossover
.RandomGenerator
selection. The used RandomGenerator
is selected in the following order:
io.jenetics.util.defaultRandomGenerator
start parameter is set. If so, take this generator.L64X256MixRandom
generator is available. If so, take this generator.RandomGeneratorFactory.stateBits()
value.Random
generator if no best generator can be found. This generator is guaranteed to be available on every platform.RandomGenerator
used by the library.java -Dio.jenetics.util.defaultRandomGenerator=L64X1024MixRandom\
-cp jenetics-@[email protected]:app.jar\
com.foo.bar.MyJeneticsAppjava
io.jenetics.prog
module.MathExpr
class. Replace ad-hoc parsing implementation.BitChromosome
methods: and
, or
, xor
, not
, shiftRight
, shiftLeft
.Tree::reduce
function. Allows to write code as follows:final Tree<String, ?> formula = TreeNode.parse(
"add(sub(6, div(230, 10)), mul(5, 6))",
String::trim
);
final double result = formula.reduce(new Double[0], (op, args) ->
switch (op) {
case "add" -> args[0] + args[1];
case "sub" -> args[0] - args[1];
case "mul" -> args[0] * args[1];
case "div" -> args[0] / args[1];
default -> Double.parseDouble(op);
}
);
records
.BitChromosome
.MathExpr
class.RandomGenerator
instead of Random
class.Integer
/LongeGenes
from inclusively to exclusively.AbstractChromosome
non-Serializable
.InstantSource
instead of Clock
for measuring evolution durations.Self
interface.ProxySorter
is now able to sort array slices.Ordered
class. Currently, it is required that the return value of the fitness function to be Comparable
. But sometimes you might want to change the order of a given type or add some order to a type. The Ordered
class makes this possible.CompositeCodec
.FlatTreeNode.ofTree
factory method, for cleaner Tree
API.Constraint
is now part of the Problem
interface. If defined, it will automatically be part of the created Engine
.default Optional<Constraint<G, C>> constraint() {
return Optional.empty();
}
Chromosome.map(Function)
methods. This allows a more efficient mapping of chromosomes.Constraint
interface.jenetics.incubator
module. This module will contain classes which might be part of one of the main module.