module GameTree: sig
.. end
Game Tree used for choosing moves.
val parallel_toss : (int * string) Pervasives.ref
We can parallelize computation to a second running Toss client.
The second client must be running on the given port and server.
If the port is 0 (default) then we do not parallelize.
Abstract Game Trees
type ('a, 'b)
abstract_game_tree =
Abstract game tree, just stores state and move information.
val str_abstract : ?upto:int ->
?struc:bool ->
?depth:int ->
('a -> string) ->
('b -> string) -> ('a, 'b) abstract_game_tree -> string
Abstract tree printing function.
val size : ('a, 'b) abstract_game_tree -> int
Number of nodes in the tree.
val player : ('a, 'b) abstract_game_tree -> int
Player in the given node.
val state : ('a, 'b) abstract_game_tree -> Arena.game_state
State in the given node.
val init_abstract : Arena.game ->
Arena.game_state ->
(Arena.game -> Arena.game_state -> int -> 'a) ->
('a, 'b) abstract_game_tree
Abstract initialization function.
val unfold_abstract : ?timeout:(unit -> bool) ->
?depth:int ->
Arena.game ->
info_terminal:(int -> Arena.game -> Arena.game_state -> int -> 'a -> 'b) ->
info_leaf:(int -> Arena.game -> Arena.game_state -> int -> int -> 'a) ->
info_node:(int ->
Arena.game ->
Arena.game_state ->
int ->
(Arena.move * ('a, 'b) abstract_game_tree) array -> 'a) ->
choice:(int ->
Arena.game ->
Arena.game_state ->
int ->
'a ->
(Arena.move * ('a, 'b) abstract_game_tree) array -> int) ->
('a, 'b) abstract_game_tree -> ('a, 'b) abstract_game_tree
Abstract game tree unfolding function, calls argument functions for work.
Trees with Payoff and Heuristic Data
val cPAYOFF_AS_HEUR : float Pervasives.ref
How to exchange payoffs for heuristics.
type 'a
node_info = {
|
heurs :float array ; |
|
heurs_are_exact :bool ; |
|
info :'a ; |
}
The general information in a game tree node.
type 'a
terminal_info = {
|
payoffs :float array ; |
|
heurs_t :float array ; |
|
info_t :'a ; |
}
type 'a
game_tree = ('a node_info, 'a terminal_info)
abstract_game_tree
val str : ('a -> string) ->
?upto:int -> ?struc:bool -> ?depth:int -> 'a game_tree -> string
Game tree printing function.
val node_values : 'a game_tree -> float array
The values of a game tree node.
val node_info : 'a game_tree -> 'a
Get the stored information of a game tree node.
val choose_moves : Arena.game -> 'a game_tree -> (Arena.move * Arena.game_state) list
Choose all maximizing moves given a game tree.
val init : Arena.game ->
Arena.game_state ->
(int -> Arena.game -> Arena.game_state -> 'a) ->
Formula.real_expr array array -> 'a game_tree
Game tree initialization.
val unfold : ?timeout:(unit -> bool) ->
?ab:bool ->
Arena.game ->
Formula.real_expr array array ->
info_leaf:(int -> Arena.game -> Arena.game_state -> 'a) ->
info_node:(int ->
int ->
float array -> (Arena.move * 'a game_tree) array -> 'a) ->
choice:(float array option Pervasives.ref ->
int ->
Arena.game ->
Arena.game_state ->
int ->
'a node_info ->
(Arena.move * 'a game_tree) array -> int) ->
'a game_tree -> 'a game_tree
Game tree unfolding.