Objective

class Objective

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.

Objective.value()

Get the value of the objective instance.

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

Return the AMPL status.

Returns:The AMPL status.
Objective.sstatus()

Return the solver status.

Returns:The solver status.
Objective.exitcode()

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

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

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

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

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

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

Drop this objective.

Objective.restore()

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

Objective.message()

Get the sense of this objective

Returns:TRUE if minimize, FALSE if maximize.