Sha256: 0a777fb285acbc3b470caa0a325e8d3fb742db41ddd2e06c158289c48fb46e37

Contents?: true

Size: 520 Bytes

Versions: 11

Compression:

Stored size: 520 Bytes

Contents

#encoding: utf-8

require 'y_petri'
include YPetri
require 'sy'
require 'mathn'

set_step 10
set_target_time 600
set_sampling 10
# Euler with timeless transitions firing after each step:
set_simulation_method :PseudoEuler

A = Place m!: 1
B = Place m!: 10
C = Place m!: 0

Transition name: :B_disappearing,
           s: { B: -1 },
           action: -> m {  m >= 1 ? 1 : 0 }

Transition name: :C_held_at_half_B,
           domain: :B,
           codomain: :C,
           assignment: -> x { x / 2 }

run!
plot_recording

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
y_petri-2.4.0 test/examples/manual_examples.rb
y_petri-2.3.12 test/examples/manual_examples.rb
y_petri-2.3.11 test/examples/manual_examples.rb
y_petri-2.3.10 test/examples/manual_examples.rb
y_petri-2.3.9 test/examples/manual_examples.rb
y_petri-2.3.8 test/examples/manual_examples.rb
y_petri-2.3.6 test/examples/manual_examples.rb
y_petri-2.3.5 test/examples/manual_examples.rb
y_petri-2.3.4 test/examples/manual_examples.rb
y_petri-2.3.3 test/examples/manual_examples.rb
y_petri-2.3.2 test/examples/manual_examples.rb