Method: YPetri::Net::State::Feature.Gradient

Defined in:
lib/y_petri/net/state/feature.rb

.Gradient(id = L!, , transitions: net.T_tt) ⇒ Object

Gradient feature constructor. Takes a single ordered argument, which must identify a place, and an optional named argument :transitions, which must contain an array of T transition identifyers (gradient is defined as time derivative, so timeless transitions are not eligible). If not given, the gradient feature is constructed with respect to all net’s T transitions.



59
60
61
62
63
64
65
66
67
68
# File 'lib/y_petri/net/state/feature.rb', line 59

def Gradient id=L!, transitions: net.T_tt
  return @Gradient if id.local_object?
  case id
  when Gradient() then id
  when Gradient then
    Gradient().of( id.place, transitions: id.transitions )
  else
    Gradient().of( id, transitions: transitions ) # assume place
  end
end