Class: Gecode::Constraint

Inherits:
Object
  • Object
show all
Defined in:
lib/gecoder/interface/constraints.rb

Overview

Base class for all constraints.

Instance Method Summary collapse

Constructor Details

#initialize(model, params) ⇒ Constraint

Creates a constraint with the specified parameters, bound to the specified model.



216
217
218
219
# File 'lib/gecoder/interface/constraints.rb', line 216

def initialize(model, params)
  @model = model
  @params = params.clone
end

Instance Method Details

#postObject

Posts the constraint, adding it to the model. This is an abstract method and should be overridden by all sub-classes.

Raises:

  • (NotImplementedError)


223
224
225
# File 'lib/gecoder/interface/constraints.rb', line 223

def post
  raise NotImplementedError, 'Abstract method has not been implemented.'
end