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.
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.
| 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. |
Replace part of the current individual's parse tree with the mateMember's.
| Argument | Description |
|---|---|
template |
The template specifies how the parse tree is grown. |
maxHeight |
The maximum height allowed for the parse tree. |
Execute the strategy given the env.
| Argument | Description |
|---|---|
template |
The individual whose sections of parse tree will be passed to the current member |
env |
Environment variables. |
Replace part of the current individual's chromosome with the mateMember's.
| Argument | Description |
|---|---|
mateMember |
The other individual whose sections chromosome will be passed to the current member |
opt |
Options for developers to specify |
Change part of the chromosome with randomly generated ones. The genetic operator introduces gene diversity into the population.
| Argument | Description |
|---|---|
opt |
Options for developers to specify |
Return the depth of the parse tree.
This project, including the documentation, is licensed under the MIT license. Copyright (c) 2022 Bohui WU.