Hi,
So I am working on trying to implement the minimax tree algorithm given in the AI book. Here is the algorithm:
Code:
function MINIMAX-DECISION(state) returns an action
return argmax_a _∈ _ACTIONS(s) MIN-VALUE(RESULT(state, a))
function MAX-VALUE(state) returns a utility value
if TERMINAL-TEST(state) then return UTILITY(state)
v ←−∞
for each a in ACTIONS(state)do
v ← MAX(v, MIN-VALUE(RESULT(s, a)))
return v
function MIN-VALUE(state) returns a utility value
if TERMINAL-TEST(state) then return UTILITY(state)
v ←∞
for each a in ACTIONS(state)do
v ← MIN(v, MAX-VALUE(RESULT(s, a)))
return v
So if my problem is to return a max value from the input of a tree in a form of nested list, such as ((1,2,3),(4,5,6)), which after the minimax call, the output would be 4. What does the above algorithm mean by saying "ACTIONS, UTILITY, TERMINAL-TEST," and "RESULT(s,a)"? What are s and or a?
I am trying to understand this algorithm before I go ahead and attempt to implement it in C++.
Any clarification is appreciated.