parameter
Parameter
¶
Bases: Leaf
Parameter that can be changed at runtime without recompilation.
Parameters are symbolic variables with initial values that can be updated through the problem's parameter dictionary. They allow for efficient parameter sweeps without needing to recompile the optimization problem.
Example
obs_center = ox.Parameter("obs_center", shape=(3,), value=np.array([1.0, 0.0, 0.0]))
Later: problem.parameters["obs_center"] = new_value¶
Source code in openscvx/symbolic/expr/parameter.py
__init__(name: str, shape: tuple = (), value: Union[float, int, np.ndarray, None] = None)
¶
Initialize a Parameter node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name identifier for the parameter |
required |
shape
|
tuple
|
Shape of the parameter (default: scalar) |
()
|
value
|
Union[float, int, ndarray, None]
|
Initial value for the parameter (required) |
None
|
Source code in openscvx/symbolic/expr/parameter.py
ParameterSpec
¶
Bases: BaseModel
Validates Parameter configuration from YAML/JSON/dict input.