# ObjectiveInstance¶

class ObjectiveInstance

Represents an AMPL objective. Note that, in case of a scalar objective, all the properties (corresponding to AMPL suffixes) of the objective instance can be accessed through methods like value. The methods have the same name of the corresponding AMPL suffixes. See http://www.ampl.com/NEW/suffbuiltin.html for a list of the available suffixes.

All these methods throw an error if called on an entity which has been deleted in the underlying intepreter.

To gain access to all the values in an entity (for all instances and all suffixes for that entities), see getValues and the DataFrame class.

ObjectiveInstance.name()

Returns the name of this instance.

Returns: Name of the instance.
ObjectiveInstance.toString()

Returns a string representation of this instance.

Returns: String representation of this instance.
ObjectiveInstance.value()

Get the value of the objective instance.

Returns: Value of the objective.
ObjectiveInstance.astatus()

Return the AMPL status.

Returns: The AMPL status.
ObjectiveInstance.sstatus()

Return the solver status.

Returns: The solver status.
ObjectiveInstance.exitcode()

Exit code returned by the solver after most recent solve with this objective.

Returns: The exit code returned by the solver.
ObjectiveInstance.message()

Result message returned by solver after most recent solve with this objective.

Returns: The result message returned by the solver.
ObjectiveInstance.result()

Result string returned by solver after most recent solve with this objective.

Returns: The result message returned by the solver.
ObjectiveInstance.drop()

Drop this objective.

ObjectiveInstance.restore()

Restore this objective (if it had been dropped, no effect otherwise)

ObjectiveInstance.message()

Get the sense of this objective

Returns: TRUE if minimize, FALSE if maximize.