Compare commits
7 Commits
main
...
d92333cab4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d92333cab4 | ||
|
|
093290a33b | ||
| c777800948 | |||
| ceced04171 | |||
| ee5f8a8a52 | |||
| 693cbfd82d | |||
| 842626ae35 |
370
Manifest.toml
370
Manifest.toml
@@ -1,8 +1,8 @@
|
||||
# This file is machine-generated - editing it directly is not advised
|
||||
|
||||
julia_version = "1.12.6"
|
||||
julia_version = "1.11.3"
|
||||
manifest_format = "2.0"
|
||||
project_hash = "d65e3fb9ee71e7ba2bf20b111f9f950fd4d5183a"
|
||||
project_hash = "7388d6f2112aa337179b153160215cd1f5630c81"
|
||||
|
||||
[[deps.AliasTables]]
|
||||
deps = ["PtrArrays", "Random"]
|
||||
@@ -18,32 +18,11 @@ version = "1.11.0"
|
||||
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.BufferedStreams]]
|
||||
git-tree-sha1 = "6863c5b7fc997eadcabdbaf6c5f201dc30032643"
|
||||
uuid = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d"
|
||||
version = "1.2.2"
|
||||
|
||||
[[deps.CRC32c]]
|
||||
uuid = "8bf52ea8-c179-5cab-976a-9e18b702a9bc"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.CSV]]
|
||||
deps = ["CodecZlib", "Dates", "FilePathsBase", "InlineStrings", "Mmap", "Parsers", "PooledArrays", "PrecompileTools", "SentinelArrays", "Tables", "Unicode", "WeakRefStrings", "WorkerUtilities"]
|
||||
git-tree-sha1 = "8d8e0b0f350b8e1c91420b5e64e5de774c2f0f4d"
|
||||
git-tree-sha1 = "deddd8725e5e1cc49ee205a1964256043720a6c3"
|
||||
uuid = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
|
||||
version = "0.10.16"
|
||||
|
||||
[[deps.CodeTracking]]
|
||||
deps = ["InteractiveUtils", "REPL", "UUIDs"]
|
||||
git-tree-sha1 = "cfb7a2e89e245a9d5016b70323db412b3a7438d5"
|
||||
uuid = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2"
|
||||
version = "3.0.2"
|
||||
|
||||
[[deps.CodecBase]]
|
||||
deps = ["TranscodingStreams"]
|
||||
git-tree-sha1 = "40956acdbef3d8c7cc38cba42b56034af8f8581a"
|
||||
uuid = "6c391c72-fb7b-5838-ba82-7cfb1bcfecbf"
|
||||
version = "0.3.4"
|
||||
version = "0.10.15"
|
||||
|
||||
[[deps.CodecZlib]]
|
||||
deps = ["TranscodingStreams", "Zlib_jll"]
|
||||
@@ -53,23 +32,18 @@ version = "0.7.8"
|
||||
|
||||
[[deps.Compat]]
|
||||
deps = ["TOML", "UUIDs"]
|
||||
git-tree-sha1 = "9d8a54ce4b17aa5bdce0ea5c34bc5e7c340d16ad"
|
||||
git-tree-sha1 = "8ae8d32e09f0dcf42a36b90d4e17f5dd2e4c4215"
|
||||
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
|
||||
version = "4.18.1"
|
||||
version = "4.16.0"
|
||||
weakdeps = ["Dates", "LinearAlgebra"]
|
||||
|
||||
[deps.Compat.extensions]
|
||||
CompatLinearAlgebraExt = "LinearAlgebra"
|
||||
|
||||
[[deps.Compiler]]
|
||||
git-tree-sha1 = "382d79bfe72a406294faca39ef0c3cef6e6ce1f1"
|
||||
uuid = "807dbc54-b67e-4c79-8afb-eafe4df6f2e1"
|
||||
version = "0.1.1"
|
||||
|
||||
[[deps.CompilerSupportLibraries_jll]]
|
||||
deps = ["Artifacts", "Libdl"]
|
||||
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
|
||||
version = "1.3.0+1"
|
||||
version = "1.1.1+0"
|
||||
|
||||
[[deps.Crayons]]
|
||||
git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15"
|
||||
@@ -83,15 +57,15 @@ version = "1.16.0"
|
||||
|
||||
[[deps.DataFrames]]
|
||||
deps = ["Compat", "DataAPI", "DataStructures", "Future", "InlineStrings", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrecompileTools", "PrettyTables", "Printf", "Random", "Reexport", "SentinelArrays", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"]
|
||||
git-tree-sha1 = "5fab31e2e01e70ad66e3e24c968c264d1cf166d6"
|
||||
git-tree-sha1 = "fb61b4812c49343d7ef0b533ba982c46021938a6"
|
||||
uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
|
||||
version = "1.8.2"
|
||||
version = "1.7.0"
|
||||
|
||||
[[deps.DataStructures]]
|
||||
deps = ["OrderedCollections"]
|
||||
git-tree-sha1 = "6fb53a69613a0b2b68a0d12671717d307ab8b24e"
|
||||
deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
|
||||
git-tree-sha1 = "1d0a14036acb104d9e89698bd408f63ab58cdc82"
|
||||
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
|
||||
version = "0.19.5"
|
||||
version = "0.18.20"
|
||||
|
||||
[[deps.DataValueInterfaces]]
|
||||
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
|
||||
@@ -103,28 +77,32 @@ deps = ["Printf"]
|
||||
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.Distributed]]
|
||||
deps = ["Random", "Serialization", "Sockets"]
|
||||
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.Distributions]]
|
||||
deps = ["AliasTables", "FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SpecialFunctions", "Statistics", "StatsAPI", "StatsBase", "StatsFuns"]
|
||||
git-tree-sha1 = "3c8a0a9a6d4a10bdfb6b751bd2b6051ed3e25fd4"
|
||||
git-tree-sha1 = "03aa5d44647eaec98e1920635cdfed5d5560a8b9"
|
||||
uuid = "31c24e10-a181-5473-b8eb-7969acd0382f"
|
||||
version = "0.25.127"
|
||||
version = "0.25.117"
|
||||
|
||||
[deps.Distributions.extensions]
|
||||
DistributionsChainRulesCoreExt = "ChainRulesCore"
|
||||
DistributionsDensityInterfaceExt = "DensityInterface"
|
||||
DistributionsSparseConnectivityTracerExt = "SparseConnectivityTracer"
|
||||
DistributionsTestExt = "Test"
|
||||
|
||||
[deps.Distributions.weakdeps]
|
||||
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
|
||||
DensityInterface = "b429d917-457f-4dbc-8f4c-0cc954292b1d"
|
||||
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
|
||||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
|
||||
|
||||
[[deps.DocStringExtensions]]
|
||||
git-tree-sha1 = "7442a5dfe1ebb773c29cc2962a8980f47221d76c"
|
||||
deps = ["LibGit2"]
|
||||
git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d"
|
||||
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
|
||||
version = "0.9.5"
|
||||
version = "0.9.3"
|
||||
|
||||
[[deps.FilePathsBase]]
|
||||
deps = ["Compat", "Dates"]
|
||||
@@ -140,56 +118,39 @@ version = "0.9.24"
|
||||
Mmap = "a63ad114-7e13-5084-954f-fe012c677804"
|
||||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
|
||||
|
||||
[[deps.FileWatching]]
|
||||
uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.FillArrays]]
|
||||
deps = ["LinearAlgebra"]
|
||||
git-tree-sha1 = "2f979084d1e13948a3352cf64a25df6bd3b4dca3"
|
||||
git-tree-sha1 = "6a70198746448456524cb442b8af316927ff3e1a"
|
||||
uuid = "1a297f60-69ca-5386-bcde-b61e274b549b"
|
||||
version = "1.16.0"
|
||||
version = "1.13.0"
|
||||
weakdeps = ["PDMats", "SparseArrays", "Statistics"]
|
||||
|
||||
[deps.FillArrays.extensions]
|
||||
FillArraysPDMatsExt = "PDMats"
|
||||
FillArraysSparseArraysExt = "SparseArrays"
|
||||
FillArraysStaticArraysExt = "StaticArrays"
|
||||
FillArraysStatisticsExt = "Statistics"
|
||||
|
||||
[deps.FillArrays.weakdeps]
|
||||
PDMats = "90014a1f-27ba-587c-ab20-58faa44d9150"
|
||||
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
|
||||
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
|
||||
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
|
||||
|
||||
[[deps.Future]]
|
||||
deps = ["Random"]
|
||||
uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.GeneralUtils]]
|
||||
deps = ["CSV", "DataFrames", "DataStructures", "Dates", "Distributions", "JSON", "NATS", "PrettyPrinting", "Random", "Revise", "SHA", "UUIDs"]
|
||||
git-tree-sha1 = "8720a31344bc85ad610ae12f7e1247de22070765"
|
||||
repo-rev = "main"
|
||||
repo-url = "https://git.yiem.cc/ton/GeneralUtils"
|
||||
deps = ["CSV", "DataFrames", "DataStructures", "Dates", "Distributions", "JSON3", "MQTTClient", "PrettyPrinting", "Random", "SHA", "UUIDs"]
|
||||
path = "../GeneralUtils"
|
||||
uuid = "c6c72f09-b708-4ac8-ac7c-2084d70108fe"
|
||||
version = "0.3.2"
|
||||
|
||||
[[deps.HashArrayMappedTries]]
|
||||
git-tree-sha1 = "2eaa69a7cab70a52b9687c8bf950a5a93ec895ae"
|
||||
uuid = "076d061b-32b6-4027-95e0-9a2c6f6d7e74"
|
||||
version = "0.2.0"
|
||||
version = "0.2.2"
|
||||
|
||||
[[deps.HypergeometricFunctions]]
|
||||
deps = ["LinearAlgebra", "OpenLibm_jll", "SpecialFunctions"]
|
||||
git-tree-sha1 = "68c173f4f449de5b438ee67ed0c9c748dc31a2ec"
|
||||
git-tree-sha1 = "2bd56245074fab4015b9174f24ceba8293209053"
|
||||
uuid = "34004b35-14d8-5ef3-9330-4cdb6864b03a"
|
||||
version = "0.3.28"
|
||||
version = "0.3.27"
|
||||
|
||||
[[deps.InlineStrings]]
|
||||
git-tree-sha1 = "8f3d257792a522b4601c24a577954b0a8cd7334d"
|
||||
git-tree-sha1 = "6a9fde685a7ac1eb3495f8e812c5a7c3711c2d5e"
|
||||
uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48"
|
||||
version = "1.4.5"
|
||||
version = "1.4.3"
|
||||
|
||||
[deps.InlineStrings.extensions]
|
||||
ArrowTypesExt = "ArrowTypes"
|
||||
@@ -210,9 +171,9 @@ uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f"
|
||||
version = "1.3.1"
|
||||
|
||||
[[deps.IrrationalConstants]]
|
||||
git-tree-sha1 = "b2d91fe939cae05960e760110b328288867b5758"
|
||||
git-tree-sha1 = "e2222959fbc6c19554dc15174c81bf7bf3aa691c"
|
||||
uuid = "92d709cd-6900-40b7-9082-c6be49f344b6"
|
||||
version = "0.2.6"
|
||||
version = "0.2.4"
|
||||
|
||||
[[deps.IteratorInterfaceExtensions]]
|
||||
git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856"
|
||||
@@ -221,27 +182,15 @@ version = "1.0.0"
|
||||
|
||||
[[deps.JLLWrappers]]
|
||||
deps = ["Artifacts", "Preferences"]
|
||||
git-tree-sha1 = "7204148362dafe5fe6a273f855b8ccbe4df8173e"
|
||||
git-tree-sha1 = "a007feb38b422fbdab534406aeca1b86823cb4d6"
|
||||
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
|
||||
version = "1.8.0"
|
||||
|
||||
[[deps.JSON]]
|
||||
deps = ["Dates", "Logging", "Parsers", "PrecompileTools", "StructUtils", "UUIDs", "Unicode"]
|
||||
git-tree-sha1 = "c89d196f5ffb64bfbf80985b699ea913b0d2c211"
|
||||
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
|
||||
version = "1.6.1"
|
||||
|
||||
[deps.JSON.extensions]
|
||||
JSONArrowExt = ["ArrowTypes"]
|
||||
|
||||
[deps.JSON.weakdeps]
|
||||
ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd"
|
||||
version = "1.7.0"
|
||||
|
||||
[[deps.JSON3]]
|
||||
deps = ["Dates", "Mmap", "Parsers", "PrecompileTools", "StructTypes", "UUIDs"]
|
||||
git-tree-sha1 = "411eccfe8aba0814ffa0fdf4860913ed09c34975"
|
||||
git-tree-sha1 = "1d322381ef7b087548321d3f878cb4c9bd8f8f9b"
|
||||
uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
|
||||
version = "1.14.3"
|
||||
version = "1.14.1"
|
||||
|
||||
[deps.JSON3.extensions]
|
||||
JSON3ArrowExt = ["ArrowTypes"]
|
||||
@@ -249,42 +198,25 @@ version = "1.14.3"
|
||||
[deps.JSON3.weakdeps]
|
||||
ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd"
|
||||
|
||||
[[deps.JuliaInterpreter]]
|
||||
deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"]
|
||||
git-tree-sha1 = "58927c485919bf17ea308d9d82156de1adf4b006"
|
||||
uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"
|
||||
version = "0.10.12"
|
||||
|
||||
[[deps.JuliaSyntaxHighlighting]]
|
||||
deps = ["StyledStrings"]
|
||||
uuid = "ac6e5ff7-fb65-4e79-a425-ec3bc9c03011"
|
||||
version = "1.12.0"
|
||||
|
||||
[[deps.LLMMCTS]]
|
||||
deps = ["GeneralUtils", "JSON", "PrettyPrinting"]
|
||||
path = "."
|
||||
uuid = "d76c5a4d-449e-4835-8cc4-dd86ec44f241"
|
||||
version = "0.1.3"
|
||||
|
||||
[[deps.LaTeXStrings]]
|
||||
git-tree-sha1 = "dda21b8cbd6a6c40d9d02a73230f9d70fed6918c"
|
||||
uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
|
||||
version = "1.4.0"
|
||||
|
||||
[[deps.LibGit2]]
|
||||
deps = ["LibGit2_jll", "NetworkOptions", "Printf", "SHA"]
|
||||
deps = ["Base64", "LibGit2_jll", "NetworkOptions", "Printf", "SHA"]
|
||||
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.LibGit2_jll]]
|
||||
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "OpenSSL_jll"]
|
||||
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"]
|
||||
uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5"
|
||||
version = "1.9.0+0"
|
||||
version = "1.7.2+0"
|
||||
|
||||
[[deps.LibSSH2_jll]]
|
||||
deps = ["Artifacts", "Libdl", "OpenSSL_jll"]
|
||||
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
|
||||
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
|
||||
version = "1.11.3+1"
|
||||
version = "1.11.0+1"
|
||||
|
||||
[[deps.Libdl]]
|
||||
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
|
||||
@@ -293,13 +225,13 @@ version = "1.11.0"
|
||||
[[deps.LinearAlgebra]]
|
||||
deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"]
|
||||
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
|
||||
version = "1.12.0"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.LogExpFunctions]]
|
||||
deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"]
|
||||
git-tree-sha1 = "bba2d9aa057d8f126415de240573e86a8f39d2a1"
|
||||
git-tree-sha1 = "13ca9e2586b89836fd20cccf56e57e2b9ae7f38f"
|
||||
uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
|
||||
version = "1.0.1"
|
||||
version = "0.3.29"
|
||||
|
||||
[deps.LogExpFunctions.extensions]
|
||||
LogExpFunctionsChainRulesCoreExt = "ChainRulesCore"
|
||||
@@ -311,32 +243,25 @@ version = "1.0.1"
|
||||
ChangesOfVariables = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0"
|
||||
InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112"
|
||||
|
||||
[[deps.Logging]]
|
||||
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
|
||||
version = "1.11.0"
|
||||
[[deps.MQTTClient]]
|
||||
deps = ["Distributed", "Random", "Sockets"]
|
||||
git-tree-sha1 = "f2597b290d4bf17b577346153cd2ddf9accb5c26"
|
||||
uuid = "985f35cc-2c3d-4943-b8c1-f0931d5f0959"
|
||||
version = "0.3.1"
|
||||
weakdeps = ["PrecompileTools"]
|
||||
|
||||
[[deps.LoweredCodeUtils]]
|
||||
deps = ["CodeTracking", "Compiler", "JuliaInterpreter"]
|
||||
git-tree-sha1 = "0aad96d7b987a5600e260eec50147b254d5ff7e6"
|
||||
uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b"
|
||||
version = "3.6.0"
|
||||
[deps.MQTTClient.extensions]
|
||||
PrecompileMQTT = "PrecompileTools"
|
||||
|
||||
[[deps.Markdown]]
|
||||
deps = ["Base64", "JuliaSyntaxHighlighting", "StyledStrings"]
|
||||
deps = ["Base64"]
|
||||
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.MbedTLS]]
|
||||
deps = ["Dates", "MbedTLS_jll", "MozillaCACerts_jll", "NetworkOptions", "Random", "Sockets"]
|
||||
git-tree-sha1 = "8785729fa736197687541f7053f6d8ab7fc44f92"
|
||||
uuid = "739be429-bea8-5141-9913-cc70e7f3736d"
|
||||
version = "1.1.10"
|
||||
|
||||
[[deps.MbedTLS_jll]]
|
||||
deps = ["Artifacts", "JLLWrappers", "Libdl"]
|
||||
git-tree-sha1 = "ff69a2b1330bcb730b9ac1ab7dd680176f5896b8"
|
||||
deps = ["Artifacts", "Libdl"]
|
||||
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
|
||||
version = "2.28.1010+0"
|
||||
version = "2.28.6+0"
|
||||
|
||||
[[deps.Missings]]
|
||||
deps = ["DataAPI"]
|
||||
@@ -348,40 +273,19 @@ version = "1.2.0"
|
||||
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.MozillaCACerts_jll]]
|
||||
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
|
||||
version = "2025.11.4"
|
||||
|
||||
[[deps.NATS]]
|
||||
deps = ["Base64", "BufferedStreams", "CodecBase", "Dates", "DocStringExtensions", "JSON3", "MbedTLS", "NanoDates", "Random", "ScopedValues", "Sockets", "Sodium", "StructTypes", "URIs"]
|
||||
git-tree-sha1 = "a1cdf34ba90ee5cd2658e487d3277ffafee712ce"
|
||||
uuid = "55e73f9c-eeeb-467f-b4cc-a633fde63d2a"
|
||||
version = "0.1.1"
|
||||
|
||||
[[deps.NanoDates]]
|
||||
deps = ["Dates", "Parsers"]
|
||||
git-tree-sha1 = "850a0557ae5934f6e67ac0dc5ca13d0328422d1f"
|
||||
uuid = "46f1a544-deae-4307-8689-c12aa3c955c6"
|
||||
version = "1.0.3"
|
||||
|
||||
[[deps.NetworkOptions]]
|
||||
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
|
||||
version = "1.3.0"
|
||||
version = "1.2.0"
|
||||
|
||||
[[deps.OpenBLAS_jll]]
|
||||
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
|
||||
uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"
|
||||
version = "0.3.29+0"
|
||||
version = "0.3.27+1"
|
||||
|
||||
[[deps.OpenLibm_jll]]
|
||||
deps = ["Artifacts", "Libdl"]
|
||||
uuid = "05823500-19ac-5b8b-9628-191a04bc5112"
|
||||
version = "0.8.7+0"
|
||||
|
||||
[[deps.OpenSSL_jll]]
|
||||
deps = ["Artifacts", "Libdl"]
|
||||
uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
|
||||
version = "3.5.4+0"
|
||||
version = "0.8.1+2"
|
||||
|
||||
[[deps.OpenSpecFun_jll]]
|
||||
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl"]
|
||||
@@ -390,25 +294,21 @@ uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e"
|
||||
version = "0.5.6+0"
|
||||
|
||||
[[deps.OrderedCollections]]
|
||||
git-tree-sha1 = "94ba93778373a53bfd5a0caaf7d809c445292ff4"
|
||||
git-tree-sha1 = "cc4054e898b852042d7b503313f7ad03de99c3dd"
|
||||
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
|
||||
version = "1.8.2"
|
||||
version = "1.8.0"
|
||||
|
||||
[[deps.PDMats]]
|
||||
deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"]
|
||||
git-tree-sha1 = "e4cff168707d441cd6bf3ff7e4832bdf34278e4a"
|
||||
git-tree-sha1 = "966b85253e959ea89c53a9abebbf2e964fbf593b"
|
||||
uuid = "90014a1f-27ba-587c-ab20-58faa44d9150"
|
||||
version = "0.11.37"
|
||||
weakdeps = ["StatsBase"]
|
||||
|
||||
[deps.PDMats.extensions]
|
||||
StatsBaseExt = "StatsBase"
|
||||
version = "0.11.32"
|
||||
|
||||
[[deps.Parsers]]
|
||||
deps = ["Dates", "PrecompileTools", "UUIDs"]
|
||||
git-tree-sha1 = "32a4e09c5f29402573d673901778a0e03b0807b9"
|
||||
git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821"
|
||||
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
|
||||
version = "2.8.6"
|
||||
version = "2.8.1"
|
||||
|
||||
[[deps.PooledArrays]]
|
||||
deps = ["DataAPI", "Future"]
|
||||
@@ -418,15 +318,15 @@ version = "1.4.3"
|
||||
|
||||
[[deps.PrecompileTools]]
|
||||
deps = ["Preferences"]
|
||||
git-tree-sha1 = "edbeefc7a4889f528644251bdb5fc9ab5348bc2c"
|
||||
git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f"
|
||||
uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
|
||||
version = "1.3.4"
|
||||
version = "1.2.1"
|
||||
|
||||
[[deps.Preferences]]
|
||||
deps = ["TOML"]
|
||||
git-tree-sha1 = "8b770b60760d4451834fe79dd483e318eee709c4"
|
||||
git-tree-sha1 = "9306f6085165d270f7e3db02af26a400d580f5c6"
|
||||
uuid = "21216c6a-2e73-6563-6e65-726566657250"
|
||||
version = "1.5.2"
|
||||
version = "1.4.3"
|
||||
|
||||
[[deps.PrettyPrinting]]
|
||||
git-tree-sha1 = "142ee93724a9c5d04d78df7006670a93ed1b244e"
|
||||
@@ -434,16 +334,10 @@ uuid = "54e16d92-306c-5ea0-a30b-337be88ac337"
|
||||
version = "0.4.2"
|
||||
|
||||
[[deps.PrettyTables]]
|
||||
deps = ["Crayons", "LaTeXStrings", "Markdown", "PrecompileTools", "Printf", "REPL", "Reexport", "StringManipulation", "Tables"]
|
||||
git-tree-sha1 = "624de6279ab7d94fc9f672f0068107eb6619732c"
|
||||
deps = ["Crayons", "LaTeXStrings", "Markdown", "PrecompileTools", "Printf", "Reexport", "StringManipulation", "Tables"]
|
||||
git-tree-sha1 = "1101cd475833706e4d0e7b122218257178f48f34"
|
||||
uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
|
||||
version = "3.3.2"
|
||||
|
||||
[deps.PrettyTables.extensions]
|
||||
PrettyTablesTypstryExt = "Typstry"
|
||||
|
||||
[deps.PrettyTables.weakdeps]
|
||||
Typstry = "f0ed7684-a786-439e-b1e3-3b82803b501e"
|
||||
version = "2.4.0"
|
||||
|
||||
[[deps.Printf]]
|
||||
deps = ["Unicode"]
|
||||
@@ -451,15 +345,15 @@ uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.PtrArrays]]
|
||||
git-tree-sha1 = "4fbbafbc6251b883f4d2705356f3641f3652a7fe"
|
||||
git-tree-sha1 = "1d36ef11a9aaf1e8b74dacc6a731dd1de8fd493d"
|
||||
uuid = "43287f4e-b6f4-7ad1-bb20-aadabca52c3d"
|
||||
version = "1.4.0"
|
||||
version = "1.3.0"
|
||||
|
||||
[[deps.QuadGK]]
|
||||
deps = ["DataStructures", "LinearAlgebra"]
|
||||
git-tree-sha1 = "5e8e8b0ab68215d7a2b14b9921a946fee794749e"
|
||||
git-tree-sha1 = "9da16da70037ba9d701192e27befedefb91ec284"
|
||||
uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
|
||||
version = "2.11.3"
|
||||
version = "2.11.2"
|
||||
|
||||
[deps.QuadGK.extensions]
|
||||
QuadGKEnzymeExt = "Enzyme"
|
||||
@@ -467,11 +361,6 @@ version = "2.11.3"
|
||||
[deps.QuadGK.weakdeps]
|
||||
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
|
||||
|
||||
[[deps.REPL]]
|
||||
deps = ["InteractiveUtils", "JuliaSyntaxHighlighting", "Markdown", "Sockets", "StyledStrings", "Unicode"]
|
||||
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.Random]]
|
||||
deps = ["SHA"]
|
||||
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
|
||||
@@ -482,23 +371,11 @@ git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b"
|
||||
uuid = "189a3867-3050-52da-a836-e630ba90ab69"
|
||||
version = "1.2.2"
|
||||
|
||||
[[deps.Revise]]
|
||||
deps = ["CRC32c", "CodeTracking", "FileWatching", "InteractiveUtils", "JuliaInterpreter", "LibGit2", "LoweredCodeUtils", "OrderedCollections", "Preferences", "REPL", "UUIDs"]
|
||||
git-tree-sha1 = "27e3ee13fc8739a59b380d6163d6a82f52c03bd7"
|
||||
uuid = "295af30f-e4ad-537b-8983-00126c2a3abe"
|
||||
version = "3.15.1"
|
||||
|
||||
[deps.Revise.extensions]
|
||||
DistributedExt = "Distributed"
|
||||
|
||||
[deps.Revise.weakdeps]
|
||||
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
|
||||
|
||||
[[deps.Rmath]]
|
||||
deps = ["Random", "Rmath_jll"]
|
||||
git-tree-sha1 = "5b3d50eb374cea306873b371d3f8d3915a018f0b"
|
||||
git-tree-sha1 = "852bd0f55565a9e973fcfee83a84413270224dc4"
|
||||
uuid = "79098fc4-a85e-5d69-aa6a-4863f24498fa"
|
||||
version = "0.9.0"
|
||||
version = "0.8.0"
|
||||
|
||||
[[deps.Rmath_jll]]
|
||||
deps = ["Artifacts", "JLLWrappers", "Libdl"]
|
||||
@@ -510,17 +387,11 @@ version = "0.5.1+0"
|
||||
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
|
||||
version = "0.7.0"
|
||||
|
||||
[[deps.ScopedValues]]
|
||||
deps = ["HashArrayMappedTries", "Logging"]
|
||||
git-tree-sha1 = "67a144433c4ce877ee6d1ada69a124d6b1ecf7be"
|
||||
uuid = "7e506255-f358-4e82-b7e4-beb19740aa63"
|
||||
version = "1.6.2"
|
||||
|
||||
[[deps.SentinelArrays]]
|
||||
deps = ["Dates", "Random"]
|
||||
git-tree-sha1 = "084c47c7c5ce5cfecefa0a98dff69eb3646b5a80"
|
||||
git-tree-sha1 = "712fb0231ee6f9120e005ccd56297abbc053e7e0"
|
||||
uuid = "91c51154-3ec4-41a3-a24f-3f23e20d615c"
|
||||
version = "1.4.10"
|
||||
version = "1.4.8"
|
||||
|
||||
[[deps.Serialization]]
|
||||
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
|
||||
@@ -530,28 +401,22 @@ version = "1.11.0"
|
||||
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.Sodium]]
|
||||
deps = ["Base64", "libsodium_jll"]
|
||||
git-tree-sha1 = "907703e0d50846f300650d7225bdcab145b7bca9"
|
||||
uuid = "4f5b5e99-b0ad-42cd-b47a-334e172ec8bd"
|
||||
version = "1.1.2"
|
||||
|
||||
[[deps.SortingAlgorithms]]
|
||||
deps = ["DataStructures"]
|
||||
git-tree-sha1 = "13cd91cc9be159e3f4d95b857fa2aa383b53772a"
|
||||
git-tree-sha1 = "66e0a8e672a0bdfca2c3f5937efb8538b9ddc085"
|
||||
uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c"
|
||||
version = "1.2.3"
|
||||
version = "1.2.1"
|
||||
|
||||
[[deps.SparseArrays]]
|
||||
deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"]
|
||||
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
|
||||
version = "1.12.0"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.SpecialFunctions]]
|
||||
deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"]
|
||||
git-tree-sha1 = "6547cbdd8ce32efba0d21c5a40fa96d1a3548f9f"
|
||||
git-tree-sha1 = "64cca0c26b4f31ba18f13f6c12af7c85f478cfde"
|
||||
uuid = "276daf66-3868-5448-9aa4-cd146d93841b"
|
||||
version = "2.8.0"
|
||||
version = "2.5.0"
|
||||
|
||||
[deps.SpecialFunctions.extensions]
|
||||
SpecialFunctionsChainRulesCoreExt = "ChainRulesCore"
|
||||
@@ -571,21 +436,21 @@ weakdeps = ["SparseArrays"]
|
||||
|
||||
[[deps.StatsAPI]]
|
||||
deps = ["LinearAlgebra"]
|
||||
git-tree-sha1 = "178ed29fd5b2a2cfc3bd31c13375ae925623ff36"
|
||||
git-tree-sha1 = "1ff449ad350c9c4cbc756624d6f8a8c3ef56d3ed"
|
||||
uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0"
|
||||
version = "1.8.0"
|
||||
version = "1.7.0"
|
||||
|
||||
[[deps.StatsBase]]
|
||||
deps = ["AliasTables", "DataAPI", "DataStructures", "IrrationalConstants", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"]
|
||||
git-tree-sha1 = "e4d7a1a0edc20af42689ea6f4f3587a2175d50ee"
|
||||
deps = ["AliasTables", "DataAPI", "DataStructures", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"]
|
||||
git-tree-sha1 = "29321314c920c26684834965ec2ce0dacc9cf8e5"
|
||||
uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
|
||||
version = "0.34.12"
|
||||
version = "0.34.4"
|
||||
|
||||
[[deps.StatsFuns]]
|
||||
deps = ["HypergeometricFunctions", "IrrationalConstants", "LogExpFunctions", "Reexport", "Rmath", "SpecialFunctions"]
|
||||
git-tree-sha1 = "770240df9a3b8888065046948f7a09b4e0f997d5"
|
||||
git-tree-sha1 = "b423576adc27097764a90e163157bcfc9acf0f46"
|
||||
uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
|
||||
version = "2.2.0"
|
||||
version = "1.3.2"
|
||||
|
||||
[deps.StatsFuns.extensions]
|
||||
StatsFunsChainRulesCoreExt = "ChainRulesCore"
|
||||
@@ -597,9 +462,9 @@ version = "2.2.0"
|
||||
|
||||
[[deps.StringManipulation]]
|
||||
deps = ["PrecompileTools"]
|
||||
git-tree-sha1 = "d05693d339e37d6ab134c5ab53c29fce5ee5d7d5"
|
||||
git-tree-sha1 = "725421ae8e530ec29bcbdddbe91ff8053421d023"
|
||||
uuid = "892a3eda-7b42-436c-8928-eab12a02cf0e"
|
||||
version = "0.4.4"
|
||||
version = "0.4.1"
|
||||
|
||||
[[deps.StructTypes]]
|
||||
deps = ["Dates", "UUIDs"]
|
||||
@@ -607,26 +472,6 @@ git-tree-sha1 = "159331b30e94d7b11379037feeb9b690950cace8"
|
||||
uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.StructUtils]]
|
||||
deps = ["Dates", "UUIDs"]
|
||||
git-tree-sha1 = "82bee338d650aa515f31866c460cb7e3bcef90b8"
|
||||
uuid = "ec057cc2-7a8d-4b58-b3b3-92acb9f63b42"
|
||||
version = "2.8.2"
|
||||
|
||||
[deps.StructUtils.extensions]
|
||||
StructUtilsMeasurementsExt = ["Measurements"]
|
||||
StructUtilsStaticArraysCoreExt = ["StaticArraysCore"]
|
||||
StructUtilsTablesExt = ["Tables"]
|
||||
|
||||
[deps.StructUtils.weakdeps]
|
||||
Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7"
|
||||
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
|
||||
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
|
||||
|
||||
[[deps.StyledStrings]]
|
||||
uuid = "f489334b-da3d-4c2e-b8f0-e476e12c162b"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.SuiteSparse]]
|
||||
deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"]
|
||||
uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"
|
||||
@@ -634,7 +479,7 @@ uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"
|
||||
[[deps.SuiteSparse_jll]]
|
||||
deps = ["Artifacts", "Libdl", "libblastrampoline_jll"]
|
||||
uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c"
|
||||
version = "7.8.3+2"
|
||||
version = "7.7.0+0"
|
||||
|
||||
[[deps.TOML]]
|
||||
deps = ["Dates"]
|
||||
@@ -649,20 +494,15 @@ version = "1.0.1"
|
||||
|
||||
[[deps.Tables]]
|
||||
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "OrderedCollections", "TableTraits"]
|
||||
git-tree-sha1 = "f2c1efbc8f3a609aadf318094f8fc5204bdaf344"
|
||||
git-tree-sha1 = "598cd7c1f68d1e205689b1c2fe65a9f85846f297"
|
||||
uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
|
||||
version = "1.12.1"
|
||||
version = "1.12.0"
|
||||
|
||||
[[deps.TranscodingStreams]]
|
||||
git-tree-sha1 = "0c45878dcfdcfa8480052b6ab162cdd138781742"
|
||||
uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
|
||||
version = "0.11.3"
|
||||
|
||||
[[deps.URIs]]
|
||||
git-tree-sha1 = "bef26fb046d031353ef97a82e3fdb6afe7f21b1a"
|
||||
uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
|
||||
version = "1.6.1"
|
||||
|
||||
[[deps.UUIDs]]
|
||||
deps = ["Random", "SHA"]
|
||||
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
|
||||
@@ -674,9 +514,9 @@ version = "1.11.0"
|
||||
|
||||
[[deps.WeakRefStrings]]
|
||||
deps = ["DataAPI", "InlineStrings", "Parsers"]
|
||||
git-tree-sha1 = "0716e01c3b40413de5dedbc9c5c69f27cddfddfc"
|
||||
git-tree-sha1 = "b1be2855ed9ed8eac54e5caff2afcdb442d52c23"
|
||||
uuid = "ea10d353-3f73-51f8-a26c-33c1cb351aa5"
|
||||
version = "1.4.3"
|
||||
version = "1.4.2"
|
||||
|
||||
[[deps.WorkerUtilities]]
|
||||
git-tree-sha1 = "cd1659ba0d57b71a464a29e64dbc67cfe83d54e7"
|
||||
@@ -686,15 +526,9 @@ version = "1.6.1"
|
||||
[[deps.Zlib_jll]]
|
||||
deps = ["Libdl"]
|
||||
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
|
||||
version = "1.3.1+2"
|
||||
version = "1.2.13+1"
|
||||
|
||||
[[deps.libblastrampoline_jll]]
|
||||
deps = ["Artifacts", "Libdl"]
|
||||
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
|
||||
version = "5.15.0+0"
|
||||
|
||||
[[deps.libsodium_jll]]
|
||||
deps = ["Artifacts", "JLLWrappers", "Libdl"]
|
||||
git-tree-sha1 = "011b0a7331b41c25524b64dc42afc9683ee89026"
|
||||
uuid = "a9144af2-ca23-56d9-984f-0d03f7b5ccf8"
|
||||
version = "1.0.21+0"
|
||||
version = "5.11.0+0"
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
name = "LLMMCTS"
|
||||
uuid = "d76c5a4d-449e-4835-8cc4-dd86ec44f241"
|
||||
version = "0.1.3"
|
||||
authors = ["narawat lamaiin <narawat@outlook.com>"]
|
||||
version = "0.1.4"
|
||||
|
||||
[deps]
|
||||
GeneralUtils = "c6c72f09-b708-4ac8-ac7c-2084d70108fe"
|
||||
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
|
||||
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
|
||||
PrettyPrinting = "54e16d92-306c-5ea0-a30b-337be88ac337"
|
||||
|
||||
[compat]
|
||||
GeneralUtils = "0.3.2"
|
||||
JSON = "1.6.1"
|
||||
PrettyPrinting = "0.4.2"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module LLMMCTS
|
||||
|
||||
# export agent
|
||||
export MCTSNode
|
||||
|
||||
|
||||
""" Order by dependencies of each file. The 1st included file must not depend on any other
|
||||
|
||||
@@ -9,7 +9,6 @@ using ..type, ..mcts, ..util
|
||||
# ---------------------------------------------- 100 --------------------------------------------- #
|
||||
|
||||
|
||||
|
||||
""" Search the best action to take for a given state and task
|
||||
|
||||
# Arguments
|
||||
@@ -34,7 +33,7 @@ using ..type, ..mcts, ..util
|
||||
a known state. 1.0 balance between exploration and exploitation like 50%-50%. 2.0 makes MCTS
|
||||
aggressively explore new state (default: 1.0)
|
||||
- `earlystop::Union{Function,Nothing}`
|
||||
optional function to check early stopping condition (default: nothing)
|
||||
optional function to check early stopping condition if it is satisfied, MCTS will break iterations (default: nothing)
|
||||
- `saveSimulatedNode::Bool`
|
||||
whether to save nodes created during simulation phase (default: false)
|
||||
- `multithread::Bool`
|
||||
@@ -63,12 +62,16 @@ function runMCTS(
|
||||
explorationweight::Number=1.0,
|
||||
earlystop::Union{Function,Nothing}=nothing,
|
||||
saveSimulatedNode::Bool=false,
|
||||
multithread=false
|
||||
)::NamedTuple{(:root, :bestNextState, :bestFinalState),Tuple{MCTSNode,T,T}} where {T<:Any}
|
||||
multithread=false,
|
||||
)::NamedTuple{(:root, :bestNextState, :bestTerminalState, :highValueStateList),
|
||||
Tuple{MCTSNode,T,T,Vector{Dict{Symbol,Any}}}} where {T<:Any}
|
||||
|
||||
root = MCTSNode("root", initialstate, 0, 0, 0, 0, false, nothing, Dict{String,MCTSNode}(),
|
||||
Dict{Symbol,Any}())
|
||||
|
||||
# storage for holding all high reward terminal nodes
|
||||
highValueState = Channel{Any}(100)
|
||||
|
||||
for nth in 1:maxiterations
|
||||
node = root
|
||||
node.visits += 1
|
||||
@@ -78,6 +81,10 @@ function runMCTS(
|
||||
end
|
||||
|
||||
if node.isterminal
|
||||
if node.state[:reward] >= 8
|
||||
put!(highrewardNode, deepcopy(node.state))
|
||||
end
|
||||
|
||||
# MCTS arrive at the leaf node that is also a terminal state,
|
||||
# do nothing then go directly to backpropagation. It means the end of this iteration
|
||||
backpropagate(node, node.reward)
|
||||
@@ -91,15 +98,18 @@ function runMCTS(
|
||||
maxSimulationDepth=maxSimulationDepth,
|
||||
horizontalSampleSimulationPhase=horizontalSampleSimulationPhase,
|
||||
saveSimulatedNode=saveSimulatedNode,
|
||||
multithread=multithread)
|
||||
multithread=multithread,
|
||||
highValueState=highValueState,
|
||||
)
|
||||
end
|
||||
else
|
||||
for (leafNodeKey, leafNode) in node.children
|
||||
simulateThenBackpropagate(leafNode, transition, transitionargs;
|
||||
maxSimulationDepth=maxSimulationDepth,
|
||||
horizontalSampleSimulationPhase=horizontalSampleSimulationPhase,
|
||||
saveSimulatedNode=saveSimulatedNode,
|
||||
multithread=multithread)
|
||||
maxSimulationDepth=maxSimulationDepth,
|
||||
horizontalSampleSimulationPhase=horizontalSampleSimulationPhase,
|
||||
saveSimulatedNode=saveSimulatedNode,
|
||||
multithread=multithread,
|
||||
highValueState=highValueState)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -110,11 +120,24 @@ function runMCTS(
|
||||
end
|
||||
end
|
||||
|
||||
# select the best next state and the best final state
|
||||
# select the best next state and the best terminal state along the best trajectory
|
||||
bestNextState = selectBestNextNode(root)
|
||||
besttrajectory = selectBestTrajectoryNode(root)
|
||||
bestTerminalState = selectBestTrajectoryNode(root)
|
||||
|
||||
return (root=root, bestNextState=bestNextState.state, bestFinalState=besttrajectory.state)
|
||||
# take all high value state from highValueState channel and put it in a list
|
||||
highValueStateList = Vector{Dict{Symbol, Any}}()
|
||||
while !isempty(highValueState)
|
||||
push!(highValueStateList, take!(highValueState))
|
||||
end
|
||||
|
||||
result = (
|
||||
root=root,
|
||||
bestNextState=bestNextState.state,
|
||||
bestTerminalState=bestTerminalState.state,
|
||||
highValueStateList=highValueStateList
|
||||
)
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
""" Search the best action to take for a given state and task
|
||||
@@ -143,11 +166,21 @@ end
|
||||
function simulateThenBackpropagate(node::MCTSNode, transition::Function, transitionargs::NamedTuple;
|
||||
maxSimulationDepth::Integer=3, horizontalSampleSimulationPhase::Integer=3,
|
||||
saveSimulatedNode::Bool=false,
|
||||
multithread=false)
|
||||
simTrajectoryReward, terminalstate = simulate(node, transition, transitionargs;
|
||||
maxSimulationDepth=maxSimulationDepth,
|
||||
horizontalSample=horizontalSampleSimulationPhase,
|
||||
multithread=multithread)
|
||||
multithread=false,
|
||||
highValueState=Union{Nothing,Any}=nothing)
|
||||
simTrajectoryReward, terminalstate =
|
||||
simulate(node, transition, transitionargs;
|
||||
maxSimulationDepth=maxSimulationDepth,
|
||||
horizontalSample=horizontalSampleSimulationPhase,
|
||||
multithread=multithread)
|
||||
# if a node has state value >= 8, store it in highValueState
|
||||
if highValueState !== nothing &&
|
||||
terminalstate !== nothing &&
|
||||
terminalstate[:reward] >= 8
|
||||
|
||||
put!(highValueState, deepcopy(terminalstate))
|
||||
end
|
||||
|
||||
backpropagate(node, simTrajectoryReward)
|
||||
|
||||
# check if the user wants to keep the simulated node
|
||||
|
||||
143
src/mcts.jl
143
src/mcts.jl
@@ -1,7 +1,7 @@
|
||||
module mcts
|
||||
|
||||
export selectBestNextNode, selectBestTrajectoryNode, backpropagate, isleaf, isroot, selectChildNode,
|
||||
expand, simulate, makeNewState
|
||||
expand, simulate
|
||||
using Base.Threads
|
||||
using GeneralUtils
|
||||
|
||||
@@ -280,7 +280,7 @@ end
|
||||
"""
|
||||
function simulate(node::MCTSNode, transition::Function, transitionargs::NamedTuple;
|
||||
maxSimulationDepth::Integer=3, horizontalSample::Integer=3, multithread=false
|
||||
)::NamedTuple{(:simTrajectoryReward, :terminalstate), Tuple{<:Number, Union{Dict{Symbol, Any}, Nothing}}}
|
||||
)::NamedTuple{(:simTrajectoryReward, :terminalstate), Tuple{<:Number, Union{Dict{Symbol, Any}, Nothing}}}
|
||||
|
||||
simTrajectoryReward = 0.0
|
||||
terminalstate = nothing
|
||||
@@ -298,87 +298,88 @@ function simulate(node::MCTSNode, transition::Function, transitionargs::NamedTup
|
||||
end
|
||||
end
|
||||
|
||||
return (simTrajectoryReward=simTrajectoryReward, terminalstate=terminalstate)
|
||||
return (simTrajectoryReward=simTrajectoryReward,
|
||||
terminalstate=terminalstate)
|
||||
end
|
||||
|
||||
""" Make new state
|
||||
# """ Make new state
|
||||
|
||||
# Arguments
|
||||
- `currentstate::T1`
|
||||
Current state dictionary containing thought history and metadata
|
||||
- `thoughtDict::T4`
|
||||
Dictionary containing new thought and action
|
||||
- `response::T2`
|
||||
Response string from the environment
|
||||
- `select::Union{T3, Nothing}`
|
||||
Selection value or nothing
|
||||
- `reward::T3`
|
||||
Reward value for this state
|
||||
- `isterminal::Bool`
|
||||
Whether this state is terminal
|
||||
# # Arguments
|
||||
# - `currentstate::T1`
|
||||
# Current state dictionary containing thought history and metadata
|
||||
# - `thoughtDict::T4`
|
||||
# Dictionary containing new thought and action
|
||||
# - `response::T2`
|
||||
# Response string from the environment
|
||||
# - `select::Union{T3, Nothing}`
|
||||
# Selection value or nothing
|
||||
# - `reward::T3`
|
||||
# Reward value for this state
|
||||
# - `isterminal::Bool`
|
||||
# Whether this state is terminal
|
||||
|
||||
# Return
|
||||
- `Tuple{String, Dict{Symbol, <:Any}}`
|
||||
A tuple containing:
|
||||
- A unique node key string
|
||||
- A new state dictionary with updated thought history and metadata
|
||||
# # Return
|
||||
# - `Tuple{String, Dict{Symbol, <:Any}}`
|
||||
# A tuple containing:
|
||||
# - A unique node key string
|
||||
# - A new state dictionary with updated thought history and metadata
|
||||
|
||||
# Example
|
||||
```jldoctest
|
||||
julia>
|
||||
```
|
||||
# # Example
|
||||
# ```jldoctest
|
||||
# julia>
|
||||
# ```
|
||||
|
||||
# Signature
|
||||
"""
|
||||
function makeNewState(currentstate::T1, thoughtDict::T4, response::T2, select::Union{T3, Nothing},
|
||||
reward::T3, isterminal::Bool
|
||||
)::Tuple{String, Dict{Symbol, <:Any}} where {T1<:AbstractDict, T2<:AbstractString, T3<:Number, T4<:AbstractDict}
|
||||
# # Signature
|
||||
# """
|
||||
# function makeNewState(currentstate::T1, thoughtDict::T4, response::T2, select::Union{T3, Nothing},
|
||||
# reward::T3, isterminal::Bool
|
||||
# )::Tuple{String, Dict{Symbol, <:Any}} where {T1<:AbstractDict, T2<:AbstractString, T3<:Number, T4<:AbstractDict}
|
||||
|
||||
# Find the latest thought key and index from current state's thought history
|
||||
currentstate_latestThoughtKey, currentstate_latestThoughtIndice =
|
||||
GeneralUtils.findHighestIndexKey(currentstate[:thoughtHistory], "thought")
|
||||
# Calculate next index for new thought/action
|
||||
currentstate_nextIndice =
|
||||
currentstate_latestThoughtKey == :NA ? 1 : currentstate_latestThoughtIndice + 1
|
||||
# Create new keys for thought and action based on next index
|
||||
currentstate_latestThoughtKey = Symbol("thought_$currentstate_nextIndice")
|
||||
latestActionKey = Symbol("action_$currentstate_nextIndice")
|
||||
# # Find the latest thought key and index from current state's thought history
|
||||
# currentstate_latestThoughtKey, currentstate_latestThoughtIndice =
|
||||
# GeneralUtils.findHighestIndexKey(currentstate[:thoughtHistory], "thought")
|
||||
# # Calculate next index for new thought/action
|
||||
# currentstate_nextIndice =
|
||||
# currentstate_latestThoughtKey == :NA ? 1 : currentstate_latestThoughtIndice + 1
|
||||
# # Create new keys for thought and action based on next index
|
||||
# currentstate_latestThoughtKey = Symbol("thought_$currentstate_nextIndice")
|
||||
# latestActionKey = Symbol("action_$currentstate_nextIndice")
|
||||
|
||||
# Find the latest thought index from input thought dictionary
|
||||
_, thoughtDict_latestThoughtIndice =
|
||||
GeneralUtils.findHighestIndexKey(thoughtDict, "thought")
|
||||
# # Find the latest thought index from input thought dictionary
|
||||
# _, thoughtDict_latestThoughtIndice =
|
||||
# GeneralUtils.findHighestIndexKey(thoughtDict, "thought")
|
||||
|
||||
# Determine thought and action keys from thought dictionary
|
||||
thoughtDict_latestThoughtKey, thoughtDict_latestActionKey =
|
||||
if thoughtDict_latestThoughtIndice == -1
|
||||
(:thought, :action)
|
||||
else
|
||||
(
|
||||
Symbol("thought_$thoughtDict_latestThoughtIndice"),
|
||||
Symbol("action_$thoughtDict_latestThoughtIndice"),
|
||||
)
|
||||
end
|
||||
# # Determine thought and action keys from thought dictionary
|
||||
# thoughtDict_latestThoughtKey, thoughtDict_latestActionKey =
|
||||
# if thoughtDict_latestThoughtIndice == -1
|
||||
# (:thought, :action)
|
||||
# else
|
||||
# (
|
||||
# Symbol("thought_$thoughtDict_latestThoughtIndice"),
|
||||
# Symbol("action_$thoughtDict_latestThoughtIndice"),
|
||||
# )
|
||||
# end
|
||||
|
||||
# Create new state by deep copying current state
|
||||
newstate = deepcopy(currentstate)
|
||||
# Update thought history with new thought
|
||||
newstate[:thoughtHistory][currentstate_latestThoughtKey] =
|
||||
thoughtDict[thoughtDict_latestThoughtKey]
|
||||
# Update thought history with new action
|
||||
newstate[:thoughtHistory][latestActionKey] = thoughtDict[thoughtDict_latestActionKey]
|
||||
# Create and add new observation to thought history
|
||||
newObservationKey = Symbol("observation_$(currentstate_nextIndice)")
|
||||
newstate[:thoughtHistory][newObservationKey] = response
|
||||
# Update state metadata
|
||||
newstate[:reward] = reward
|
||||
newstate[:select] = select
|
||||
newstate[:isterminal] = isterminal
|
||||
# # Create new state by deep copying current state
|
||||
# newstate = deepcopy(currentstate)
|
||||
# # Update thought history with new thought
|
||||
# newstate[:thoughtHistory][currentstate_latestThoughtKey] =
|
||||
# thoughtDict[thoughtDict_latestThoughtKey]
|
||||
# # Update thought history with new action
|
||||
# newstate[:thoughtHistory][latestActionKey] = thoughtDict[thoughtDict_latestActionKey]
|
||||
# # Create and add new observation to thought history
|
||||
# newObservationKey = Symbol("observation_$(currentstate_nextIndice)")
|
||||
# newstate[:thoughtHistory][newObservationKey] = response
|
||||
# # Update state metadata
|
||||
# newstate[:reward] = reward
|
||||
# newstate[:select] = select
|
||||
# newstate[:isterminal] = isterminal
|
||||
|
||||
# Generate unique ID for new node
|
||||
newNodeKey = GeneralUtils.uuid4snakecase()
|
||||
# # Generate unique ID for new node
|
||||
# newNodeKey = GeneralUtils.uuid4snakecase()
|
||||
|
||||
return (newNodeKey, newstate)
|
||||
end
|
||||
# return (newNodeKey, newstate)
|
||||
# end
|
||||
|
||||
|
||||
|
||||
|
||||
41
test/Manifest.toml
Normal file
41
test/Manifest.toml
Normal file
@@ -0,0 +1,41 @@
|
||||
# This file is machine-generated - editing it directly is not advised
|
||||
|
||||
julia_version = "1.11.4"
|
||||
manifest_format = "2.0"
|
||||
project_hash = "71d91126b5a1fb1020e1098d9d492de2a4438fd2"
|
||||
|
||||
[[deps.Base64]]
|
||||
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.InteractiveUtils]]
|
||||
deps = ["Markdown"]
|
||||
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.Logging]]
|
||||
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.Markdown]]
|
||||
deps = ["Base64"]
|
||||
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.Random]]
|
||||
deps = ["SHA"]
|
||||
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.SHA]]
|
||||
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
|
||||
version = "0.7.0"
|
||||
|
||||
[[deps.Serialization]]
|
||||
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
|
||||
version = "1.11.0"
|
||||
|
||||
[[deps.Test]]
|
||||
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
|
||||
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
|
||||
version = "1.11.0"
|
||||
2
test/Project.toml
Normal file
2
test/Project.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
[deps]
|
||||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
|
||||
Reference in New Issue
Block a user