| 2 | | This module contains several flavors of constraint solver classes. |
|---|
| 3 | | Each has a method solve_for(name) and a method set(\*\*kwds). These methods |
|---|
| 4 | | are used by the constraint solver (solver.Solver) to set the variables. |
|---|
| 5 | | |
|---|
| 6 | | Variables should be of type solver.Variable. |
|---|
| 7 | | |
|---|
| 8 | | Available constraints are: |
|---|
| 9 | | |
|---|
| 10 | | - EqualsConstraint - make 'a' and 'b' equal |
|---|
| 11 | | - LessThanConstraint - ensure one variable stays smaller than the orther |
|---|
| 12 | | - EquationConstraint - solve a linear equation |
|---|
| 13 | | |
|---|
| 14 | | # TODO: |
|---|
| 15 | | |
|---|
| 16 | | - LineConstraint - Solves the equation where a line is connected to |
|---|
| 17 | | a line or side at a specific point. |
|---|
| 18 | | - LineToCenterConstraint - constraint to be used when a line connects |
|---|
| 19 | | to a rectangular element. The line is connected on the side, but |
|---|
| 20 | | keeps opointing to the center |
|---|
| 21 | | - ShortestLineConstraint - The last segment of the line is pointing to |
|---|
| 22 | | a rectangualar or line like object and the length of the line |
|---|
| 23 | | is kept to a minimum |
|---|
| | 2 | Module ``gaphas.constraint`` contains several flavors of constraint solver |
|---|
| | 3 | classes (constraints for short), for example |
|---|
| | 4 | - equality constraint - two variables should have the same value |
|---|
| | 5 | - less than constraint - keep one variables smaller than other |
|---|
| | 6 | |
|---|
| | 7 | Variables should be of type ``gaphas.solver.Variable``. |
|---|
| | 8 | |
|---|
| | 9 | See classes' documentation below for constraints description and for |
|---|
| | 10 | examples of their usage. |
|---|
| | 11 | |
|---|
| | 12 | New constraint class should derive from Constraint class abstract class and |
|---|
| | 13 | implement Constraint.solve_for(Variable) method to update a variable with |
|---|
| | 14 | appropriate value. |
|---|