Skip to content

Latest commit

 

History

History
51 lines (43 loc) · 2.12 KB

2.6 GPMember.md

File metadata and controls

51 lines (43 loc) · 2.12 KB

Introduction

GPMember is an individual in GPModel instances. It can be extended the override the default behavior defined. The GPMember class extends the GAMember abstract class and implements all the abstract methods in the GAMember class.

Constructor

The GPMember and its subclass must have an empty constructor to allow GPModel to instantiate GPMembers during the initialization and offspring reproduction phase. Additional information can be set using the init method.

Methods

Signature Description
init(member, template, maxHeight) Initialize the individual.
signal = exec(member, env) Execute the strategy.
crossover(member, mateMember, opt) Crossover operation in GP.
mutate(member, opt) Mutation in GP.
depth = getDepth(member) Get the depth of the parse tree.

init(member, template, maxHeight)

Replace part of the current individual's parse tree with the mateMember's.

Arguments

Argument Description
template The template specifies how the parse tree is grown.
maxHeight The maximum height allowed for the parse tree.

signal = exec(member, env)

Execute the strategy given the env.

Arguments

Argument Description
template The individual whose sections of parse tree will be passed to the current member
env Environment variables.

crossover(member, mateMember, opt)

Replace part of the current individual's chromosome with the mateMember's.

Arguments

Argument Description
mateMember The other individual whose sections chromosome will be passed to the current member
opt Options for developers to specify

mutate(member, opt)

Change part of the chromosome with randomly generated ones. The genetic operator introduces gene diversity into the population.

Arguments

Argument Description
opt Options for developers to specify

depth = getDepth(member)

Return the depth of the parse tree.

License

This project, including the documentation, is licensed under the MIT license. Copyright (c) 2022 Bohui WU.