diff --git a/docs/src/lib/methods.md b/docs/src/lib/methods.md index 943a1e3..5b28e4d 100644 --- a/docs/src/lib/methods.md +++ b/docs/src/lib/methods.md @@ -56,8 +56,9 @@ in_transitions out_transitions ``` -### Guards +### Guards and Assignments ```@docs guard +assignment ``` diff --git a/src/HybridSystems.jl b/src/HybridSystems.jl index 0d29999..ba2b89c 100644 --- a/src/HybridSystems.jl +++ b/src/HybridSystems.jl @@ -93,12 +93,19 @@ 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