| Home | Trees | Indices | Help |
|
|---|
|
|
Constraint solver allows to define constraint between two or more different variables and keep this constraint always true when one or more of the constrained variables change. For example, one may want to keep two variables always equal.
Variables change and at some point of time we want to make all constraints valid again. This process is called solving constraints.
Gaphas' solver allows to define constraints between Variable instances. Constraint classes are defined in gaphas.constraint module.
Every constraint contains list of variables and has to be registered in solver object. Variables change (Variable.dirty(), Solver.request_resolve() methods) and their constraints are marked by solver as dirty. To solve constraints, solver loops through dirty constraints and asks constraint for a variable (called weakest variable), which
(weakest variable invariants defined above)
Having weakest variable (constraint.Constraint.weakest() method) every constraint is being asked to solve itself (constraint.Constraint.solve_for() method) changing appropriate variables to make the constraint valid again.
Version: $Revision: 2093 $
| Classes | |
|
Variable Representation of a variable in the constraint solver. |
|
|
Projection Projections are used to convert values from one space to another, e.g. |
|
|
Solver Solve constraints. |
|
|
solvable Easy-to-use drop Variable descriptor. |
|
|
JuggleError Variable juggling exception. |
|
| Variables | |
EPSILON = 1e-010
|
|
VERY_WEAK = 0
|
|
WEAK = 10
|
|
NORMAL = 20
|
|
STRONG = 30
|
|
VERY_STRONG = 40
|
|
REQUIRED = 100
|
|
__test__ =
|
|
| Variables Details |
__test__
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0 on Mon Mar 03 08:52:21 2008 | http://epydoc.sourceforge.net |