Result¶
- class Result¶
Container of optimization solutions and conversion/runtime metadata.
Methods
Attributes
Best solution in the result set.
Solver/client result.
Graph embedding information.
The time the solver used to solve the problem.
Whether to filter out infeasible solutions.
Model conversion information.
Number of solve executions aggregated.
The time between sending the request and receiving the response from the solver.
View of all solutions.
Split view for each independent solve.
Total time including conversion and solve.
- class GraphConversion¶
Graph embedding conversion details used during solving.
- class ChainBreakFractions¶
List-like view of chain break fractions.
- __bool__(self) bool¶
- 戻り値の型:
bool
- __getitem__(self, key: int) float¶
Return the element at the index.
A negative index counts from the end, as in a Python list.
- パラメータ:
key (int) -- The index of the element.
- 戻り値の型:
float
- 例外:
IndexError -- The index is out of range.
- __init__(*args, **kwargs)¶
- __len__(self) int¶
- 戻り値の型:
int
- __repr__(self) str¶
- 戻り値の型:
str
- __str__(self) str¶
- 戻り値の型:
str
- __init__(*args, **kwargs)¶
- __repr__(self) str¶
- 戻り値の型:
str
- __str__(self) str¶
- 戻り値の型:
str
- property chain_break_fractions¶
Chain break fraction for each solve.
- 戻り値の型:
- property chains¶
Embedding chains for each logical variable.
- 戻り値の型:
list[ndarray[dtype=uint32, writable=False]]
- property num_variables¶
Number of physical variables used after embedding.
- 戻り値の型:
int
- property src_graph¶
Source (input polynomial) graph for embedding.
- 戻り値の型:
list[tuple[int, int]]
- property values_list¶
Physical variable assignments for each solve.
- 戻り値の型:
- class ModelConversion¶
Model conversion details used during solving.
- class IntermediateMapping¶
Mapping between original and intermediate variables during model conversion.
- class ItemsView¶
View of key-value pairs in
IntermediateMapping.- __bool__(self) bool¶
- 戻り値の型:
bool
- __init__(*args, **kwargs)¶
- __len__(self) int¶
- 戻り値の型:
int
- __repr__(self) str¶
- 戻り値の型:
str
- __str__(self) str¶
- 戻り値の型:
str
- class KeysView¶
View of keys in
IntermediateMapping.- __bool__(self) bool¶
- 戻り値の型:
bool
- __contains__(self, arg: Poly, /) bool¶
- __contains__(self, arg: object, /) bool
__contains__
Overload 1.
- Args:
arg (amplify.Poly)
- Returns:
bool:
Overload 2.
- Args:
arg (object)
- Returns:
bool:
- __init__(*args, **kwargs)¶
- __len__(self) int¶
- 戻り値の型:
int
- __repr__(self) str¶
- 戻り値の型:
str
- __str__(self) str¶
- 戻り値の型:
str
- class ValuesView¶
View of values in
IntermediateMapping.- __bool__(self) bool¶
- 戻り値の型:
bool
- __init__(*args, **kwargs)¶
- __iter__(self) ValuesView¶
- 戻り値の型:
- __len__(self) int¶
- 戻り値の型:
int
- __repr__(self) str¶
- 戻り値の型:
str
- __str__(self) str¶
- 戻り値の型:
str
- __bool__(self) bool¶
- 戻り値の型:
bool
- __contains__(self, arg: Poly, /) bool¶
- __contains__(self, arg: object, /) bool
__contains__
Overload 1.
- Args:
arg (amplify.Poly)
- Returns:
bool:
Overload 2.
- Args:
arg (object)
- Returns:
bool:
- __init__(*args, **kwargs)¶
- __len__(self) int¶
- 戻り値の型:
int
- __repr__(self) str¶
- 戻り値の型:
str
- __str__(self) str¶
- 戻り値の型:
str
- values(self) ValuesView¶
- 戻り値の型:
- __init__(*args, **kwargs)¶
- __repr__(self) str¶
- 戻り値の型:
str
- __str__(self) str¶
- 戻り値の型:
str
- property mapping¶
Mapping from input variables to intermediate expressions.
- 戻り値の型:
- property num_variables¶
Number of variables in the intermediate model.
- 戻り値の型:
int
- property values_list¶
Intermediate variable assignments for each solve.
- 戻り値の型:
- class Solution¶
Single solution entry in
Result.- __init__(*args, **kwargs)¶
- __repr__(self) str¶
- 戻り値の型:
str
- __str__(self) str¶
- 戻り値の型:
str
- property feasible¶
Whether all constraints are satisfied.
- 戻り値の型:
bool
- property objective¶
Objective function value.
- 戻り値の型:
float
- property time¶
Time at which the solver found this solution.
- 戻り値の型:
datetime.timedelta
- class SolutionList¶
List-like view of solutions.
- __bool__(self) bool¶
- 戻り値の型:
bool
- __getitem__(self, key: int) Solution¶
Return the element at the index.
A negative index counts from the end, as in a Python list.
- パラメータ:
key (int) -- The index of the element.
- 戻り値の型:
- 例外:
IndexError -- The index is out of range.
- __init__(*args, **kwargs)¶
- __len__(self) int¶
- 戻り値の型:
int
- __repr__(self) str¶
- 戻り値の型:
str
- __str__(self) str¶
- 戻り値の型:
str
- class SplitView¶
List-of-list-like view of solutions that splits solutions by independent solves.
- __bool__(self) bool¶
- 戻り値の型:
bool
- __getitem__(self, key: int) Result¶
Return the element at the index.
A negative index counts from the end, as in a Python list.
- パラメータ:
key (int) -- The index of the element.
- 戻り値の型:
- 例外:
IndexError -- The index is out of range.
- __init__(*args, **kwargs)¶
- __len__(self) int¶
- 戻り値の型:
int
- __repr__(self) str¶
- 戻り値の型:
str
- __str__(self) str¶
- 戻り値の型:
str
- class ValuesList¶
List-like view of value mappings for solutions.
- __bool__(self) bool¶
- 戻り値の型:
bool
- __getitem__(self, key: int) Values¶
Return the element at the index.
A negative index counts from the end, as in a Python list.
- パラメータ:
key (int) -- The index of the element.
- 戻り値の型:
- 例外:
IndexError -- The index is out of range.
- __init__(*args, **kwargs)¶
- __len__(self) int¶
- 戻り値の型:
int
- __repr__(self) str¶
- 戻り値の型:
str
- __str__(self) str¶
- 戻り値の型:
str
- __getitem__(self, key: int) Solution¶
Return the element at the index.
A negative index counts from the end, as in a Python list.
- パラメータ:
key (int) -- The index of the element.
- 戻り値の型:
- 例外:
IndexError -- The index is out of range.
- __init__(*args, **kwargs)¶
- __len__(self) int¶
- 戻り値の型:
int
- __repr__(self) str¶
- 戻り値の型:
str
- __str__(self) str¶
- 戻り値の型:
str
- sort(self) None¶
Sort solutions by feasibility and objective value.
- __nb_signature__ = 'class Result(typing.Generic[_BaseClient_co])'¶
- property best¶
Best solution in the result set.
The best solution is the feasible solution with the smallest objective value. When
filter_solutionisTrue, the result holds only the feasible solutions, so this property raises as soon as the result is empty.- 戻り値:
The solution that has the smallest objective value among the feasible solutions.
- 戻り値の型:
- 例外:
RuntimeError -- The result holds no solution, or it holds no feasible solution.
- property client_result¶
Solver/client result.
The raw response of the machine. Its type depends on the client that solved the model. It is
Nonewhen the solve kept no client result, as after a conversion only run.
- property embedding¶
Graph embedding information.
- 戻り値の型:
GraphConversion | None
- property execution_time¶
The time the solver used to solve the problem.
- 戻り値の型:
datetime.timedelta
- property filter_solution¶
Whether to filter out infeasible solutions.
- 戻り値の型:
bool
- property intermediate¶
Model conversion information.
- 戻り値の型:
- property num_solves¶
Number of solve executions aggregated.
- 戻り値の型:
int
- property response_time¶
The time between sending the request and receiving the response from the solver.
- 戻り値の型:
datetime.timedelta
- property solutions¶
View of all solutions.
- 戻り値の型:
- property total_time¶
Total time including conversion and solve.
- 戻り値の型:
datetime.timedelta