Objectives¶
COPP objective constructors are lightweight Python-owned descriptors. Solver wrappers borrow them only for one native solver call, so the descriptors can be reused across repeated problem builds.
Objective constructors for COPP solvers.
Use as copp.objective.Time(...) after import copp_py as copp.
TOPP solvers minimize traversal time directly. COPP solvers accept one objective or a list of objective descriptors and optimize their weighted sum. The built-in descriptors are:
Time(weight)for traversal-time cost.ThermalEnergy(weight, normalize)for torque-energy style cost.TotalVariationTorque(weight, normalize)for torque variation.Linear(weight, alpha, beta)for direct coefficients on profile variables.
For second-order COPP, alpha is node-based and beta is interval-based.
For third-order COPP, both arrays are node-based. Solver-side validation checks
the active length contract.
- class copp_py.objective.Linear(weight, alpha, beta)¶
Bases:
objectLinear objective over profile variables.
In COPP2, alpha is node-based with length s_len, while beta is interval-based with length s_len - 1. In COPP3, both arrays are node-based with length s_len; Rust objective validation enforces the active solver’s length contract.
- alpha¶
Return the a coefficient array.
- beta¶
Return the b coefficient array.
- weight¶
Return the objective weight.
- class copp_py.objective.ThermalEnergy(weight, normalize)¶
Bases:
objectThermal-energy objective.
- normalize¶
Return the per-axis torque normalization.
- weight¶
Return the objective weight.