From 098cc811693a49d09163586ff0c4f2582939ef8b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 9 Mar 2024 00:59:05 +0000 Subject: [PATCH 01/15] CompatHelper: bump compat for "CxxWrap" to "0.15" --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index a4a0a9e..e62c52a 100644 --- a/Project.toml +++ b/Project.toml @@ -8,7 +8,7 @@ CxxWrap = "1f15a43c-97ca-5a2a-ae31-89f07a497df4" OpenSpiel_jll = "bd10a763-4654-5023-a028-c4918c6cd33e" [compat] -CxxWrap = "0.14" +CxxWrap = "0.14, 0.15" OpenSpiel_jll = "1" julia = "1.6" From e44d453864923d82da657a41bd538c235a2d609f Mon Sep 17 00:00:00 2001 From: Jeremiah <4462211+jeremiahpslewis@users.noreply.github.com> Date: Wed, 4 Sep 2024 22:07:53 +0200 Subject: [PATCH 02/15] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index e2f1f92..6806e90 100644 --- a/Project.toml +++ b/Project.toml @@ -9,7 +9,7 @@ OpenSpiel_jll = "bd10a763-4654-5023-a028-c4918c6cd33e" [compat] CxxWrap = "0.15" -OpenSpiel_jll = "1.5" +OpenSpiel_jll = "1.5.1" julia = "1.6" [extras] From 8132da37c2fb88144725061992a0b52c47dfe3ca Mon Sep 17 00:00:00 2001 From: Jeremiah <4462211+jeremiahpslewis@users.noreply.github.com> Date: Wed, 4 Sep 2024 22:11:38 +0200 Subject: [PATCH 03/15] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 6806e90..85b6014 100644 --- a/Project.toml +++ b/Project.toml @@ -8,7 +8,7 @@ CxxWrap = "1f15a43c-97ca-5a2a-ae31-89f07a497df4" OpenSpiel_jll = "bd10a763-4654-5023-a028-c4918c6cd33e" [compat] -CxxWrap = "0.15" +CxxWrap = "0.16" OpenSpiel_jll = "1.5.1" julia = "1.6" From b4c1809a95a49343abec1c7a658a2da9832eae6b Mon Sep 17 00:00:00 2001 From: Jeremiah <4462211+jeremiahpslewis@users.noreply.github.com> Date: Wed, 4 Sep 2024 22:14:20 +0200 Subject: [PATCH 04/15] Update patch.jl --- src/patch.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/patch.jl b/src/patch.jl index d7f018d..31dc5a6 100644 --- a/src/patch.jl +++ b/src/patch.jl @@ -78,8 +78,7 @@ end is_chance_node(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = is_chance_node(state[]) -new_initial_state(game::CxxWrap.StdLib.SharedPtrAllocated{Game}) = new_initial_state(game[]) - +new_initial_state(game::CxxWrap.StdLib.SharedPtrAllocated{CxxWrap.CxxWrapCore.CxxConst{Game}}) = new_initial_state(game[]) legal_actions(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = legal_actions(state[]) child(state::CxxWrap.StdLib.UniquePtrAllocated{State}, i::Int64) = child(state[], i) From f64d5f0c35e81ba4f0a70c0fe1341270d00df66b Mon Sep 17 00:00:00 2001 From: Jeremiah <4462211+jeremiahpslewis@users.noreply.github.com> Date: Wed, 4 Sep 2024 22:18:32 +0200 Subject: [PATCH 05/15] Update patch.jl --- src/patch.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/patch.jl b/src/patch.jl index 31dc5a6..6182f83 100644 --- a/src/patch.jl +++ b/src/patch.jl @@ -78,7 +78,7 @@ end is_chance_node(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = is_chance_node(state[]) -new_initial_state(game::CxxWrap.StdLib.SharedPtrAllocated{CxxWrap.CxxWrapCore.CxxConst{Game}}) = new_initial_state(game[]) +new_initial_state(game::CxxWrap.StdLib.SharedPtrAllocated{CxxWrap.CxxWrapCore.CxxConst{Game}}) = new_initial_state(game[][]) legal_actions(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = legal_actions(state[]) child(state::CxxWrap.StdLib.UniquePtrAllocated{State}, i::Int64) = child(state[], i) From a9ba9d1c33e9511a81ed381192d1d06e929312c4 Mon Sep 17 00:00:00 2001 From: Jeremiah <4462211+jeremiahpslewis@users.noreply.github.com> Date: Wed, 4 Sep 2024 22:20:20 +0200 Subject: [PATCH 06/15] Update Project.toml --- Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Project.toml b/Project.toml index 85b6014..c1e33e9 100644 --- a/Project.toml +++ b/Project.toml @@ -10,6 +10,7 @@ OpenSpiel_jll = "bd10a763-4654-5023-a028-c4918c6cd33e" [compat] CxxWrap = "0.16" OpenSpiel_jll = "1.5.1" +StatsBase = "0.34" julia = "1.6" [extras] From 63dfcb72b9f18fb3f0a483218856069838f91a08 Mon Sep 17 00:00:00 2001 From: Jeremiah <4462211+jeremiahpslewis@users.noreply.github.com> Date: Wed, 4 Sep 2024 22:23:02 +0200 Subject: [PATCH 07/15] Update patch.jl --- src/patch.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/patch.jl b/src/patch.jl index 6182f83..d015b03 100644 --- a/src/patch.jl +++ b/src/patch.jl @@ -127,7 +127,7 @@ chance_outcomes(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = chance_outcom returns(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = returns(state[]) -min_utility(game::CxxWrap.StdLib.SharedPtrAllocated{Game}) = min_utility(game[]) +min_utility(::CxxWrap.StdLib.SharedPtrAllocated{CxxWrap.CxxWrapCore.CxxConst{Game}}) = min_utility(game[][]) max_utility(game::CxxWrap.StdLib.SharedPtrAllocated{Game}) = max_utility(game[]) From f8c9a33ec829a9d430603715a1497d282cd75cfb Mon Sep 17 00:00:00 2001 From: Jeremiah <4462211+jeremiahpslewis@users.noreply.github.com> Date: Wed, 4 Sep 2024 22:29:06 +0200 Subject: [PATCH 08/15] Update patch.jl --- src/patch.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/patch.jl b/src/patch.jl index d015b03..3e0112f 100644 --- a/src/patch.jl +++ b/src/patch.jl @@ -99,7 +99,7 @@ record_batched_trajectories(game::CxxWrap.StdLib.SharedPtrAllocated{Game}, p::Cx expected_returns(state::CxxWrap.StdLib.UniquePtrAllocated{State}, policy::CxxWrap.StdLib.SharedPtrAllocated{Policy}, i::Int64) = expected_returns(state[], policy[], i) -exploitability(game::CxxWrap.StdLib.SharedPtrAllocated{Game}, policy::CxxWrap.StdLib.SharedPtrAllocated{Policy}) = exploitability(game[], policy[]) +exploitability(game::CxxWrap.StdLib.SharedPtrAllocated{CxxWrap.CxxWrapCore.CxxConst{Game}}, policy::CxxWrap.StdLib.SharedPtrAllocated{Policy}) = exploitability(game[][], policy[]) current_player(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = current_player(state[]) From 54cd3fa6828d608c9216e9d323d73f2526dff8d0 Mon Sep 17 00:00:00 2001 From: Jeremiah <4462211+jeremiahpslewis@users.noreply.github.com> Date: Wed, 4 Sep 2024 22:29:23 +0200 Subject: [PATCH 09/15] Update patch.jl --- src/patch.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/patch.jl b/src/patch.jl index 3e0112f..f2b873f 100644 --- a/src/patch.jl +++ b/src/patch.jl @@ -127,7 +127,7 @@ chance_outcomes(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = chance_outcom returns(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = returns(state[]) -min_utility(::CxxWrap.StdLib.SharedPtrAllocated{CxxWrap.CxxWrapCore.CxxConst{Game}}) = min_utility(game[][]) +min_utility(game::CxxWrap.StdLib.SharedPtrAllocated{CxxWrap.CxxWrapCore.CxxConst{Game}}) = min_utility(game[][]) max_utility(game::CxxWrap.StdLib.SharedPtrAllocated{Game}) = max_utility(game[]) From f5a95d0850080423619c7465fa46cccf0803869f Mon Sep 17 00:00:00 2001 From: Jeremiah <4462211+jeremiahpslewis@users.noreply.github.com> Date: Wed, 4 Sep 2024 22:32:42 +0200 Subject: [PATCH 10/15] fix type signatures --- src/patch.jl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/patch.jl b/src/patch.jl index f2b873f..41f4e24 100644 --- a/src/patch.jl +++ b/src/patch.jl @@ -91,11 +91,11 @@ information_state_string(state::CxxWrap.StdLib.UniquePtrAllocated{State}, i) = i information_state_tensor(state::CxxWrap.StdLib.UniquePtrAllocated{State}, i::Int64) = information_state_tensor(state[], i) -information_state_tensor_shape(game::CxxWrap.StdLib.SharedPtrAllocated{Game}) = information_state_tensor_shape(game[]) +information_state_tensor_shape(game::CxxWrap.StdLib.SharedPtrAllocated{CxxWrap.CxxWrapCore.CxxConst{Game}}) = information_state_tensor_shape(game[][]) -get_uniform_policy(game::CxxWrap.StdLib.SharedPtrAllocated{Game}) = get_uniform_policy(game[]) +get_uniform_policy(game::CxxWrap.StdLib.SharedPtrAllocated{CxxWrap.CxxWrapCore.CxxConst{Game}}) = get_uniform_policy(game[][]) -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) +record_batched_trajectories(game::CxxWrap.StdLib.SharedPtrAllocated{CxxWrap.CxxWrapCore.CxxConst{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) expected_returns(state::CxxWrap.StdLib.UniquePtrAllocated{State}, policy::CxxWrap.StdLib.SharedPtrAllocated{Policy}, i::Int64) = expected_returns(state[], policy[], i) @@ -129,9 +129,9 @@ returns(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = returns(state[]) min_utility(game::CxxWrap.StdLib.SharedPtrAllocated{CxxWrap.CxxWrapCore.CxxConst{Game}}) = min_utility(game[][]) -max_utility(game::CxxWrap.StdLib.SharedPtrAllocated{Game}) = max_utility(game[]) +max_utility(game::CxxWrap.StdLib.SharedPtrAllocated{CxxWrap.CxxWrapCore.CxxConst{Game}}) = max_utility(game[][]) -serialize_game_and_state(game::CxxWrap.StdLib.SharedPtrAllocated{Game}, state::CxxWrap.StdLib.UniquePtrAllocated{State}) = serialize_game_and_state(game[], state[]) +serialize_game_and_state(game::CxxWrap.StdLib.SharedPtrAllocated{CxxWrap.CxxWrapCore.CxxConst{Game}}, state::CxxWrap.StdLib.UniquePtrAllocated{State}) = serialize_game_and_state(game[][], state[]) is_mean_field_node(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = is_mean_field_node(state[]) @@ -141,16 +141,16 @@ history(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = history(state[]) is_player_node(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = is_player_node(state[]) -num_players(game::CxxWrap.StdLib.SharedPtrAllocated{Game}) = num_players(game[]) +num_players(game::CxxWrap.StdLib.SharedPtrAllocated{CxxWrap.CxxWrapCore.CxxConst{Game}}) = num_players(game[][]) distribution_support(state::CxxWrap.StdLib.UniquePtrAllocated{State}) = distribution_support(state[]) -get_type(game::CxxWrap.StdLib.SharedPtrAllocated{Game}) = get_type(game[]) +get_type(game::CxxWrap.StdLib.SharedPtrAllocated{CxxWrap.CxxWrapCore.CxxConst{Game}}) = get_type(game[][]) update_distribution(state::CxxWrap.StdLib.UniquePtrAllocated{State}, dist::CxxWrap.StdLib.StdVectorAllocated{Float64}) = update_distribution(state[], dist) -num_cols(game::CxxWrap.StdLib.SharedPtrAllocated{MatrixGame}) = num_cols(game[]) +num_cols(game::CxxWrap.StdLib.SharedPtrAllocated{MatrixGame}) = num_cols(game[][]) -num_rows(game::CxxWrap.StdLib.SharedPtrAllocated{MatrixGame}) = num_rows(game[]) +num_rows(game::CxxWrap.StdLib.SharedPtrAllocated{MatrixGame}) = num_rows(game[][]) -extensive_to_matrix_game(game::CxxWrap.StdLib.SharedPtrAllocated{Game}) = extensive_to_matrix_game(game[]) +extensive_to_matrix_game(game::CxxWrap.StdLib.SharedPtrAllocated{CxxWrap.CxxWrapCore.CxxConst{Game}}) = extensive_to_matrix_game(game[][]) From 4131627e145376d8f2dd24ac825f0a7422fef1b8 Mon Sep 17 00:00:00 2001 From: Jeremiah <4462211+jeremiahpslewis@users.noreply.github.com> Date: Wed, 4 Sep 2024 22:37:10 +0200 Subject: [PATCH 11/15] fix matrixgame --- src/patch.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/patch.jl b/src/patch.jl index 41f4e24..b4953c3 100644 --- a/src/patch.jl +++ b/src/patch.jl @@ -149,8 +149,8 @@ get_type(game::CxxWrap.StdLib.SharedPtrAllocated{CxxWrap.CxxWrapCore.CxxConst{Ga update_distribution(state::CxxWrap.StdLib.UniquePtrAllocated{State}, dist::CxxWrap.StdLib.StdVectorAllocated{Float64}) = update_distribution(state[], dist) -num_cols(game::CxxWrap.StdLib.SharedPtrAllocated{MatrixGame}) = num_cols(game[][]) +num_cols(game::CxxWrap.StdLib.SharedPtrAllocated{CxxWrap.CxxWrapCore.CxxConst{MatrixGame}}) = num_cols(game[][]) -num_rows(game::CxxWrap.StdLib.SharedPtrAllocated{MatrixGame}) = num_rows(game[][]) +num_rows(game::CxxWrap.StdLib.SharedPtrAllocated{CxxWrap.CxxWrapCore.CxxConst{MatrixGame}}) = num_rows(game[][]) extensive_to_matrix_game(game::CxxWrap.StdLib.SharedPtrAllocated{CxxWrap.CxxWrapCore.CxxConst{Game}}) = extensive_to_matrix_game(game[][]) From a041e5aaa9eafc149fa5a21e5aa2447f5672fa0c Mon Sep 17 00:00:00 2001 From: Jeremiah <4462211+jeremiahpslewis@users.noreply.github.com> Date: Wed, 4 Sep 2024 22:41:29 +0200 Subject: [PATCH 12/15] try fixing game load --- src/patch.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/patch.jl b/src/patch.jl index b4953c3..3bc0ff0 100644 --- a/src/patch.jl +++ b/src/patch.jl @@ -60,19 +60,19 @@ end function load_game(s::Union{String, CxxWrap.StdLib.StdStringAllocated}; kw...) if length(kw) == 0 - _load_game(s) + _load_game(s)[] else ps = [StdString(string(k)) => v for (k,v) in kw] - _load_game(s, StdMap{StdString, GameParameter}(ps)) + _load_game(s, StdMap{StdString, GameParameter}(ps))[] end end function load_game_as_turn_based(s::Union{String, CxxWrap.StdLib.StdStringAllocated}; kw...) if length(kw) == 0 - _load_game_as_turn_based(s) + _load_game_as_turn_based(s)[] else ps = [StdString(string(k)) => v for (k,v) in kw] - _load_game_as_turn_based(s, StdMap{StdString, GameParameter}(ps)) + _load_game_as_turn_based(s, StdMap{StdString, GameParameter}(ps))[] end end From 4935e04caedef9ac00e2404567357c35167130f0 Mon Sep 17 00:00:00 2001 From: Jeremiah <4462211+jeremiahpslewis@users.noreply.github.com> Date: Wed, 4 Sep 2024 22:51:08 +0200 Subject: [PATCH 13/15] fix patch --- src/patch.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/patch.jl b/src/patch.jl index 3bc0ff0..622b9ae 100644 --- a/src/patch.jl +++ b/src/patch.jl @@ -60,19 +60,19 @@ end function load_game(s::Union{String, CxxWrap.StdLib.StdStringAllocated}; kw...) if length(kw) == 0 - _load_game(s)[] + _load_game(s)[][] else ps = [StdString(string(k)) => v for (k,v) in kw] - _load_game(s, StdMap{StdString, GameParameter}(ps))[] + _load_game(s, StdMap{StdString, GameParameter}(ps))[][] end end function load_game_as_turn_based(s::Union{String, CxxWrap.StdLib.StdStringAllocated}; kw...) if length(kw) == 0 - _load_game_as_turn_based(s)[] + _load_game_as_turn_based(s)[][] else ps = [StdString(string(k)) => v for (k,v) in kw] - _load_game_as_turn_based(s, StdMap{StdString, GameParameter}(ps))[] + _load_game_as_turn_based(s, StdMap{StdString, GameParameter}(ps))[][] end end From 7cfe8753b3cc948b050ab722a56ccd40a8da6e73 Mon Sep 17 00:00:00 2001 From: Jeremiah <4462211+jeremiahpslewis@users.noreply.github.com> Date: Wed, 4 Sep 2024 22:55:06 +0200 Subject: [PATCH 14/15] Update patch.jl --- src/patch.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/patch.jl b/src/patch.jl index 622b9ae..3bc0ff0 100644 --- a/src/patch.jl +++ b/src/patch.jl @@ -60,19 +60,19 @@ end function load_game(s::Union{String, CxxWrap.StdLib.StdStringAllocated}; kw...) if length(kw) == 0 - _load_game(s)[][] + _load_game(s)[] else ps = [StdString(string(k)) => v for (k,v) in kw] - _load_game(s, StdMap{StdString, GameParameter}(ps))[][] + _load_game(s, StdMap{StdString, GameParameter}(ps))[] end end function load_game_as_turn_based(s::Union{String, CxxWrap.StdLib.StdStringAllocated}; kw...) if length(kw) == 0 - _load_game_as_turn_based(s)[][] + _load_game_as_turn_based(s)[] else ps = [StdString(string(k)) => v for (k,v) in kw] - _load_game_as_turn_based(s, StdMap{StdString, GameParameter}(ps))[][] + _load_game_as_turn_based(s, StdMap{StdString, GameParameter}(ps))[] end end From 49b1e67a9c4c080d927752ac580dbd13c128348d Mon Sep 17 00:00:00 2001 From: Jeremiah <4462211+jeremiahpslewis@users.noreply.github.com> Date: Tue, 3 Sep 2024 09:38:52 +0000 Subject: [PATCH 15/15] Add devcontainer --- .devcontainer/devcontainer.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..f29ccbd --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,15 @@ +{ + "image": "mcr.microsoft.com/vscode/devcontainers/base:ubuntu-24.04", + "features": { + "ghcr.io/julialang/devcontainer-features/julia": "1.10" + }, + // Set *default* container specific settings.json values on container create. + "settings": { + "terminal.integrated.fontFamily": "monospace", + "julia.environmentPath": "." + }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + ], +} \ No newline at end of file