Example #1
0
    def initialize(self, constraints):
        """ Initializes the solver by creating all of the necessary 
        constraints for this components layout children and adding them
        to the solver.

        Parameters
        ----------
        constraints : Iterable
            An iterable that yields the constraints to add to the
            solvers.

        """
        self._initialized = False
        self._solver = solver = Solver(autosolve=False)
        for cn in constraints:
            solver.add_constraint(cn)
        solver.autosolve = True
        self._initialized = True
Example #2
0
 def __init__(self):
     self._solver = Solver(autosolve=False)
     self._initialized = False
     self._running = False