Skip to content

Commit 6bad109

Browse files
author
Documenter.jl
committed
build based on ade4958
1 parent 05f99cf commit 6bad109

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+144904
-144722
lines changed

dev/.documenter-siteinfo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-10-30T17:17:33","documenter_version":"1.7.0"}}
1+
{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-10-30T18:45:09","documenter_version":"1.7.0"}}

dev/developers/git/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
changes on master
1616
=======
1717
changes on your branch
18-
&gt;&gt;&gt;&gt;&gt;&gt;&gt; mybranch</code></pre><p>and choose the changes that should be kept. Then you should <code>git add</code> the conflicting files, run <code>git rebase --continue</code>. See <a href="https://docs.github.com/en/github/using-git/resolving-merge-conflicts-after-a-git-rebase">here</a> for more information on this. In case you have may conflicting commits, the rebase can be tedious, you will even have to resolve conflicts for some changes in some earlier commit even if you reverted these changes in a later commit. To avoid this issue, it is recommended to first squash your commits into a single one. To do that, use</p><pre><code class="language-sh hljs">$ git rebase -i master</code></pre><p>and replace <code>pick</code> by <code>s</code> for all commits except the top one and then follow the instructions, see <a href="https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History">here</a> for more details.</p><h2 id="Switch-branches"><a class="docs-heading-anchor" href="#Switch-branches">Switch branches</a><a id="Switch-branches-1"></a><a class="docs-heading-anchor-permalink" href="#Switch-branches" title="Permalink"></a></h2><p>To switch to the branch <code>mybranch</code>, do the following.</p><h3 id="VSCode-7"><a class="docs-heading-anchor" href="#VSCode-7">VSCode</a><a class="docs-heading-anchor-permalink" href="#VSCode-7" title="Permalink"></a></h3><p>On the bottom left, you should see a sort of &quot;Y&quot; symbol with empty circles at the three leaves. On the right, you see the current branch. Click on it and then write or select <code>mybranch</code>.</p><h3 id="Git-bash-7"><a class="docs-heading-anchor" href="#Git-bash-7">Git bash</a><a class="docs-heading-anchor-permalink" href="#Git-bash-7" title="Permalink"></a></h3><p>First <a href="../setup/#Start-Git-bash">Start Git bash</a>.</p><pre><code class="language-sh hljs">$ git checkout mybranch</code></pre><h2 id="Format-your-code"><a class="docs-heading-anchor" href="#Format-your-code">Format your code</a><a id="Format-your-code-1"></a><a class="docs-heading-anchor-permalink" href="#Format-your-code" title="Permalink"></a></h2><p>To format your code, run the following in your Julia REPL. Make sure you have added <a href="https://github.com/domluna/JuliaFormatter.jl">JuliaFormatter.jl</a> before. </p><pre><code class="language-julia hljs">julia&gt; using JuliaFormatter; format(&quot;.&quot;)</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../setup/">« Set up</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Wednesday 30 October 2024 17:17">Wednesday 30 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
18+
&gt;&gt;&gt;&gt;&gt;&gt;&gt; mybranch</code></pre><p>and choose the changes that should be kept. Then you should <code>git add</code> the conflicting files, run <code>git rebase --continue</code>. See <a href="https://docs.github.com/en/github/using-git/resolving-merge-conflicts-after-a-git-rebase">here</a> for more information on this. In case you have may conflicting commits, the rebase can be tedious, you will even have to resolve conflicts for some changes in some earlier commit even if you reverted these changes in a later commit. To avoid this issue, it is recommended to first squash your commits into a single one. To do that, use</p><pre><code class="language-sh hljs">$ git rebase -i master</code></pre><p>and replace <code>pick</code> by <code>s</code> for all commits except the top one and then follow the instructions, see <a href="https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History">here</a> for more details.</p><h2 id="Switch-branches"><a class="docs-heading-anchor" href="#Switch-branches">Switch branches</a><a id="Switch-branches-1"></a><a class="docs-heading-anchor-permalink" href="#Switch-branches" title="Permalink"></a></h2><p>To switch to the branch <code>mybranch</code>, do the following.</p><h3 id="VSCode-7"><a class="docs-heading-anchor" href="#VSCode-7">VSCode</a><a class="docs-heading-anchor-permalink" href="#VSCode-7" title="Permalink"></a></h3><p>On the bottom left, you should see a sort of &quot;Y&quot; symbol with empty circles at the three leaves. On the right, you see the current branch. Click on it and then write or select <code>mybranch</code>.</p><h3 id="Git-bash-7"><a class="docs-heading-anchor" href="#Git-bash-7">Git bash</a><a class="docs-heading-anchor-permalink" href="#Git-bash-7" title="Permalink"></a></h3><p>First <a href="../setup/#Start-Git-bash">Start Git bash</a>.</p><pre><code class="language-sh hljs">$ git checkout mybranch</code></pre><h2 id="Format-your-code"><a class="docs-heading-anchor" href="#Format-your-code">Format your code</a><a id="Format-your-code-1"></a><a class="docs-heading-anchor-permalink" href="#Format-your-code" title="Permalink"></a></h2><p>To format your code, run the following in your Julia REPL. Make sure you have added <a href="https://github.com/domluna/JuliaFormatter.jl">JuliaFormatter.jl</a> before. </p><pre><code class="language-julia hljs">julia&gt; using JuliaFormatter; format(&quot;.&quot;)</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../setup/">« Set up</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Wednesday 30 October 2024 18:44">Wednesday 30 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

dev/developers/setup/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
23 # for example in EXAMPLES_UTILS
1717
24 # literate_actions(joinpath(EXAMPLES_UTILS_DIR, example), OUTPUT_DIR)
1818
25 # end
19-
26 # literate_actions(joinpath(@__DIR__, &quot;src&quot;, &quot;Getting Started.jl&quot;), OUTPUT_DIR)</code></pre><p>This will speed up building the documentation quite a lot.</p><p>Now, build the documentation with:</p><pre><code class="language-julia hljs">julia&gt; include(&quot;docs/make.jl&quot;)</code></pre><p>To view it, open the file <code>docs/build/index.html</code> with your web browser.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../reference/Utils/">« Utils</a><a class="docs-footer-nextpage" href="../git/">Git »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Wednesday 30 October 2024 17:17">Wednesday 30 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
19+
26 # literate_actions(joinpath(@__DIR__, &quot;src&quot;, &quot;Getting Started.jl&quot;), OUTPUT_DIR)</code></pre><p>This will speed up building the documentation quite a lot.</p><p>Now, build the documentation with:</p><pre><code class="language-julia hljs">julia&gt; include(&quot;docs/make.jl&quot;)</code></pre><p>To view it, open the file <code>docs/build/index.html</code> with your web browser.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../reference/Utils/">« Utils</a><a class="docs-footer-nextpage" href="../git/">Git »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Wednesday 30 October 2024 18:44">Wednesday 30 October 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

dev/examples/solvers/Path planning.jl

Lines changed: 60 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -33,52 +33,73 @@ using Test #src
3333
# First, let us import [StaticArrays](https://github.com/JuliaArrays/StaticArrays.jl) and [Plots](https://github.com/JuliaPlots/Plots.jl).
3434
using StaticArrays, Plots
3535

36-
# At this point, we import Dionysos.
37-
using Dionysos
38-
const DI = Dionysos
39-
const UT = DI.Utils
40-
const DO = DI.Domain
41-
const ST = DI.System
42-
const SY = DI.Symbolic
43-
const PR = DI.Problem
44-
const OP = DI.Optim
45-
const AB = OP.Abstraction
46-
47-
# And the file defining the hybrid system for this problem
48-
include(joinpath(dirname(dirname(pathof(Dionysos))), "problems", "path_planning.jl"))
36+
# At this point, we import Dionysos and JuMP.
37+
using Dionysos, JuMP
4938

5039
# ### Definition of the problem
5140

52-
# Now we instantiate the problem using the function provided by [PathPlanning.jl](@__REPO_ROOT_URL__/problems/PathPlanning.jl)
53-
concrete_problem = PathPlanning.problem(; simple = true, approx_mode = PathPlanning.GROWTH);
54-
concrete_system = concrete_problem.system;
41+
# We define the problem using JuMP as follows.
42+
# We first create a JuMP model:
43+
model = Model(Dionysos.Optimizer)
44+
45+
# Define the state variables: x1(t), x2(t), x3(t)
46+
x_low, x_upp = [0.0, 0.0, -pi - 0.4], [4.0, 10.0, pi + 0.4]
47+
x_start = [0.4, 0.4, 0.0]
48+
@variable(model, x_low[i] <= x[i = 1:3] <= x_upp[i], start = x_start[i])
49+
50+
# Define the control variables: u1(t), u2(t)
51+
@variable(model, -1 <= u[1:2] <= 1)
52+
53+
# Set α(t) = arctan(tan(u2(t)) / 2)
54+
@expression(model, α, atan(tan(u[2]) / 2))
55+
56+
@constraint(model, (x[1]) == u[1] * cos+ x[3]) * sec(α))
57+
@constraint(model, (x[2]) == u[1] * sin+ x[3]) * sec(α))
58+
@constraint(model, (x[3]) == u[1] * tan(u[2]))
59+
60+
x_target = [3.3, 0.5, 0]
61+
62+
@constraint(model, final(x[1]) in MOI.Interval(3.0, 3.6))
63+
@constraint(model, final(x[2]) in MOI.Interval(0.3, 0.8))
64+
@constraint(model, final(x[3]) in MOI.Interval(-100.0, 100.0))
65+
66+
# Obstacle boundaries (provided)
67+
x1_lb = [1.0, 2.2, 2.2]
68+
x1_ub = [1.2, 2.4, 2.4]
69+
x2_lb = [0.0, 0.0, 6.0]
70+
x2_ub = [9.0, 5.0, 10.0]
71+
72+
# Function to add rectangular obstacle avoidance constraints
73+
74+
for i in eachindex(x1_ub)
75+
@constraint(
76+
model,
77+
x[1:2] MOI.HyperRectangle([x1_lb[i], x2_lb[i]], [x1_ub[i], x2_ub[i]])
78+
)
79+
end
5580

