class Montecasting::Forecasting
Here will place all those method to generate forecasting charts
Public Class Methods
montecarlo(takt_times = [], backlog_items = 1, days_iteration = 1)
click to toggle source
# File lib/montecasting.rb, line 55 def self.montecarlo(takt_times = [], backlog_items = 1, days_iteration = 1) return nil unless takt_times.all? Numeric takt_times.map {|tt| ((tt * backlog_items) / days_iteration).round(0)}.sort end
takt_times(cycle_time = [], rand_generator = 1000)
click to toggle source
# File lib/montecasting.rb, line 49 def self.takt_times(cycle_time = [], rand_generator = 1000) return nil unless cycle_time.all? Numeric result = Matrix.build(rand_generator, cycle_time.count) {cycle_time.at(rand(0...cycle_time.count))} result.row_vectors.map {|r| (r.inject(:+).to_f / cycle_time.count).round(2)} end