Class: Ai4r::Search::MCTS::Node

Inherits:
Struct
  • Object
show all
Defined in:
lib/ai4r/search/mcts.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(state, parent = nil, action = nil) ⇒ Node

Returns a new instance of Node.



35
36
37
# File 'lib/ai4r/search/mcts.rb', line 35

def initialize(state, parent = nil, action = nil)
  super(state, parent, action, [], 0, 0.0)
end

Instance Attribute Details

#actionObject

Returns the value of attribute action

Returns:

  • (Object)

    the current value of action



34
35
36
# File 'lib/ai4r/search/mcts.rb', line 34

def action
  @action
end

#childrenObject

Returns the value of attribute children

Returns:

  • (Object)

    the current value of children



34
35
36
# File 'lib/ai4r/search/mcts.rb', line 34

def children
  @children
end

#parentObject

Returns the value of attribute parent

Returns:

  • (Object)

    the current value of parent



34
35
36
# File 'lib/ai4r/search/mcts.rb', line 34

def parent
  @parent
end

#stateObject

Returns the value of attribute state

Returns:

  • (Object)

    the current value of state



34
35
36
# File 'lib/ai4r/search/mcts.rb', line 34

def state
  @state
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



34
35
36
# File 'lib/ai4r/search/mcts.rb', line 34

def value
  @value
end

#visitsObject

Returns the value of attribute visits

Returns:

  • (Object)

    the current value of visits



34
35
36
# File 'lib/ai4r/search/mcts.rb', line 34

def visits
  @visits
end