Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let continuous post return input options #539

Merged
merged 1 commit into from
Mar 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/ReachSets/ContinuousPost/BFFPSV18/BFFPSV18.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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(𝑆, 𝑂)
Expand All @@ -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")
Expand All @@ -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])")
Expand Down
1 change: 1 addition & 0 deletions test/Reachability/solve_continuous.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down