Skip to content

5.0

Compare
Choose a tag to compare
@JedS6391 JedS6391 released this 24 Aug 23:13
5.0
3059da3

View the full changelog here.

Breaking changes:

Type definitions

  • The majority of the core library has been modified to accept a generic target type parameter, to allow the target
    of the data set to be strongly-typed through the system. Previously, only the program data type and type of program
    output was generic. The main benefit of the introduced target type parameter, is to simplify the usage and
    implementation of fitness functions.

Modules

  • ModuleContainer has been moved to the nz.co.jedsimson.lgp.core.modules package.
  • The module resolution functions instance and instanceUnsafe are no longer the responsibility of ModuleContainer
    and have been relocated to the ModuleFactory class.
    The intended usage is that ModuleContainer defines a set of ModuleBuilders, and
    the ModuleFactory can be used to resolve instances from a given ModuleContainer.

Environment

  • Direct dependency on Environment has been removed from all core implementations and is recommended for any custom implementations.
    The public contract is now defined in EnvironmentFacade and this should be the contract relied upon.
  • Environment can no longer be directly used to resolve dependencies as the registeredModule and registerModuleUnsafe
    functions have been removed. Dependencies should be resolved using EnvironmentFacade.moduleFactory.

Evolution operators

  • The nz.co.jedsimson.lgp.core.evolution package was restructured significantly. It is now split up as below:
    nz.co.jedsimson.lgp.core.evolution.operators
    ├── mutation 
    │   ├── macro
    │   ├── micro
    │   └── strategy
    ├── recombination
    └── selection
  • MacroMutationOperator now accepts an optional MutationStrategyFactory which can be used to customise the mutation behaviour.
  • MicroMutationOperator now accepts an optional MutationStrategyFactory which can be used to customise the mutation behaviour.
  • When no MutationStrategyFactory is given to either MacroMutationOperator or MicroMutationOperator, they will use the default
    strategy factory which preserves the previous behaviour of these implementations. The main reason behind this change is internal,
    but it can be used externally too.

Program

  • The properties instructions, registers, and outputRegisterIndices are now abstract properties of Program.
  • The properties arity and func (now renamed to function) are now abstract properties of Operation.

Registers

  • RegisterSet is now an interface and the implementation has been moved to ArrayRegisterSet.

Miscellaneous

  • The built-in Kotlin Random is now used instead of java.util.Random.
  • Moved Random extension functions choice, randInt, sample to the nz.co.jedsimson.lgp.core.environment package.
  • Move MutableList extension function slice into the nz.co.jedsimson.lgp.core.evolution.operators package.
  • Moved Valid and Invalid ConfigurationValidity implementations into the parent class (i.e. no longer access Valid, instead use ConfigurationValidity.Valid).