From 8da0605388d05fe3f55d38b0eca5630bf99fdc6b Mon Sep 17 00:00:00 2001 From: Dylan Asmar Date: Tue, 19 Dec 2023 23:18:13 -0700 Subject: [PATCH 1/6] gitignore update, removed Manifest.toml --- .gitignore | 6 ++- docs/Manifest.toml | 104 --------------------------------------------- 2 files changed, 4 insertions(+), 106 deletions(-) delete mode 100644 docs/Manifest.toml diff --git a/.gitignore b/.gitignore index 20fe29d..032b83c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ *.jl.*.cov *.jl.cov *.jl.mem -/Manifest.toml -/docs/build/ +Manifest.toml +docs/build/ +docs/Manifest.toml +.vscode diff --git a/docs/Manifest.toml b/docs/Manifest.toml deleted file mode 100644 index 2b3e7d3..0000000 --- a/docs/Manifest.toml +++ /dev/null @@ -1,104 +0,0 @@ -# This file is machine-generated - editing it directly is not advised - -[[Base64]] -uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" - -[[Dates]] -deps = ["Printf"] -uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" - -[[Distributed]] -deps = ["Random", "Serialization", "Sockets"] -uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" - -[[DocStringExtensions]] -deps = ["LibGit2", "Markdown", "Pkg", "Test"] -git-tree-sha1 = "50ddf44c53698f5e784bbebb3f4b21c5807401b1" -uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.8.3" - -[[Documenter]] -deps = ["Base64", "Dates", "DocStringExtensions", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"] -git-tree-sha1 = "71e35e069daa9969b8af06cef595a1add76e0a11" -uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -version = "0.25.3" - -[[IOCapture]] -deps = ["Logging"] -git-tree-sha1 = "377252859f740c217b936cebcd918a44f9b53b59" -uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89" -version = "0.1.1" - -[[InteractiveUtils]] -deps = ["Markdown"] -uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" - -[[JSON]] -deps = ["Dates", "Mmap", "Parsers", "Unicode"] -git-tree-sha1 = "81690084b6198a2e1da36fcfda16eeca9f9f24e4" -uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" -version = "0.21.1" - -[[LibGit2]] -deps = ["Printf"] -uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" - -[[Libdl]] -uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" - -[[Logging]] -uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" - -[[FactoredValueMCTS]] -path = ".." -uuid = "c016a6d7-1193-47d7-896a-d9f14d6b4b26" -version = "0.1.0" - -[[Markdown]] -deps = ["Base64"] -uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" - -[[Mmap]] -uuid = "a63ad114-7e13-5084-954f-fe012c677804" - -[[Parsers]] -deps = ["Dates"] -git-tree-sha1 = "6fa4202675c05ba0f8268a6ddf07606350eda3ce" -uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "1.0.11" - -[[Pkg]] -deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"] -uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" - -[[Printf]] -deps = ["Unicode"] -uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" - -[[REPL]] -deps = ["InteractiveUtils", "Markdown", "Sockets"] -uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" - -[[Random]] -deps = ["Serialization"] -uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" - -[[SHA]] -uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" - -[[Serialization]] -uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" - -[[Sockets]] -uuid = "6462fe0b-24de-5631-8697-dd941f90decc" - -[[Test]] -deps = ["Distributed", "InteractiveUtils", "Logging", "Random"] -uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[[UUIDs]] -deps = ["Random", "SHA"] -uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" - -[[Unicode]] -uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" From 897251f26f86b96d87e938fe0ca5a108b7fc9657 Mon Sep 17 00:00:00 2001 From: Dylan Asmar Date: Wed, 20 Dec 2023 10:44:08 -0700 Subject: [PATCH 2/6] file cleanup --- test/Project.toml | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 test/Project.toml diff --git a/test/Project.toml b/test/Project.toml deleted file mode 100644 index ee361bd..0000000 --- a/test/Project.toml +++ /dev/null @@ -1,5 +0,0 @@ -[deps] -MultiAgentSysAdmin = "a4538d8c-5052-4f30-aec9-286910cf67a1" -MultiUAVDelivery = "13c59af0-a5df-4589-8a68-75dc1bf2d35a" -POMDPs = "a93abf59-7444-517b-a68a-c42f96afdd7d" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" From a2d012133b580acd652e485ac4efb0777a8a3cbb Mon Sep 17 00:00:00 2001 From: Dylan Asmar Date: Wed, 20 Dec 2023 10:45:04 -0700 Subject: [PATCH 3/6] POMDPtools and Graphs update --- Project.toml | 24 ++++++++++------------- src/FactoredValueMCTS.jl | 9 ++------- src/fvmcts/action_coordination/maxplus.jl | 2 +- src/fvmcts/fv_mcts_vanilla.jl | 2 +- test/runtests.jl | 5 ++--- 5 files changed, 16 insertions(+), 26 deletions(-) diff --git a/Project.toml b/Project.toml index 0f65159..cb1b536 100644 --- a/Project.toml +++ b/Project.toml @@ -4,34 +4,30 @@ authors = ["Stanford Intelligent Systems Laboratory"] version = "0.1.0" [deps] -BeliefUpdaters = "8bb6e9a1-7d73-552c-a44a-e5dc5634aac4" -LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d" +Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MCTS = "e12ccd36-dcad-5f33-8774-9175229e7b33" MultiAgentPOMDPs = "9ac5fd70-7902-42e7-9745-ff446b44e779" POMDPLinter = "f3bd98c0-eb40-45e2-9eb1-f2763262d755" -POMDPModelTools = "08074719-1b2a-587c-a292-00f91cc44415" -POMDPPolicies = "182e52fb-cfd0-5e46-8c26-fd0667c990f4" -POMDPSimulators = "e0d0a172-29c6-5d4e-96d0-f262df5d01fd" +POMDPTools = "7588e00f-9cae-40de-98dc-e0c70c48cdd7" POMDPs = "a93abf59-7444-517b-a68a-c42f96afdd7d" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" [compat] -julia = "1.5" +Graphs = "1.5" +MCTS = "0.5" MultiAgentPOMDPs = "0.1" -POMDPs = "0.9" POMDPLinter = "0.1" -POMDPModelTools = "0.3" -POMDPSimulators = "0.3" -POMDPPolicies = "0.3,0.4" -LightGraphs = "1.3" +POMDPTools = "0.1" +POMDPs = "0.9" StaticArrays = "1.0" -MCTS = "0.4" -BeliefUpdaters = "0.2" +julia = "1.6" [extras] +MultiAgentSysAdmin = "a4538d8c-5052-4f30-aec9-286910cf67a1" +MultiUAVDelivery = "13c59af0-a5df-4589-8a68-75dc1bf2d35a" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Test"] +test = ["Test", "MultiAgentSysAdmin", "MultiUAVDelivery"] diff --git a/src/FactoredValueMCTS.jl b/src/FactoredValueMCTS.jl index 97a9ad5..179b962 100644 --- a/src/FactoredValueMCTS.jl +++ b/src/FactoredValueMCTS.jl @@ -4,18 +4,13 @@ using Random using LinearAlgebra using POMDPs +using POMDPTools using MultiAgentPOMDPs -using POMDPPolicies using POMDPLinter: @req, @subreq, @POMDP_require using MCTS -using LightGraphs -using BeliefUpdaters - +using Graphs using MCTS: convert_estimator -import POMDPModelTools -using POMDPSimulators: RolloutSimulator -import POMDPs # Patch simulate to support vector of rewards function POMDPs.simulate(sim::RolloutSimulator, mdp::JointMDP, policy::Policy, initialstate::S) where {S} diff --git a/src/fvmcts/action_coordination/maxplus.jl b/src/fvmcts/action_coordination/maxplus.jl index 40fe54e..70bec6f 100644 --- a/src/fvmcts/action_coordination/maxplus.jl +++ b/src/fvmcts/action_coordination/maxplus.jl @@ -12,7 +12,7 @@ the joint action in Factored-Value MCTS. Putting parameters here is a little ugl Fields: adjmatgraph::SimpleGraph - The coordination graph as a LightGraphs SimpleGraph. + The coordination graph as a Graphs SimpleGraph. message_iters::Int64 Number of rounds of message passing. diff --git a/src/fvmcts/fv_mcts_vanilla.jl b/src/fvmcts/fv_mcts_vanilla.jl index de692a1..6a22847 100644 --- a/src/fvmcts/fv_mcts_vanilla.jl +++ b/src/fvmcts/fv_mcts_vanilla.jl @@ -271,7 +271,7 @@ function POMDPs.action(planner::FVMCTSPlanner, s) return action end -function POMDPModelTools.action_info(planner::FVMCTSPlanner, s) +function POMDPTools.action_info(planner::FVMCTSPlanner, s) clear_tree!(planner) # Always call this at the top plan!(planner, s) action = coordinate_action(planner.mdp, planner.tree, s) diff --git a/test/runtests.jl b/test/runtests.jl index 881155b..e455937 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,9 +1,8 @@ -using FactoredValueMCTS -using Test - using POMDPs +using FactoredValueMCTS using MultiAgentSysAdmin using MultiUAVDelivery +using Test @testset "FactoredValueMCTS.jl" begin From 534ff4caf6c28819345294377c23945111d6d1cf Mon Sep 17 00:00:00 2001 From: Dylan Asmar Date: Wed, 20 Dec 2023 10:45:41 -0700 Subject: [PATCH 4/6] ci and docs workflow updates --- .github/workflows/CompatHelper.yml | 38 ++++++++++++++++++--- .github/workflows/Documentation.yml | 23 +++++++++++++ .github/workflows/ci.yml | 53 ++++++----------------------- docs/make.jl | 16 +++------ 4 files changed, 71 insertions(+), 59 deletions(-) create mode 100644 .github/workflows/Documentation.yml diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index cba9134..6f52ed5 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -3,14 +3,42 @@ on: schedule: - cron: 0 0 * * * workflow_dispatch: +permissions: + contents: write + pull-requests: write jobs: CompatHelper: runs-on: ubuntu-latest steps: - - name: Pkg.add("CompatHelper") - run: julia -e 'using Pkg; Pkg.add("CompatHelper")' - - name: CompatHelper.main() + - name: Check if Julia is already available in the PATH + id: julia_in_path + run: which julia + continue-on-error: true + - name: Install Julia, but only if it is not already available in the PATH + uses: julia-actions/setup-julia@v1 + with: + version: '1' + arch: ${{ runner.arch }} + if: steps.julia_in_path.outcome != 'success' + - name: "Add the General registry via Git" + run: | + import Pkg + ENV["JULIA_PKG_SERVER"] = "" + Pkg.Registry.add("General") + shell: julia --color=yes {0} + - name: "Install CompatHelper" + run: | + import Pkg + name = "CompatHelper" + uuid = "aa819f21-2bde-4658-8897-bab36330d9b7" + version = "3" + Pkg.add(; name, uuid, version) + shell: julia --color=yes {0} + - name: "Run CompatHelper" + run: | + import CompatHelper + CompatHelper.main() + shell: julia --color=yes {0} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} - run: julia -e 'using CompatHelper; CompatHelper.main()' + COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} \ No newline at end of file diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml new file mode 100644 index 0000000..db1024e --- /dev/null +++ b/.github/workflows/Documentation.yml @@ -0,0 +1,23 @@ +name: Documentation + +on: + push: + branches: + - master + tags: [v*] + pull_request: + +jobs: + build: + permissions: + contents: write + statuses: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v1 + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-docdeploy@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7e3d11..341c7c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,10 @@ name: CI on: - - push - - pull_request + push: + branches: + - master + tags: '*' + pull_request: jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} @@ -10,58 +13,24 @@ jobs: fail-fast: false matrix: version: - - '1.5' - - 'nightly' + - "1" + - "1.6" os: - ubuntu-latest - macOS-latest - windows-latest arch: - x64 - exclude: - - os: macOS-latest - arch: x86 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v1 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v1 - with: - file: lcov.info - docs: - name: Documentation - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 + - uses: codecov/codecov-action@v3 with: - version: '1' - - run: | - julia --project=docs -e ' - using Pkg - Pkg.develop(PackageSpec(path=pwd())) - Pkg.instantiate()' - - run: | - julia --project=docs -e ' - using Documenter: doctest - using FactoredValueMCTS - doctest(FactoredValueMCTS)' - - run: julia --project=docs docs/make.jl - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + files: lcov.info \ No newline at end of file diff --git a/docs/make.jl b/docs/make.jl index 4245289..2f8fabe 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -2,20 +2,12 @@ using FactoredValueMCTS using Documenter makedocs(; - modules=[FactoredValueMCTS], + sitename="FactoredValueMCTS.jl", authors="Stanford Intelligent Systems Laboratory", - repo="https://github.com/JuliaPOMDP/FactoredValueMCTS.jl/blob/{commit}{path}#L{line}", - sitename="FactoredValueMCTS.jl", - format=Documenter.HTML(; - prettyurls=get(ENV, "CI", "false") == "true", - canonical="https://JuliaPOMDP.github.io/FactoredValueMCTS.jl", - assets=String[], - ), - pages=[ - "Home" => "index.md", - ], + modules=[FactoredValueMCTS], + format=Documenter.HTML() ) deploydocs(; - repo="github.com/JuliaPOMDP/FactoredValueMCTS.jl", + repo="github.com/JuliaPOMDP/FactoredValueMCTS.jl" ) From 71b206e53d25e848b7c48df36dd8931789dc0b4e Mon Sep 17 00:00:00 2001 From: Dylan Asmar Date: Wed, 20 Dec 2023 10:45:56 -0700 Subject: [PATCH 5/6] badge update and added citation block --- README.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fbfe721..339d195 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # FactoredValueMCTS -[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaPOMDP.github.io/FactoredValueMCTS.jl/stable) -[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://JuliaPOMDP.github.io/FactoredValueMCTS.jl/dev) -[![Build Status](https://github.com/JuliaPOMDP/FactoredValueMCTS.jl/workflows/CI/badge.svg)](https://github.com/JuliaPOMDP/FactoredValueMCTS.jl/actions) -[![Coverage](https://codecov.io/gh/JuliaPOMDP/FactoredValueMCTS.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaPOMDP/FactoredValueMCTS.jl) +[![CI](https://github.com/JuliaPOMDP/FactoredValueMCTS.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/JuliaPOMDP/FactoredValueMCTS.jl/actions/workflows/ci.yml) +[![codecov.io](http://codecov.io/github/JuliaPOMDP/FactoredValueMCTS.jl/coverage.svg?branch=master)](http://codecov.io/github/JuliaPOMDP/FactoredValueMCTS.jl?branch=master) +[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://juliapomdp.github.io/FactoredValueMCTS.jl/stable) +[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://juliapomdp.github.io/FactoredValueMCTS.jl/dev) This package implements the Monte Carlo Tree Search (MCTS) planning algorithm for Multi-Agent MDPs. The algorithm factorizes the true action value function, based on the locality of interactions between agents that is encoded with a Coordination Graph. We implement two schemes for coordinating the actions for the team of agents during the MCTS computations. The first is the iterative message-passing MaxPlus, while the second is the exact Variable Elimination. We thus get two different Factored Value MCTS algorithms, FV-MCTS-MaxPlus and FV-MCTS-VarEl respectively. @@ -13,7 +13,17 @@ To use our solver, the domain must implement the interface from [MultiAgentPOMDP ## Installation -In the Julia REPL, just do: ```julia -] add FactoredValueMCTS +using Pkg +Pkg.add("FactoredValueMCTS") ``` +## Citation + +``` +@inproceedings{choudhury2021scalable, + title={Scalable Anytime Planning for Multi-Agent {MDP}s}, + author={Shushman Choudhury and Jayesh K Gupta and Peter Morales and Mykel J Kochenderfer}, + booktitle={International Conference on Autonomous Agents and MultiAgent Systems}, + year={2021} +} +``` \ No newline at end of file From 0c75517640d5ed8a6ff6fe621f497cf41e39ddc5 Mon Sep 17 00:00:00 2001 From: Dylan Asmar Date: Wed, 20 Dec 2023 10:46:20 -0700 Subject: [PATCH 6/6] version bump --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index cb1b536..59b8345 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "FactoredValueMCTS" uuid = "c016a6d7-1193-47d7-896a-d9f14d6b4b26" authors = ["Stanford Intelligent Systems Laboratory"] -version = "0.1.0" +version = "0.2.0" [deps] Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"