blegat / HybridSystems.jl

Hybrid Systems definitions in Julia
Other
28 stars 5 forks source link

Add getter function for assignments #20

Closed mforets closed 5 years ago

mforets commented 5 years ago

Proposal: add "assignment" function as the getter function for reset maps:

assignment(hs::HybridSystem, t) = hs.resetmaps[symbol(hs, t)]

Note. If we add "ConstrainedMap" as proposed MathematicalSystems#60, then it is implemented as

assignment(hs::HybridSystem, t) = hs.resetmaps[symbol(hs, t)].map

Either way, i think it is useful to add this function because it is less implementation-dependent.

schillic commented 5 years ago

The first one is confusing because it does not give you the assignment. The second one is fine as long as you dispatch on the type of resetmaps such that you know that there is a map field.