Skip to content

Commit

Permalink
let guard be implemented using the assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
mforets committed Feb 8, 2019
1 parent b1a556f commit a4d11da
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/HybridSystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,24 @@ Returns the set of allowed states of the system at mode `u`.
"""
MathematicalSystems.stateset(hs::HybridSystem, u::Int) = stateset(hs.modes[u])

"""
assignment(hs::HybridSystem, t)
Returns the assignment for the transition `t`.
"""
assignment(hs::HybridSystem, t) = hs.resetmaps[symbol(hs, t)]

"""
guard(hs::HybridSystem, t)
Returns the guard for the transition `t`.
"""
guard(hs::HybridSystem, t) = stateset(hs.resetmaps[symbol(hs, t)])
guard(hs::HybridSystem, t) = stateset(assignment(hs, t))

# for completeness, extend the stateset function from MathematicalSystems
# because guards are given as the state constraints of the reset map
MathematicalSystems.stateset(hs::HybridSystem, t) = guard(hs, t)

"""
assignment(hs::HybridSystem, t)
Returns the assignment for the transition `t`.
"""
assignment(hs::HybridSystem, t) = hs.resetmaps[symbol(hs, t)]

"""
inputdim(s::AbstractSystem, u::Int)
Expand Down

0 comments on commit a4d11da

Please sign in to comment.