ObjectiveInstance

class ampl::ObjectiveInstance : public ampl::BasicInstance<internal::ObjectiveInstance>

Represents an objective instance.

All AMPL suffixes for an objective are available through methods with the same name in this class. See http://www.ampl.com/NEW/suffbuiltin.html for a list of the available suffixes.

All the accessors in this class throw an std::runtime_error if the instance has been deleted in the underlying AMPL interpreter.

Public Functions

inline double value() const

Get the value of the objective instance.

inline std::string astatus() const

Return the AMPL status.

inline std::string sstatus() const

Return the solver status.

inline int exitcode() const

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

inline std::string message() const

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

inline std::string result() const

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

inline void drop()

Drop this objective instance.

inline void restore()

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

inline bool minimization() const

Get the sense of this objective.

Returns

true if minimize, false if maximize

inline Entity entity() const

Returns the entity that this instance is part of.

inline Tuple key() const

Returns the key of this instance.

inline std::string name() const

Returns the name of this instance.

inline std::string toString() const

Returns a string representation of this instance.