AmplifyModel¶
- class AmplifyModel¶
Bases:
Generic
[_C
]A class to represent an optimization model using Amplify SDK.
Methods
Attributes
Return the Amplify client used by the model.
Return the constraints of the optimization model.
Return the objective function of the optimization model.
Return the variables of the optimization model.
- classmethod __class_getitem__(params)¶
- __init__(
- variables: PolyArray,
- client: _C = FixstarsClient({'url': 'https://optigan.fixstars.com', 'token': '', 'compression': true, 'parameters': {'outputs': {}}}),
Initialize the AmplifyModel.
- Parameters:
variables (amplify.PolyArray) – The variables of the optimization model.
client (_C, optional) – The Amplify client to use. Defaults to _default_client.
- classmethod __init_subclass__(*args, **kwargs)¶
This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
- solve( ) tuple[list[ndarray[tuple[int, ...], dtype[float64]]], Result] ¶
Solve the given problem.
The return value is lists of solutions in binary variables that this class holds. When some of the variables are not contained in the given problem, default values are used for those variables.
- Parameters:
- Returns:
List of solutions in Amplify SDK’s variables and the Amplify SDK’s raw result.
- Return type:
- __dict__ = mappingproxy({'__module__': 'amplify_bbopt.amplify_model', '__doc__': 'A class to represent an optimization model using Amplify SDK.', '__init__': <function AmplifyModel.__init__>, 'variables': <property object>, 'client': <property object>, 'objective': <property object>, 'constraints': <property object>, 'solve': <function AmplifyModel.solve>, '__orig_bases__': (typing.Generic[~_C],), '__dict__': <attribute '__dict__' of 'AmplifyModel' objects>, '__weakref__': <attribute '__weakref__' of 'AmplifyModel' objects>, '__parameters__': (~_C,), '__annotations__': {'_variables': 'amplify.PolyArray', '_client': '_C'}})¶
- __orig_bases__ = (typing.Generic[~_C],)¶
- __parameters__ = (~_C,)¶
- __slots__ = ()¶
- __weakref__¶
list of weak references to the object (if defined)
- property client: _C¶
Return the Amplify client used by the model.
- property constraints: ConstraintList¶
Return the constraints of the optimization model.
- property objective: Poly¶
Return the objective function of the optimization model.
- property variables: PolyArray¶
Return the variables of the optimization model.