Class: NoSE::Search::IndexPresenceConstraints
- Inherits:
-
Constraint
- Object
- Constraint
- NoSE::Search::IndexPresenceConstraints
- Defined in:
- lib/nose/search/constraints.rb
Overview
Constraints which force indexes to be present to be used
Class Method Summary collapse
-
.apply(problem) ⇒ Object
Add constraint for indices being present.
Methods inherited from Constraint
Class Method Details
.apply(problem) ⇒ Object
Add constraint for indices being present
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/nose/search/constraints.rb', line 24 def self.apply(problem) problem.indexes.each do |index| problem.queries.each_with_index do |query, q| name = "q#{q}_#{index.key}_avail" if ENV['NOSE_LOG'] == 'debug' constr = MIPPeR::Constraint.new problem.query_vars[index][query] + problem.index_vars[index] * -1, :<=, 0, name problem.model << constr end end end |