Sha256: 8e88dc2339d1c471cf929af7daddfdfb564951054bec6716243728735289ae31

Contents?: true

Size: 781 Bytes

Versions: 36

Compression:

Stored size: 781 Bytes

Contents

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

gem 'minitest', '=4.7.4'
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

36 entries across 36 versions & 1 rubygems

Version Path
y_petri-2.2.2 test/acceptance/basic_usage_test.rb
y_petri-2.2.1 test/acceptance/basic_usage_test.rb
y_petri-2.2.0 test/acceptance/basic_usage_test.rb
y_petri-2.1.51 test/acceptance/basic_usage_test.rb
y_petri-2.1.50 test/acceptance/basic_usage_test.rb
y_petri-2.1.49 test/acceptance/basic_usage_test.rb
y_petri-2.1.48 test/acceptance/basic_usage_test.rb
y_petri-2.1.47 test/acceptance/basic_usage_test.rb
y_petri-2.1.46 test/acceptance/basic_usage_test.rb
y_petri-2.1.45 test/acceptance/basic_usage_test.rb
y_petri-2.1.44 test/acceptance/basic_usage_test.rb
y_petri-2.1.42 test/acceptance/basic_usage_test.rb
y_petri-2.1.40 test/acceptance/basic_usage_test.rb
y_petri-2.1.39 test/acceptance/basic_usage_test.rb
y_petri-2.1.37 test/acceptance/basic_usage_test.rb
y_petri-2.1.36 test/acceptance/basic_usage_test.rb
y_petri-2.1.35 test/acceptance/basic_usage_test.rb
y_petri-2.1.34 test/acceptance/basic_usage_test.rb
y_petri-2.1.33 test/acceptance/basic_usage_test.rb
y_petri-2.1.31 test/acceptance/basic_usage_test.rb