From 45d01f94400c7dc74a6409bbcf1476c27b373bcb Mon Sep 17 00:00:00 2001 From: schillic Date: Wed, 13 Mar 2019 20:18:46 +0100 Subject: [PATCH] return input options from post --- src/ReachSets/ContinuousPost/BFFPSV18/BFFPSV18.jl | 10 +++++----- test/Reachability/solve_continuous.jl | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ReachSets/ContinuousPost/BFFPSV18/BFFPSV18.jl b/src/ReachSets/ContinuousPost/BFFPSV18/BFFPSV18.jl index baa0a32a..cb0117da 100644 --- a/src/ReachSets/ContinuousPost/BFFPSV18/BFFPSV18.jl +++ b/src/ReachSets/ContinuousPost/BFFPSV18/BFFPSV18.jl @@ -244,8 +244,8 @@ Calculate the reachable states of the given initial value problem using `BFFPSV1 - `invariant` -- constraint invariant on the mode - `𝑂` -- algorithm-specific options """ -function post(𝒫::BFFPSV18, 𝑆::AbstractSystem, invariant, 𝑂::Options) - 𝑂 = TwoLayerOptions(merge(𝑂, 𝒫.options.specified), 𝒫.options.defaults) +function post(𝒫::BFFPSV18, 𝑆::AbstractSystem, invariant, 𝑂_input::Options) + 𝑂 = TwoLayerOptions(merge(𝑂_input, 𝒫.options.specified), 𝒫.options.defaults) # convert matrix system = matrix_conversion(𝑆, 𝑂) @@ -265,7 +265,7 @@ function post(𝒫::BFFPSV18, 𝑆::AbstractSystem, invariant, 𝑂::Options) RsetsProj = Rsets end - return ReachSolution(RsetsProj, 𝑂) + return ReachSolution(RsetsProj, 𝑂_input) elseif 𝑂[:mode] == "check" info("invariants are currently not supported in 'check' mode") @@ -284,11 +284,11 @@ function post(𝒫::BFFPSV18, 𝑆::AbstractSystem, invariant, 𝑂::Options) if answer == 0 info("The property is satisfied!") - return CheckSolution(true, -1, 𝑂) + return CheckSolution(true, -1, 𝑂_input) else info("The property may be violated at index $answer," * " (time point $(answer * 𝑂[:δ]))!") - return CheckSolution(false, answer, 𝑂) + return CheckSolution(false, answer, 𝑂_input) end else error("unsupported mode $(𝑂[:mode])") diff --git a/test/Reachability/solve_continuous.jl b/test/Reachability/solve_continuous.jl index 546a2fce..21b13f28 100644 --- a/test/Reachability/solve_continuous.jl +++ b/test/Reachability/solve_continuous.jl @@ -14,6 +14,7 @@ X0 = BallInf(ones(4), 0.1) # default options (computes all variables) s = solve(IVP(LCS(A), X0), :T=>0.1) @test dim(s.Xk[1].X) == 4 +@test s.options isa Options # two variables and custom partition s = solve(IVP(LCS(A), X0),