kgp.tree / Constant

Constant

class Constant : Terminal

A terminal node that represents a constant value.

Evaluating a constant node will simply result in the value the node encapsulates.

Constructors

<init> Constant(value: Double)

A terminal node that represents a constant value.

Properties

value val value: Double

The constant value of this node.

Inherited Properties

arity val arity: Int

The number of arguments that this node expects.

Functions

evaluate fun evaluate(args: List<Double>): Double

Gives the value stored at this node.