Sha256: 8e2fb79d74458636bdfec28ec37201919c222733e4b3fa070480e4067f6686a3

Contents?: true

Size: 601 Bytes

Versions: 1

Compression:

Stored size: 601 Bytes

Contents

#! /usr/bin/ruby
# coding: utf-8

# ==============================================================================
# 
# encoding: utf-8

require 'y_petri'
require 'sy'       # This pathway model uses 'sy' metrology domain model.
require 'mathn'    # Standard library 'mathn' is required.
include YPetri     # pull in the DSL

A = Place m!: 10
B = Place m!: 10
A2B = Transition s: { A: -1, B: 1 }, rate: 0.1
B2A = Transition s: { A: 1, B: -1 }, rate: 0.05

set_step 1 # in seconds
set_target_time 100
set_sampling 1
set_simulation_method :gillespie
sim = new_simulation guarded: false
run!

plot_state

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
y_petri-2.1.30 test/examples/gillespie.rb