Runtime TargetSpec
class TargetSpec(BaseModel) # adk.models.optimization.targets
Not the same as the model TargetSpec in
target_specifications.json. Runtime specs appear in OptimizationContext.targets
after the ADK parses the platform payload. You read these during optimization; you do not author them
on disk.
Base type for target entries in the optimization context. Subclasses add value and observation bounds for scalar, vector, and matrix shapes.
Definition
class TargetSpec(BaseModel):
name: str = Field(min_length=1)
fn: Fn
Members
name
name: str = Field(min_length=1)
The unique identifier or name of the target. Must contain at least one character.
fn
fn: Fn
The objective function associated with the target. Defines how the optimization process measures and evaluates success or deviation from desired outcomes.
ValueBounds
class ValueBounds(BaseModel)
Defines the lower and upper numeric limits for a single scalar value used in a target specification.
Definition
class ValueBounds(BaseModel):
min: float
max: float
Members
min
min: float
Minimum allowable value for the target or observed data.
max
max: float
Maximum allowable value for the target or observed data.
ScalarTargetSpec
class ScalarTargetSpec(TargetSpec)
Extends TargetSpec to represent a scalar target specification, including bounds for both target and observation values.
Definition
class ScalarTargetSpec(TargetSpec):
target_values: ValueBounds
observation_bounds: ValueBounds
Members
target_values
target_values: ValueBounds
The desired target value range that the optimization aims to achieve.
observation_bounds
observation_bounds: ValueBounds
The permissible range of observed values during optimization for validation and constraint checking.
VectorTargetSpec
class VectorTargetSpec(TargetSpec)
Extends TargetSpec to define vector-based targets, supporting multiple elements each with their own bounds.
Definition
class VectorTargetSpec(TargetSpec):
target_values: list[ValueBounds]
observation_bounds: list[ValueBounds]
Members
target_values
target_values: list[ValueBounds]
List of value bounds representing the desired range for each element in the target vector.
observation_bounds
observation_bounds: list[ValueBounds]
List of value bounds defining acceptable observed ranges for each vector element during optimization.
MatrixTargetSpec
class MatrixTargetSpec(TargetSpec)
Extends TargetSpec to define matrix-based targets for multidimensional optimization objectives.
Definition
class MatrixTargetSpec(TargetSpec):
target_values: list[list[ValueBounds]]
observation_bounds: list[list[ValueBounds]]
Members
target_values
target_values: list[list[ValueBounds]]
Nested list of ValueBounds defining the target value range for each cell in the matrix target.
observation_bounds
observation_bounds: list[list[ValueBounds]]
Nested list of ValueBounds defining the acceptable observed range for each matrix element during optimization.