lib/y_petri/net/state/feature/flux.rb in y_petri-2.2.4 vs lib/y_petri/net/state/feature/flux.rb in y_petri-2.3.2

- old
+ new

@@ -15,11 +15,11 @@ case id when self then hsh[ id.transition ] when ç.net.Transition then t = begin - ç.net.TS_transitions( [ id ] ).first + ç.net.TS_transitions( id ).first rescue TypeError => err msg = "Transition #{id} not " + "recognized as TS transition in " + "net #{ç.net}! (%s)" raise TypeError, msg % err @@ -58,11 +58,11 @@ # typically a simulation instance. # def extract_from arg, **nn case arg when YPetri::Simulation then - arg.send( :TS_transitions, [ transition ] ).first.flux + arg.send( :TS_transitions, transition ).first.flux else fail TypeError, "Argument type not supported!" end end @@ -86,7 +86,14 @@ # Inspect string of the flux feature. # def inspect "<Feature::Flux of #{transition.name ? transition.name : transition}>" + end + + # Flux features are equal if they are of equal PS and refer to the + # same transition. + # + def == other + other.is_a? net.State.Feature.Flux and transition == other.transition end end # class YPetri::Net::State::Feature::Flux