module YPetri::Simulation::TransitionRepresentation::Type_T

Public Instance Methods

T?() click to toggle source

True for timed transitions.

# File lib/y_petri/simulation/transition_representation/T.rb, line 11
def T?
  true
end
Also aliased as: timed?
d(Δt) click to toggle source

Change, for free places, as it would happen if the transition fired for time Δt, returned as hash codomain place names >> change.

# File lib/y_petri/simulation/transition_representation/T.rb, line 61
def d Δt
  delta( Δt ).with_keys do |p| p.name || p end
end
d_all( Δt ) click to toggle source

Change, for all places, as it would happen if the transition fired for time Δt, returned as hash codomain place names >> change.

# File lib/y_petri/simulation/transition_representation/T.rb, line 76
def d_all( Δt )
  delta( Δt ).with_keys do |p| p.name || p end
end
delta(Δt) click to toggle source

Change, for free places, as it would happen if the transition fired for time Δt, returned as hash codomain places >> change.

# File lib/y_petri/simulation/transition_representation/T.rb, line 54
def delta Δt
  gradient.with_values { |v| v * Δt }
end
delta_all( Δt )
Alias for: Δ
g() click to toggle source

Returns the gradient contribution to the free places, as hash place names >> gradient contribution.

# File lib/y_petri/simulation/transition_representation/T.rb, line 40
def g
  gradient.with_keys do |p| p.name || p end
end
g_all() click to toggle source

Returns the gradient contribution to all the places, as hash place names >> gradient contribution.

# File lib/y_petri/simulation/transition_representation/T.rb, line 47
def g_all
  .with_keys do |p| p.name || p end
end
gradient() click to toggle source

Gradient contribution of the transition to the free places.

# File lib/y_petri/simulation/transition_representation/T.rb, line 33
def gradient
  .select { |p, v| p.free? }
end
init() click to toggle source

Initialization subroutine.

# File lib/y_petri/simulation/transition_representation/T.rb, line 25
def init
  simulation.extend YPetri::Simulation::Timed unless simulation.timed?
  super
  @function = source.rate_closure
end
t?() click to toggle source

False for timed transitions.

# File lib/y_petri/simulation/transition_representation/T.rb, line 18
def t?
  false
end
Also aliased as: timeless?
timed?()
Alias for: T?
timeless?()
Alias for: t?
Δ( Δt ) click to toggle source

Change, for all places, as it would happen if the transition fired for time Δt, returned as hash codomain places >> change.

# File lib/y_petri/simulation/transition_representation/T.rb, line 68
def Δ( Δt )
  gradient.with_values { |v| v * Δt }
end
Also aliased as: delta_all