new LinearFunctionNode(func, registerSet)
Linear genetic programming function node
Parameters:
| Name | Type | Description |
|---|---|---|
func |
function | A function that this node will represent |
registerSet |
RegisterSet | A register set instance |
- Source:
Properties:
| Name | Type | Description |
|---|---|---|
targetRegister |
RegisterReference | A target register reference |
Extends
Methods
-
execute(registerSet) → {LinearFunctionNode}
-
Sets the target register value based on the return value of the function from the given register set
Parameters:
Name Type Description registerSetRegisterSet A register set instance
Returns:
Reference to current object for chaining
- Type
- LinearFunctionNode
-
getArgumentsString() → {string}
-
Returns a comma seperated string of input registers
- Inherited From:
- Source:
Returns:
A comma seperated string of input registers
- Type
- string
-
getFuncReturnValue(registerSet) → {*}
-
Returns the value returned by the nodes function based on the input values from a given register set
Parameters:
Name Type Description registerSetRegisterSet A register set instance
- Inherited From:
- Source:
Returns:
Functon return value
- Type
- *
-
setInputRegisters(registerSet) → {LinearGPNode}
-
Randomly sets two input registers based on the provided register set
Parameters:
Name Type Description registerSetRegisterSet A register set instance
- Inherited From:
- Source:
Returns:
Reference to current object for chaining
- Type
- LinearGPNode
-
setTargetRegister(registerSet) → {LinearFunctionNode}
-
Randomly sets the target register based on the provided register set
Parameters:
Name Type Description registerSetRegisterSet A register set instance
Returns:
Reference to current object for chaining
- Type
- LinearFunctionNode
-
toString() → {string}
-
Returns a string representation of the linear function node
Returns:
A string representation of the linear function node
- Type
- string