ommx_fixstars_amplify_adapter.amplify_to_ommx
Classes
Build ommx.v1.Instance from the Model of Fixstars Amplify. |
Functions
|
The function to create an ommx.v1.Instance from the Fixstars Amplify model. |
Module Contents
- class ommx_fixstars_amplify_adapter.amplify_to_ommx.OMMXInstanceBuilder
Build ommx.v1.Instance from the Model of Fixstars Amplify.
- _is_empty_model() bool
- _poly_to_ommx(poly: amplify.Poly, constant: float = 0.0) ommx.v1.Function
Convert from the polynomial of the Fixstars Amplify SDK to the object of ommx.v1.
- build() ommx.v1.Instance
- constraints() List[ommx.v1.Constraint]
- decision_variables() List[ommx.v1.DecisionVariable]
- objective() ommx.v1.Function
- sense()
- model: amplify.Model
- ommx_fixstars_amplify_adapter.amplify_to_ommx.model_to_instance(model: amplify.Model) ommx.v1.Instance
The function to create an ommx.v1.Instance from the Fixstars Amplify model.
Example:
The following example shows how to create an ommx.v1.Instance from a Fixstars Amplify model.
>>> import amplify >>> from ommx_fixstars_amplify_adapter import model_to_instance >>> >>> gen = amplify.VariableGenerator() >>> x = gen.scalar("Binary", name="x") >>> model = amplify.Model(x) >>> >>> ommx_instance = model_to_instance(model)