VaryingParameter#

pydantic model optimas.core.VaryingParameter(name, lower_bound, upper_bound, is_fidelity=False, fidelity_target_value=None, default_value=None, dtype=<class 'float'>)#

Defines an input parameter to be varied during optimization.

Parameters:
namestr

The name of the parameter.

lower_bound, upper_boundfloat

Lower and upper bounds of the range in which the parameter can vary.

is_fidelitybool, optional

Indicates whether the parameter is a fidelity. Only needed for multifidelity optimization.

fidelity_target_valuefloat, optional

The target value of the fidelity. Only needed for multifidelity optimization.

default_valuefloat, optional

Default value of the parameter when it is not being varied. Only needed for some generators.

dtypedata-type

The data type of the parameter. Any object that can be converted to a numpy dtype.

fix_value(value)#

Fix the value of the parameter.

The value must be within the range of the parameter.

Parameters:
valuefloat

The value to which the parameter will be fixed.

free_value()#

Free the value of the parameter.

model_post_init(context, /)#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Args:

self: The BaseModel instance. context: The context.

update_range(lower_bound, upper_bound)#

Update range of the parameter.

Parameters:
lower_bound, upper_boundfloat

Lower and upper bounds of the range in which the parameter can vary.

property is_fixed#

Get whether the parameter is fixed to a certain value.