Sha256: b739c3ab7d4fcd63c0b403ad90a10dbe22130d420702630eba14b483793d136d

Contents?: true

Size: 756 Bytes

Versions: 19

Compression:

Stored size: 756 Bytes

Contents

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

require 'minitest/autorun'
require_relative '../../lib/y_petri'     # tested component itself
# require 'y_petri'
# require 'sy'

describe "Basic use of TimedSimulation" do
  before do
    @m = YPetri::Agent.new
    @m.Place( name: "A", default_marking: 0.5 )
    @m.Place( name: "B", default_marking: 0.5 )
    @m.Transition( name: "A_pump",
                   stoichiometry: { A: -1 },
                   rate: proc { 0.005 } )
    @m.Transition( name: "B_decay",
                   stoichiometry: { B: -1 },
                   rate: 0.05 )
  end

  it "should work" do
    @m.net.must_be_kind_of ::YPetri::Net
    @m.run!
    @m.simulation.must_be_kind_of ::YPetri::Simulation
    @m.plot_state
    sleep 3
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
y_petri-2.4.9 test/acceptance/basic_usage_test.rb
y_petri-2.4.8 test/acceptance/basic_usage_test.rb
y_petri-2.4.6 test/acceptance/basic_usage_test.rb
y_petri-2.4.4 test/acceptance/basic_usage_test.rb
y_petri-2.4.3 test/acceptance/basic_usage_test.rb
y_petri-2.4.2 test/acceptance/basic_usage_test.rb
y_petri-2.4.0 test/acceptance/basic_usage_test.rb
y_petri-2.3.12 test/acceptance/basic_usage_test.rb
y_petri-2.3.11 test/acceptance/basic_usage_test.rb
y_petri-2.3.10 test/acceptance/basic_usage_test.rb
y_petri-2.3.9 test/acceptance/basic_usage_test.rb
y_petri-2.3.8 test/acceptance/basic_usage_test.rb
y_petri-2.3.6 test/acceptance/basic_usage_test.rb
y_petri-2.3.5 test/acceptance/basic_usage_test.rb
y_petri-2.3.4 test/acceptance/basic_usage_test.rb
y_petri-2.3.3 test/acceptance/basic_usage_test.rb
y_petri-2.3.2 test/acceptance/basic_usage_test.rb
y_petri-2.2.4 test/acceptance/basic_usage_test.rb
y_petri-2.2.3 test/acceptance/basic_usage_test.rb