BlackBoxFuncBase¶
- class BlackBoxFuncBase¶
Bases:
ABC
Base class to define a black box objective function class.
- Parameters:
abc – Abstract base class.
Methods
Initialize the base class.
Add user-defined constraints to the black-box function class instance.
Evaluate the objective function.
Attributes
User-defined constraints associated with this black-box function class.
Name of the black-box objective function.
Decision variables associated with this black-box objective function.
- __setattr__(name: str, value: Any) None ¶
Set decision variables.
- Parameters:
name (str) – The name of a decision variable.
value (Any) – A decision variable.
- add_constraint(
- constraint: Constraint | Constraints | list[Constraint | Constraints] | list[Constraint] | list[Constraints],
Add user-defined constraints to the black-box function class instance.
- Parameters:
constraint (Constraint | Constraints | list[Constraint | Constraints] | list[Constraint] | list[Constraints]) – User-defined constraints.
- abstract objective() float ¶
Evaluate the objective function. An evaluator sets the class variable attributes having the names and valueas of the input.
- Returns:
An objective function value.
- Return type:
- __abstractmethods__ = frozenset({'objective'})¶
- __dict__ = mappingproxy({'__module__': 'amplify_bbopt.bb_func', '__doc__': 'Base class to define a black box objective function class.\n\n Args:\n abc: Abstract base class.\n ', '__init__': <function BlackBoxFuncBase.__init__>, 'name': <property object>, '__setattr__': <function BlackBoxFuncBase.__setattr__>, '_call_objective': <function BlackBoxFuncBase._call_objective>, 'variables': <property object>, 'objective': <function BlackBoxFuncBase.objective>, 'add_constraint': <function BlackBoxFuncBase.add_constraint>, 'constraints': <property object>, '__dict__': <attribute '__dict__' of 'BlackBoxFuncBase' objects>, '__weakref__': <attribute '__weakref__' of 'BlackBoxFuncBase' objects>, '__abstractmethods__': frozenset({'objective'}), '_abc_impl': <_abc._abc_data object>, '__annotations__': {}})¶
- __slots__ = ()¶
- __weakref__¶
list of weak references to the object (if defined)
- property constraints: Constraints¶
User-defined constraints associated with this black-box function class.