layer: R6 Class Representing a layer in tree for StoSOO

layerR Documentation

R6 Class Representing a layer in tree for StoSOO

Description

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

Public fields

nodesList

[list] List of nodes ('node' class object) in this layer

depth

[numeric] Depth of this layer

optimizeType

[character] Either 'deterministic' for optimizing a deterministic function or 'stochastic' for a stochastic one

nChildrenPerExpansion

[numeric] Number of children per expansion

nNodes

[numeric] Number nodes in this layer

positions

[numeric] Positions of the nodes in this layer

ucbValues

[numeric] Upper confidence bounds of the nodes in this layer

rewardMeans

[numeric] Empirical averages of 'rewards' of the nodes in this layer

isLeaves

[numeric] Are the nodes in this layer leaves of the tree or not

withCheck

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

maxUcbValues

[numeric] Maximum UCB value (or ‘rewardMean' for ’deterministic' function) of the leaf node in the layer

positionMaxUcbValues

[numeric] Position of the leaf node which shows maximum UCB value (or ‘rewardMean' for ’deterministic' function)

maxUcbValuesSoFar

[numeric] Maximum UCB value for the layers shallower than this layer

Methods

Public methods


Method new()

Create a new layer object

Usage
layer$new(
  nodesList,
  depth = NULL,
  optimizeType,
  nChildrenPerExpansion,
  withCheck = FALSE
)
Arguments
nodesList

[list] List of nodes ('node' class object) in this layer

depth

[numeric] Depth of this layer

optimizeType

[character] Either 'deterministic' for optimizing a deterministic function or 'stochastic' for a stochastic one

nChildrenPerExpansion

[numeric] Number of children per expansion

withCheck

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


Method addNodes()

Add new nodes to the layer object

Usage
layer$addNodes(newNodesList = NULL)
Arguments
newNodesList

[list] List of new nodes ('node' class object) to be added to this layer


Method sortedByPosition()

Sort nodes in this layer by position

Usage
layer$sortedByPosition()

Method evaluateMaximum()

Evaluate maximum value of the leaf node in this layer

Usage
layer$evaluateMaximum()

Method performOneAction()

Update layer information once

Usage
layer$performOneAction(maxUcbValuesSoFar)
Arguments
maxUcbValuesSoFar

[numeric] Maximum UCB value for the layers shallower than this layer


Method print()

Display information about the object

Usage
layer$print()

Method clone()

The objects of this class are cloneable with this method.

Usage
layer$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


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