5681
# ### Definition of the abstraction
5782

5883
# Definition of the grid of the state-space on which the abstraction is based (origin `x0` and state-space discretization `h`):
84+
5985
x0 = SVector(0.0, 0.0, 0.0);
6086
h = SVector(0.2, 0.2, 0.2);
61-
state_grid = DO.GridFree(x0, h);
87+
set_attribute(model, "state_grid", Dionysos.Domain.GridFree(x0, h))
6288

6389
# Definition of the grid of the input-space on which the abstraction is based (origin `u0` and input-space discretization `h`):
6490
u0 = SVector(0.0, 0.0);
6591
h = SVector(0.3, 0.3);
66-
input_grid = DO.GridFree(u0, h);
92+
set_attribute(model, "input_grid", Dionysos.Domain.GridFree(u0, h))
6793

68-
# We now solve the optimal control problem with the `Abstraction.UniformGridAbstraction.Optimizer`.
69-
70-
using JuMP
71-
optimizer = MOI.instantiate(AB.UniformGridAbstraction.Optimizer)
72-
MOI.set(optimizer, MOI.RawOptimizerAttribute("concrete_problem"), concrete_problem)
73-
MOI.set(optimizer, MOI.RawOptimizerAttribute("state_grid"), state_grid)
74-
MOI.set(optimizer, MOI.RawOptimizerAttribute("input_grid"), input_grid)
75-
MOI.optimize!(optimizer)
94+
optimize!(model)
7695

