class Grimoire::UnitScoreKeeper

Public Instance Methods

preferred_score() click to toggle source

Define meaning of score by what should be preferred. This is used by the solver to apply correct sorting to the queues.

@return [Symbol] :lowscore or :highscore

# File lib/grimoire/unit_score_keeper.rb, line 10
def preferred_score
  :lowscore
end
score_for(unit, idx, opts={}) click to toggle source

Provide score for given unit

@param unit [Unit] @param idx [Integer] current order index @param opts [Hash] extra options @option opts [Solver] :solver solver requesting score @return [Numeric]

# File lib/grimoire/unit_score_keeper.rb, line 21
def score_for(unit, idx, opts={})
  raise NotImplementedError.new 'No scoring has been defined'
end