Skip to content

Core

Dynamics models for vehicle simulation.

Provides vehicle dynamics models organized by type. Each model has its own submodule with parameters, dynamics functions, loss functions, and metadata describing how it interacts with the optimisation stack.

Examples:

>>> from pct.dynamics import MODEL_SPECS
>>> spec = MODEL_SPECS["singletrack-augmented"]
>>> params = spec.build_base_params(timestep_hundredths=5)
>>> dynamics_fn = spec.dynamics_fn

ModelSpec dataclass

Metadata describing a dynamics model and its learnable parameters.

Attributes:

Name Type Description
name str

Identifier for the model.

param_keys tuple of str

Ordered parameter names.

param_shapes Mapping[str, Tuple[int, ...]]

Shapes for each parameter.

param_bounds Sequence[Sequence[object]]

Bounds for each parameter.

default_params Dict[str, object]

Default parameter values.

state_indices Tuple[int, ...]

State indices used by the model.

dynamics_module object

Module containing the dynamics implementation.

dynamics_fn Callable[[object, object], object]

Dynamics function handle.

loss_fn Callable[..., object]

Loss function handle.

build_base_params Callable[[int], object]

Factory for baseline parameter objects.

control_dim int

Control dimensionality.

state_names Tuple[str, ...]

Human-readable state names.

control_names Tuple[str, ...]

Human-readable control names.

train_loss_kwargs Mapping[str, object]

Extra kwargs for training loss.

eval_loss_kwargs Mapping[str, object]

Extra kwargs for evaluation loss.

full_shapes property

full_shapes

Parameter shapes keyed by parameter name.

vector_size property

vector_size

Flattened parameter vector length.

register_model_spec

register_model_spec(spec)

Register a model specification for global discovery.