Skip to content

Commit

Permalink
Merge pull request #357 from JuliaReach/schillic/models
Browse files Browse the repository at this point in the history
Revise models
  • Loading branch information
schillic authored Feb 3, 2024
2 parents 352f609 + eb3b9f9 commit 2ddade7
Show file tree
Hide file tree
Showing 107 changed files with 91,258 additions and 5,540 deletions.
6 changes: 0 additions & 6 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,13 @@ DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
DisplayAs = "0b91fe84-8a4c-11e9-3e1d-67c38462b6d6"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
MAT = "23992714-dd62-5051-b70f-ba57cb901cac"
ONNX = "d0dd6a25-fac6-55c0-abf7-829e0c774d20"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
ReachabilityAnalysis = "1e97bd63-91d1-579d-8e8d-501d2b57c93f"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"

[compat]
DifferentialEquations = "7"
DisplayAs = "0.1"
Documenter = "1"
Literate = "2"
MAT = "0.10"
ONNX = "0.2"
Plots = "1"
ReachabilityAnalysis = "0.23.1" # this version is needed for the ACC model
YAML = "0.4"
29 changes: 17 additions & 12 deletions docs/generate.jl
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# generate examples
import Literate
import ClosedLoopReachability: @modelpath

MODELS = [joinpath(@__DIR__, "..", "models", "ACC"),
joinpath(@__DIR__, "..", "models", "Sherlock-Benchmark-9-TORA"),
joinpath(@__DIR__, "..", "models", "Sherlock-Benchmark-10-Unicycle"),
joinpath(@__DIR__, "..", "models", "VertCAS"),
joinpath(@__DIR__, "..", "models", "Single-Pendulum"),
joinpath(@__DIR__, "..", "models", "Double-Pendulum"),
MODELS = [
joinpath(@__DIR__, "..", "models", "ACC"),
joinpath(@__DIR__, "..", "models", "Airplane"),
joinpath(@__DIR__, "..", "models", "AttitudeControl"),
joinpath(@__DIR__, "..", "models", "InvertedPendulum"),
joinpath(@__DIR__, "..", "models", "InvertedTwoLinkPendulum"),
joinpath(@__DIR__, "..", "models", "Quadrotor"),
joinpath(@__DIR__, "..", "models", "Spacecraft")
#joinpath(@__DIR__, "..", "models", "Sherlock-Benchmark-7"),
#joinpath(@__DIR__, "..", "models", "Cart-Pole"),
]
joinpath(@__DIR__, "..", "models", "SpacecraftDocking"),
joinpath(@__DIR__, "..", "models", "TORA"),
joinpath(@__DIR__, "..", "models", "Unicycle"),
joinpath(@__DIR__, "..", "models", "VerticalCAS")
]
GENERATEDDIR = joinpath(@__DIR__, "src", "models")
MODELDIR = joinpath(@__DIR__, "..", "models")
mkpath(GENERATEDDIR)
Expand All @@ -30,10 +28,17 @@ for model in MODELS
script = Literate.script(input, GENERATEDDIR; credit=false)
code = strip(read(script, String))
mdpost(str) = replace(str, "@__CODE__" => code)
Literate.markdown(input, GENERATEDDIR; postprocess=mdpost, credit=false)
if get(ENV, "DOCUMENTATIONGENERATOR", "") == "true"
Literate.markdown(input, GENERATEDDIR; postprocess=mdpost, credit=false)
else
# for the local build, one needs to set `nbviewer_root_url`
Literate.markdown(input, GENERATEDDIR; postprocess=mdpost, credit=false, nbviewer_root_url="..")
end
Literate.notebook(input, GENERATEDDIR; execute=true, credit=false)
elseif any(endswith.(file, [".png", ".jpg", ".gif"]))
cp(joinpath(model, file), joinpath(GENERATEDDIR, file); force=true)
elseif any(endswith.(file, [".md", ".polar"]))
# ignore *.md files and controller files without warning
else
@warn "ignoring $file in $model"
end
Expand Down
21 changes: 9 additions & 12 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,18 @@ makedocs(; sitename="ClosedLoopReachability.jl",
assets=["assets/aligned.css"]),
pagesonly=true,
pages=["Home" => "index.md",
"Examples" => Any["Adaptive Cruise Controller (ACC)" => "models/ACC.md",
"Translational Oscillations (TORA) with ReLU controller" => "models/Sherlock-Benchmark-9-TORA.md",
"Translational Oscillations (TORA) with sigmoid controller" => "models/Sherlock-Benchmark-9-TORA-Sigmoid.md",
"Translational Oscillations (TORA) with ReLU/tanh controller" => "models/Sherlock-Benchmark-9-TORA-ReluTanh.md",
"Unicycle Car Model" => "models/Sherlock-Benchmark-10-Unicycle.md",
"Vertical Collision Avoidance (VCAS)" => "models/VertCAS.md",
"Single Inverted Pendulum" => "models/Single-Pendulum.md",
"Double Inverted Pendulum" => "models/Double-Pendulum.md",
"Examples" => Any[
"Adaptive Cruise Control (ACC)" => "models/ACC.md",
"Airplane" => "models/Airplane.md",
"Attitude Control" => "models/AttitudeControl.md",
"Inverted Pendulum" => "models/InvertedPendulum.md",
"Inverted Two-Link Pendulum" => "models/InvertedTwoLinkPendulum.md",
"Quadrotor" => "models/Quadrotor.md",
"Spacecraft" => "models/Spacecraft.md"
#"Sliding controller" => "models/Sherlock-Benchmark-7.md",
#"Nonlinear Cart-Pole" => "models/Cart-Pole.md",
],
"Spacecraft Docking" => "models/SpacecraftDocking.md",
"Translational Oscillations by a Rotational Actuator (TORA)" => "models/TORA.md",
"Unicycle" => "models/Unicycle.md",
"Vertical Collision Avoidance System (VerticalCAS)" => "models/VerticalCAS.md",
],
"API Reference" => Any["Problem types" => "lib/problems.md",
"Solvers" => "lib/solvers.md",
"Utilities" => "lib/utils.md"]])
Expand Down
Loading

0 comments on commit 2ddade7

Please sign in to comment.