| Home | Trees | Indices | Help |
|
|---|
|
|
This module contains several flavors of constraint classes. Each has a method Constraint.solve_for(name) and a method Constraint.mark_dirty(v). These methods are used by the constraint solver (solver.Solver) to set the variables.
Variables should be of type solver.Variable.
See classes' documentation below for constraints description and for examples of their usage.
New constraint class should derive from Constraint class abstract class and implement Constraint.solve_for(Variable) method to update a variable with appropriate value.
Version: $Revision: 1794 $
| Classes | |
|
Constraint Constraint base class. |
|
|
EqualsConstraint Constraint, which ensures that two arguments a and b are equal, for example >>> from solver import Variable >>> a, b = Variable(1.0), Variable(2.0) >>> eq = EqualsConstraint(a, b) >>> eq.solve_for(a) >>> a Variable(2, 20) >>> a.value = 10.8 >>> eq.solve_for(b) >>> b Variable(10.8, 20) |
|
|
CenterConstraint Simple Constraint, takes three arguments: 'a', 'b' and center. |
|
|
LessThanConstraint Ensure smaller is less than bigger. |
|
|
EquationConstraint Equation solver using attributes and introspection. |
|
|
BalanceConstraint Ensure that a variable v is between values specified by band and in distance proportional from band[0]. |
|
|
LineConstraint Ensure a point is kept on a line. |
|
| Variables | |
EPSILON = 1e-006
|
|
ITERLIMIT = 1000
|
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0 on Mon Mar 03 08:52:21 2008 | http://epydoc.sourceforge.net |