class Problem::FSP::Production

Inner class who represents the production schedule, that is, a matrix were the rows are the tasks and the columns the machines.

Attributes

schedule[R]

Public Instance Methods

build_from_file(path, transpose) click to toggle source

Fill the schedule reading the an instance from a file

# File lib/opt_alg_framework/problem/fsp.rb, line 16
def build_from_file(path, transpose)
  rows = Array.new
  File.foreach(path).each do |line|
    rows << line.split(" ").collect{ |e| e.to_i }
  end
  @schedule = transpose ? Matrix.rows(rows).transpose : Matrix.rows(rows)
end
reorder_schedule(tasks_sequence) click to toggle source

Given a sequence of tasks, reorder the schedule in this sequence

# File lib/opt_alg_framework/problem/fsp.rb, line 25
def reorder_schedule(tasks_sequence)
  rows = Array.new
  tasks_sequence.each do |task|
    rows << @schedule.row(task)
  end
  Matrix.rows(rows)
end