Closed mforets closed 4 years ago
In fact this is available combining out_transitions
and target
as shown below and it's probably the way to go. I still find it useful to have get_transition
though.
for t in out_transitions(a, 1)
println(target(a, t))
end
1
There may be several transitions.
You can get the unique edges with e = HybridSystems.edge_object(a, src, dst)
.
Then the transitions are [LightTransition(e, id) for id in a.Σ[e]]
. I agree that it would be nice to have a utility for that.
Thanks! I noticed that it is actually [LightTransition(e, id) for id in values(a.Σ[e])]
because a.Σ[e]
is a dictionary while LightTransition
's id
expects an Int
.
OTOH should the new function return an iterator? In that case i think that the implementation would be:
function get_transitions(A::LightAutomaton{GT, ET}, q, r) where {GT, ET}
e = edge_object(A, q, r)
LightTransitionIterator(A, [e])
end
Yes, that's even better :)
A function to return the transition associated to a pair of source / target modes is missing (or i didn't find it). Something like:
I'm assuming that there is only on transition between modes
i -> j
(or two if you swapj -> i
). Does the assumption hold? Otherwise,get_transition
should have an extra argument.