Class AI::CSP::Problem
In: ai/csp/problem.rb
Parent: Object

Problem

For modeling CSP problems in terms of variables (which have domains) and constraints over those variables.

See AI::CSP::Variable and AI::CSP::Constraint. Also, see AI::CSP for an overview and examples.

Methods

Attributes

constraints  [R] 
variables  [R] 

Public Class methods

Public Instance methods

one of:

  add_constraint(constraint)
  add_constraint(v1, v2, ...) {|a,b,..| ...}
  add_constraint(vname1, vname2. ...) {|a,b,...| ...}

Calls block with each constraint in the problem. If a variable is specified, restricts this to constraints involving that variable.

Calls provided block with each variable in the problem that is currently uninstantiated.

[Validate]