Curvature regulators #80

Merged
glen merged 21 commits from Vectornaut/dyna3:curvature-regulators into main 2025-04-21 23:40:43 +00:00

21 commits

Author SHA1 Message Date
Aaron Fenyes
5eeb0935ca Change conditional panic to expect
All checks were successful
/ test (pull_request) Successful in 2m21s
Use `expect` to communicate that every element should have a column
index when `pose` is called. Rewrite the panic messages in the style
recommended by the `expect` documentation.
2025-04-21 14:47:26 -07:00
Aaron Fenyes
99a9c3ec55 Flag regulator update logging as debug
All checks were successful
/ test (pull_request) Successful in 2m19s
2025-04-17 21:31:24 -07:00
Aaron Fenyes
5506ec1f43 Make regulator activation less redundant 2025-04-17 21:25:22 -07:00
Aaron Fenyes
8dab223f6a Use field init shorthand in regulator constructors 2025-04-17 21:00:24 -07:00
Aaron Fenyes
620a6be918 Make regulator naming more consistent
All checks were successful
/ test (pull_request) Successful in 2m27s
Although the inversive distance regulator mostly acts as a general
Lorentz product regulator, calling it `InversiveDistanceRegulator`
explains how we intend to use it and demonstrates our naming convention.
2025-04-17 14:40:28 -07:00
Aaron Fenyes
7f21e7e999 Centralize the curvature component index constant
All checks were successful
/ test (pull_request) Successful in 2m25s
2025-04-17 14:16:54 -07:00
Aaron Fenyes
52d99755f9 Give each regulator a constructor
The assembly shouldn't have to know how to construct regulators.
2025-04-17 14:10:07 -07:00
Aaron Fenyes
8f8e806d12 Move pointer creation into insert_regulator
This will make it easier to give each regulator a constructor instead of
an "insert new" method.
2025-04-17 14:02:37 -07:00
Aaron Fenyes
ee8a01b9cb Let regulators handle their own activation
This improves code organization at the cost of a little redundancy: the
default implementation of `activate` doesn't do anything, and its
implementation for `HalfCurvatureRegulator` redundantly accesses the
set point signal and checks whether the regulator is set.
2025-04-17 13:20:50 -07:00
Aaron Fenyes
955220c0bc Shadow storage variable with builder variable
All checks were successful
/ test (pull_request) Successful in 2m24s
2025-04-15 23:49:07 -07:00
Aaron Fenyes
4654bf06bf Move half-curvature change routine into engine
This routine is implemented in a very representation-specific way, so
the engine seems like the best place for it.
2025-04-15 23:44:35 -07:00
Aaron Fenyes
e1952d7d52 Clear the regulator list when switching examples
All checks were successful
/ test (pull_request) Successful in 2m21s
2025-04-10 12:14:37 -07:00
Aaron Fenyes
81e423fcbe Give every sphere a curvature regulator
All checks were successful
/ test (pull_request) Successful in 2m24s
In the process, fix a reactivity bug by removing unintended signal
tracking from `insert_regulator`.
2025-04-08 18:49:48 -07:00
Aaron Fenyes
63e3d733ba Introduce a problem poser trait
Elements and regulators use this common interface to write their data
into the constraint problem.
2025-04-03 14:13:45 -07:00
Aaron Fenyes
bba0ac3cd6 Add a half-curvature regulator
In the process, add the `OutlineItem` trait so that each regulator can
implement its own outline item view.
2025-04-03 11:38:18 -07:00
Aaron Fenyes
d57ff59730 Specify the values of the frozen entries
Before, a `ConstraintProblem` only specified the indices of the frozen
entries. During realization, the frozen entries kept whatever values
they had in the initial guess.

This commit adds the values of the frozen entries to the `frozen` field
of `ConstraintProblem`. The frozen entries of the guess are set to the
desired values at the beginning of realization.

This commit also improves the `PartialMatrix` structure, which is used
to specify the indices and values of the frozen entries.
2025-04-03 11:38:18 -07:00
Aaron Fenyes
96e4a34fa1 Interpolate sphere ID and label, as intended
Thanks, Clippy!
2025-04-03 11:38:18 -07:00
Aaron Fenyes
126d4c0cce Introduce a regulator trait
This will provide a common interface for Lorentz product regulators,
curvature regulators, and hopefully all the other regulators too.
2025-04-03 11:38:18 -07:00
Aaron Fenyes
00f60b0e90 Store a product regulator's subjects in an array
This lets us iterate over subjects. Based on commit 257ce33, with a few
updates from 4a9e777.
2025-04-03 11:38:18 -07:00
Aaron Fenyes
7c40d60103 Let the elements and regulators write the problem
When we realize an assembly, each element and regulator now writes its
own data into the constraint problem.
2025-04-03 11:38:18 -07:00
Aaron Fenyes
bb226c5f45 Encapsulate the constraint problem data
This will make it easier for elements and regulators to write themselves
into the constraint problem.
2025-04-03 11:38:18 -07:00