metaheuristic_designer.parametrizable_mixin module#
Module providing the ParametrizableMixin for managing schedulable parameters.
- class ParametrizableMixin[source]#
Bases:
objectMixin that turns raw keyword arguments into dynamic, schedulable parameters.
Any argument passed to
store_kwargs()orupdate_kwargs()can be a plain value or a callable that receives the current progress (a float between 0 and 1) and returns the value to use. The current values are accessible viaget_params()or theparamsproperty.- Attributes:
paramsAccess parameter values by attribute-style lookup.
Methods
Return a copy of the current parameter dictionary.
store_kwargs([progress])Store keyword arguments and evaluate them at the given progress.
update(progress)Re-evaluate all stored parameters at the current progress.
update_kwargs([progress])Add or replace parameters and immediately evaluate them.
- store_kwargs(progress=0, **kwargs)[source]#
Store keyword arguments and evaluate them at the given progress.
- Parameters:
- progressfloat, optional
Progress value forwarded to any callable parameters.
- **kwargs
Parameter names and values (constants or callables).
- Parameters:
progress (float)
- update(progress)[source]#
Re-evaluate all stored parameters at the current progress.
- Parameters:
- progressfloat
Current progress (0-1) used to evaluate callable parameters.
- Parameters:
progress (float)