SolverSolution

class SolverSolution

One solution that the obsolete Solver.solve returned. Deprecated.

Use Solution, which solve() returns.

Methods

__init__

Hold one solution.

Attributes

energy

The value of the objective function.

frequency

The number of times that the machine found this solution.

is_feasible

Whether the solution satisfies every constraint.

values

The values of the variables.

__init__(energy, is_feasible, values)

Hold one solution.

Parameters:
  • energy – The value of the objective function.

  • is_feasible – Whether the solution satisfies every constraint.

  • values – The values of the variables.

__deprecated__ = 'SolverSolution is deprecated since amplify v1.0.0 and will no longer support in the near future.\nPlease see the migration guide for details: https://amplify.fixstars.com/docs/amplify/v1/migration.html'
property energy

The value of the objective function.

Use objective.

Returns:

The value that the solution gives to the objective function.

property frequency

The number of times that the machine found this solution. Deprecated.

Amplify v1 does not count the solutions, so this property always gives 1.

Returns:

property is_feasible

Whether the solution satisfies every constraint.

Use feasible.

Returns:

True when the solution is feasible.

property values

The values of the variables.

Returns:

The value of each variable of the input model.