class Exchange
  attr_accessor :description, :cycles, :weight, :two_way_exchanges, :three_way_exchanges, :total_transplants, :optimal
  attr_reader :effective_two_ways

  def initialize(description, weight, two_way_exchanges, three_way_exchanges, total_transplants, cycles)
    @description = description;
    @cycles = cycles
    @weight = weight
    @two_way_exchanges = two_way_exchanges
    @three_way_exchanges = three_way_exchanges
    @total_transplants = total_transplants
    @effective_two_ways = get_effective_two_ways
  end

  def get_effective_two_ways
    count = 0
    @cycles.each { |cycle| count += 1 if cycle.any_back_arcs?}
    count + @two_way_exchanges
  end
end