7796
# Get the results
78-
abstract_system = MOI.get(optimizer, MOI.RawOptimizerAttribute("abstract_system"))
79-
abstract_problem = MOI.get(optimizer, MOI.RawOptimizerAttribute("abstract_problem"))
80-
abstract_controller = MOI.get(optimizer, MOI.RawOptimizerAttribute("abstract_controller"))
81-
concrete_controller = MOI.get(optimizer, MOI.RawOptimizerAttribute("concrete_controller"))
97+
abstract_system = get_attribute(model, "abstract_system");
98+
abstract_problem = get_attribute(model, "abstract_problem");
99+
abstract_controller = get_attribute(model, "abstract_controller");
100+
concrete_controller = get_attribute(model, "concrete_controller")
101+
concrete_problem = get_attribute(model, "concrete_problem");
102+
concrete_system = concrete_problem.system
82103

83104
@test length(abstract_controller.data) == 19400 #src
84105

@@ -93,15 +114,18 @@ function reached(x)
93114
return false
94115
end
95116
end
117+
96118
x0 = SVector(0.4, 0.4, 0.0)
97-
control_trajectory = ST.get_closed_loop_trajectory(
119+
control_trajectory = Dionysos.System.get_closed_loop_trajectory(
98120
concrete_system.f,
99121
concrete_controller,
100122
x0,
101123
nstep;
102124
stopping = reached,
103125
)
104126

127+
using Plots
128+
105129
# Here we display the coordinate projection on the two first components of the state space along the trajectory.
106130
fig = plot(; aspect_ratio = :equal);
107131
# We display the concrete domain
@@ -116,11 +140,14 @@ plot!(concrete_problem.target_set; dims = [1, 2], color = :red, opacity = 0.2);
116140

117141
# We display the abstract specifications
118142
plot!(
119-
SY.get_domain_from_symbols(abstract_system, abstract_problem.initial_set);
143+
Dionysos.Symbolic.get_domain_from_symbols(
144+
abstract_system,
145+
abstract_problem.initial_set,
146+
);
120147
color = :green,
121148
);
122149
plot!(
123-
SY.get_domain_from_symbols(abstract_system, abstract_problem.target_set);
150+
Dionysos.Symbolic.get_domain_from_symbols(abstract_system, abstract_problem.target_set);
124151
color = :red,
125152
);
126153

0 commit comments

Comments
 (0)