Sha256: 843320c1b0279e2f2ab945beb9a8f30a1466c4e83126f4a72053ec3506f00427

Contents?: true

Size: 514 Bytes

Versions: 6

Compression:

Stored size: 514 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 :basic

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!
recording.plot

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
y_petri-2.4.9 test/examples/manual_examples.rb
y_petri-2.4.8 test/examples/manual_examples.rb
y_petri-2.4.6 test/examples/manual_examples.rb
y_petri-2.4.4 test/examples/manual_examples.rb
y_petri-2.4.3 test/examples/manual_examples.rb
y_petri-2.4.2 test/examples/manual_examples.rb