class Modelling::Species

Species class

Attributes

initial[RW]
matlab_no[RW]
name[RW]

Public Class Methods

new(name, initial = nil, matlab_no = nil) click to toggle source
# File lib/modelling/species.rb, line 12
def initialize(name, initial = nil, matlab_no = nil)
    @name = name || "species_#{@@insts}"
    @initial = initial || 0.0
    if matlab_no.nil?
        @matlab_no = @@insts
    else
        @matlab_no = matlab_no
    end
    @@insts+= 1
end

Public Instance Methods

to_s() click to toggle source
# File lib/modelling/species.rb, line 32
def to_s
    "#{@name} (init: #{@initial})"
end
to_sbml() click to toggle source

write SBML

# File lib/modelling/species.rb, line 24
def to_sbml
    e = REXML::Element::new 'species'
    e.add_attribute('name', @name)
    e.add_attribute('initialAmount', @initial)
    e.add_attribute('compartment', 'default')
    e
end