node: R6 Class Representing a node in tree for StoSOO

nodeR Documentation

R6 Class Representing a node in tree for StoSOO

Description

node object store specific information on each node in tree for StoSOO

Public fields

depth

[numeric] Depth of this node

position

[numeric] Position of this node

xMin

[numeric] Minimum value of this node (cell)

xMax

[numeric] Maximum value of this node (cell)

xRepresentative

[numeric] Representative value of this node (cell)

isLeaf

[logical] Is this node a leaf of the tree or not

isMax

[logical] Does this node returns a maximum UCB in the layer or not

isEvaluationFinished

[logical] Is evaluation of this node finished or not

nEvals

[numeric] Number of evaluations for this node

rewards

[numeric] Rewards evaluated (returned) by 'maximizeFunc' for this node

rewardMean

[numeric] Empirical average of 'rewards'

ucbValue

[numeric] Upper confidence bound of rewards

nMaxEvalPerNode

[numeric] Maximum number of evaluations per leaf

widthBase

[numeric] Base of width of the estimates of rewards

maximizeFunc

[function] Function to be maximized given parameters scaled from 0 to 1.

funcScale

[numeric] Scale for function to be optimized. If 'maximize = TRUE', 'funcScale = 1', and else 'funcScale = -1'.

withCheck

[logical] Check arguments for 'node', 'layer', and 'tree' class or not

verbose

[logical] Display information

childrenNodes

[list] List of children nodes for this node (after the node is expanded)

Methods

Public methods


Method new()

Create a new node object

Usage
node$new(
  depth,
  position,
  xMin,
  xMax,
  xRepresentative = NULL,
  isLeaf = TRUE,
  isMax = FALSE,
  isEvaluationFinished = FALSE,
  nEvals = 0,
  rewards = c(),
  rewardMean = 0,
  ucbValue = 0,
  nMaxEvalPerNode,
  widthBase,
  maximizeFunc,
  funcScale,
  withCheck = FALSE,
  verbose = TRUE
)
Arguments
depth

[numeric] Depth of this node

position

[numeric] Position of this node

xMin

[numeric] Minimum value of this node (cell)

xMax

[numeric] Maximum value of this node (cell)

xRepresentative

[numeric] Representative value of this node (cell)

isLeaf

[logical] Is this node a leaf of the tree or not

isMax

[logical] Does this node returns a maximum UCB in the layer or not

isEvaluationFinished

[logical] Is evaluation of this node finished or not

nEvals

[numeric] Number of evaluations for this node

rewards

[numeric] Rewards evaluated (returned) by 'maximizeFunc' for this node

rewardMean

[numeric] Empirical average of 'rewards'

ucbValue

[numeric] Upper confidence bound of rewards

nMaxEvalPerNode

[numeric] Maximum number of evaluations per leaf

widthBase

[numeric] Base of width of the estimates of rewards

maximizeFunc

[function] Function to be maximized given parameters scaled from 0 to 1.

funcScale

[numeric] Scale for function to be optimized. If 'maximize = TRUE', 'funcScale = 1', and else 'funcScale = -1'.

withCheck

[logical] Check arguments for 'node', 'layer', and 'tree' class or not

verbose

[logical] Display information


Method performEvaluation()

perform evaluation for this node (evaluate function and compute reward and UCB values)

Usage
node$performEvaluation()

Method expandNewNode()

expand this node and create new children for the node

Usage
node$expandNewNode(nChildrenPerExpansion)
Arguments
nChildrenPerExpansion

[numeric] Number of children per expansion


Method print()

Display information about the object

Usage
node$print()

Method clone()

The objects of this class are cloneable with this method.

Usage
node$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


KosukeHamazaki/myBreedSimulatR documentation built on Aug. 31, 2024, 3:55 p.m.