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

#20 - Add assignment as getter function of reset map #22

Merged
merged 2 commits into from
Feb 8, 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
3 changes: 2 additions & 1 deletion docs/src/lib/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ in_transitions
out_transitions
```

### Guards
### Guards and Assignments

```@docs
guard
assignment
```
9 changes: 8 additions & 1 deletion src/HybridSystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down