DIRECTORY HerculesStorage USING [PointList, ConstrList]; HerculesSolver: DEFINITIONS = BEGIN OPEN Stor: HerculesStorage; PointList: TYPE = Stor.PointList; ConstrList: TYPE = Stor.ConstrList; displayingMotions: PUBLIC BOOL; Solve: PROC [points: PointList, constrs: ConstrList] RETURNS [success, impossible: BOOLEAN] -- Attempts to satisfy the given constraints by adjusting the positions of the given points -- while keeping all other points fixed. -- Uses the Newton-raphson method. Iterates the latter until -- (a) no point changes position (after rounding to integer coordinates), or -- (b) all constraints are found to be satisfied, or -- (c) it concludes it is impossible to satisfy them all, or -- (d) 20 iterations have been performed. -- Returns impossible=TRUE in case (c), and success=TRUE in cases (a) and (b). END. HerculesSolver.mesa (ex OldJunoSolver.mesa) Last Edited by: Stolfi, February 14, 1984 11:25 pm Edited on February 1, 1984 6:38 pm, by Stolfi -- Added Tioga formatting changes to: Solve (added impossible return parameter; comments reflect new semantics) Edited on February 4, 1984 0:24 am, by Stolfi -- Added Tioga formatting changes to: displayingMotions (new in this interface), Solve (added constraints parameter - requires changes in JunoStorage!) Edited on February 7, 1984 7:16 pm, by Stolfi -- Renamed to herculesSolver changes to: Solve (fixed parameters) Edited on February 10, 1984 6:49 am, by Stolfi changes to: Solve (fixed parameters) Edited on February 10, 1984 6:49 am, by Stolfi changes to: Solve (added points and constraints as parameter, removed epsilon) Ê!˜Jšœ,™,J™3JšÏk œœ˜;J˜Jšœ œ˜šœœ˜#Jšœ œ˜"Jšœ œ˜$JšÏbœœœ˜ JšÏnœœ*œœÏcÃÐcr ¡  œ˜æ—Jšœ˜™-Jšœ™Jšœ Ïrœ¢ œ2™U—J™™-Jšœ™Jšœ ¢œ¢œ¢ œ.™}—J™™-Jšœ™Jšœ ¢œ™$—J™™.Jšœ ¢œ™$—J™™.Jšœ ¢œ=™N—J˜—…—X‹