Class: Wrnap::Package::Population
- Defined in:
- lib/wrnap/package/population.rb
Defined Under Namespace
Classes: PopulationProportion
Constant Summary collapse
- THREE_COLUMN_REGEX =
/^([+-]\d+\.\d+\t){2}[+-]\d+\.\d+$/
Instance Attribute Summary collapse
-
#equilibrium ⇒ Object
readonly
Returns the value of attribute equilibrium.
-
#str_1_to_str_1 ⇒ Object
readonly
Returns the value of attribute str_1_to_str_1.
-
#str_1_to_str_2 ⇒ Object
readonly
Returns the value of attribute str_1_to_str_2.
Attributes inherited from Base
#data, #flags, #response, #runtime
Instance Method Summary collapse
Methods inherited from Base
bootstrap, #debugger, #initialize, #inspect, #serialize
Methods included from Global::Chainer
Methods included from Global::Runner
Constructor Details
This class inherits a constructor from Wrnap::Package::Base
Instance Attribute Details
#equilibrium ⇒ Object (readonly)
Returns the value of attribute equilibrium.
6 7 8 |
# File 'lib/wrnap/package/population.rb', line 6 def equilibrium @equilibrium end |
#str_1_to_str_1 ⇒ Object (readonly)
Returns the value of attribute str_1_to_str_1.
6 7 8 |
# File 'lib/wrnap/package/population.rb', line 6 def str_1_to_str_1 @str_1_to_str_1 end |
#str_1_to_str_2 ⇒ Object (readonly)
Returns the value of attribute str_1_to_str_2.
6 7 8 |
# File 'lib/wrnap/package/population.rb', line 6 def str_1_to_str_2 @str_1_to_str_2 end |
Instance Method Details
#post_process ⇒ Object
84 85 86 87 88 89 90 91 92 |
# File 'lib/wrnap/package/population.rb', line 84 def post_process if flags.include?("-spectral-e") @equilibrium = 10 ** response.strip.to_f else time_points, str_1_to_str_2, str_1_to_str_1 = response.split(/\n/).select { |line| line =~ THREE_COLUMN_REGEX }.map { |line| line.split(/\t/).map(&:to_f) }.transpose @str_1_to_str_2 = PopulationProportion.new(time_points, str_1_to_str_2) @str_1_to_str_1 = PopulationProportion.new(time_points, str_1_to_str_1) end end |