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

#397 - constrained_dimensions #398

Merged
merged 7 commits into from
Jan 22, 2019
Merged
Changes from 5 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
25 changes: 25 additions & 0 deletions src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,31 @@ function solve(system::InitialValueProblem{<:HybridSystem, <:LazySet{N}},
return solve!(sys_new, copy(options), opC, opD)
end


"""
get_necessary_vars(HS::HybridSystem)::Dict{Int,Vector{Int}}

Return all coordinates which appear in any guard or invariant constraint for each location.

### Input

- `HS` -- hybrid system
"""
function get_necessary_vars(HS::HybridSystem)::Dict{Int,Vector{Int}}
result = Dict{Int,Vector{Int}}()
schillic marked this conversation as resolved.
Show resolved Hide resolved
for mode in states(HS)
vars = Vector{Int}()
append!(vars, constrained_dimensions(stateset(HS, mode)))
for transition in out_transitions(HS, mode)
append!(vars, constrained_dimensions(stateset(HS, transition)))
end
result[mode] = unique(vars)
end

return result
end


function init_states_sys_from_init_set_sys(
system::InitialValueProblem{<:HybridSystem, <:LazySet{N}}) where N<:Real
HS = system.s
Expand Down