|
1 | | -Base.show(io::IO, g::CxxWrap.StdLib.SharedPtrAllocated{Game}) = print(io, to_string(g)) |
2 | | -Base.show(io::IO, s::CxxWrap.StdLib.UniquePtrAllocated{State}) = print(io, to_string(s)) |
| 1 | +Base.show(io::IO, g::CxxWrap.StdLib.SharedPtrAllocated{Game}) = print(io, to_string(g[])) |
| 2 | +Base.show(io::IO, s::CxxWrap.StdLib.UniquePtrAllocated{State}) = print(io, to_string(s[])) |
3 | 3 | Base.show(io::IO, gp::Union{GameParameterAllocated, GameParameterDereferenced}) = print(io, to_repr_string(gp)) |
4 | 4 |
|
5 | 5 | function Base.hash(s::CxxWrap.CxxWrapCore.SmartPointer{T}, h::UInt) where {T<:Union{Game,State}} |
6 | | - hash(to_string(s), h) |
| 6 | + hash(to_string(s[]), h) |
7 | 7 | end |
8 | 8 |
|
9 | 9 | function Base.:(==)(s::CxxWrap.CxxWrapCore.SmartPointer{T}, ss::CxxWrap.CxxWrapCore.SmartPointer{T}) where {T<:Union{Game, State}} |
10 | | - to_string(s) == to_string(ss) |
| 10 | + to_string(s[]) == to_string(ss[]) |
11 | 11 | end |
12 | 12 |
|
13 | 13 | GameParameter(x::Int) = GameParameter(Ref(Int32(x))) |
14 | 14 |
|
15 | 15 | Base.copy(s::CxxWrap.StdLib.UniquePtrAllocated{State}) = deepcopy(s) |
16 | | -Base.deepcopy(s::CxxWrap.StdLib.UniquePtrAllocated{State}) = clone(s) |
| 16 | +Base.deepcopy(s::CxxWrap.StdLib.UniquePtrAllocated{State}) = clone(s[]) |
17 | 17 | Base.reshape(s::CxxWrap.StdLib.StdVectorAllocated, dims::Int32...) = reshape(s, Int.(dims)) |
18 | 18 |
|
19 | 19 | if Sys.KERNEL == :Linux |
@@ -75,3 +75,77 @@ function load_game_as_turn_based(s::Union{String, CxxWrap.StdLib.StdStringAlloca |
75 | 75 | _load_game_as_turn_based(s, StdMap{StdString, GameParameter}(ps)) |
76 | 76 | end |
77 | 77 | end |
| 78 | + |
| 79 | +is_chance_node(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = is_chance_node(state[]) |
| 80 | + |
| 81 | +new_initial_state(game::CxxWrap.StdLib.SharedPtrAllocated{Game}) = new_initial_state(game[]) |
| 82 | + |
| 83 | +legal_actions(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = legal_actions(state[]) |
| 84 | + |
| 85 | +child(state::CxxWrap.StdLib.UniquePtrAllocated{State}, i::Int64) = child(state[], i) |
| 86 | + |
| 87 | +is_terminal(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = is_terminal(state[]) |
| 88 | + |
| 89 | +information_state_string(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = information_state_string(state[]) |
| 90 | + |
| 91 | +get_uniform_policy(game::CxxWrap.StdLib.SharedPtrAllocated{Game}) = get_uniform_policy(game[]) |
| 92 | + |
| 93 | +record_batched_trajectories(game::CxxWrap.StdLib.SharedPtrAllocated{Game}, p::CxxWrap.StdLib.StdVectorAllocated{TabularPolicy}, m::StdMapAllocated{StdString, Int32}, i::Int64, b::Bool, i2::Int64, i3::Int64) = record_batched_trajectories(game[], p, m, i, b, i2, i3) |
| 94 | + |
| 95 | +expected_returns(state::CxxWrap.StdLib.UniquePtrAllocated{State}, policy::CxxWrap.StdLib.SharedPtrAllocated{Policy}, i::Int64) = expected_returns(state[], policy[], i) |
| 96 | + |
| 97 | +exploitability(game::CxxWrap.StdLib.SharedPtrAllocated{Game}, policy::CxxWrap.StdLib.SharedPtrAllocated{Policy}) = exploitability(game[], policy[]) |
| 98 | + |
| 99 | +current_player(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = current_player(state[]) |
| 100 | + |
| 101 | +action_to_string(state::CxxWrap.StdLib.UniquePtrAllocated{State}, i1, i2) = action_to_string(state[], i1, i2) |
| 102 | + |
| 103 | +apply_action(state::CxxWrap.StdLib.UniquePtrAllocated{State}, i::AbstractVector{<:Number}) = apply_action(state[], i) |
| 104 | + |
| 105 | +apply_action(state::CxxWrap.StdLib.UniquePtrAllocated{State}, i::Number) = apply_action(state[], i) |
| 106 | + |
| 107 | +restart_at(b::MCTSBotAllocated, s::CxxWrap.StdLib.UniquePtrAllocated{State}) = restart_at(b, s[]) |
| 108 | + |
| 109 | +best_child(root::CxxWrap.StdLib.UniquePtrAllocated{SearchNode}) = best_child(root[]) |
| 110 | + |
| 111 | +get_outcome(root::CxxWrap.StdLib.UniquePtrAllocated{SearchNode}) = get_outcome(root[]) |
| 112 | + |
| 113 | +get_player(p::CxxWrap.StdLib.UniquePtrAllocated{SearchNode}) = get_player(p[]) |
| 114 | + |
| 115 | +get_children(root::CxxWrap.StdLib.UniquePtrAllocated{SearchNode}) = get_children(root[]) |
| 116 | + |
| 117 | +is_simultaneous_node(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = is_simultaneous_node(state[]) |
| 118 | + |
| 119 | +step(bot, state::CxxWrap.StdLib.UniquePtrAllocated{State}) = step(bot, state[]) |
| 120 | + |
| 121 | +chance_outcomes(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = chance_outcomes(state[]) |
| 122 | + |
| 123 | +returns(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = returns(state[]) |
| 124 | + |
| 125 | +min_utility(game::CxxWrap.StdLib.SharedPtrAllocated{Game}) = min_utility(game[]) |
| 126 | + |
| 127 | +max_utility(game::CxxWrap.StdLib.SharedPtrAllocated{Game}) = max_utility(game[]) |
| 128 | + |
| 129 | +serialize_game_and_state(game::CxxWrap.StdLib.SharedPtrAllocated{Game}, state::CxxWrap.StdLib.UniquePtrAllocated{State}) = serialize_game_and_state(game[], state[]) |
| 130 | + |
| 131 | +is_mean_field_node(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = is_mean_field_node(state[]) |
| 132 | + |
| 133 | +legal_actions(state::CxxWrap.StdLib.UniquePtrAllocated{State}, i) = legal_actions(state[], i) |
| 134 | + |
| 135 | +history(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = history(state[]) |
| 136 | + |
| 137 | +is_player_node(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = is_player_node(state[]) |
| 138 | + |
| 139 | +num_players(game::CxxWrap.StdLib.SharedPtrAllocated{Game}) = num_players(game[]) |
| 140 | + |
| 141 | +distribution_support(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = distribution_support(state[]) |
| 142 | + |
| 143 | +get_type(game::CxxWrap.StdLib.SharedPtrAllocated{Game}) = get_type(game[]) |
| 144 | + |
| 145 | +update_distribution(state::CxxWrap.StdLib.UniquePtrAllocated{State}, dist::CxxWrap.StdLib.StdVectorAllocated{Float64}) = update_distribution(state[], dist) |
| 146 | + |
| 147 | +num_cols(game::CxxWrap.StdLib.SharedPtrAllocated{MatrixGame}) = num_cols(game[]) |
| 148 | + |
| 149 | +num_rows(game::CxxWrap.StdLib.SharedPtrAllocated{MatrixGame}) = num_rows(game[]) |
| 150 | + |
| 151 | +extensive_to_matrix_game(game::CxxWrap.StdLib.SharedPtrAllocated{Game}) = extensive_to_matrix_game(game[]) |
0 commit comments