Objective Class

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 corresponding properties on the Objective itself. The properties have the same name of the corresponding AMPL suffixes. See http://www.ampl.com/NEW/suffbuiltin.html for a list of the available suffixes. An ArgumentException is thrown if one of such methods is called for a non-scalar objective. An ArgumentOutOfRangeException is thrown if any property of an entity which has been deleted from the underlying interpreter is accessed. The instances, represented by the class ampl.ObjectiveInstance can be accessed via the indexing operator, via the method ampl.Entities.Objective.Get or via the iterator provided. To gain access to all the values in an entity (for all instances and all suffixes for that entities), see ampl.Entities.Entity.GetValues and the ampl.DataFrame class.

Namespace

ampl.Entities

Assemblies
  • AMPL


Inheritance Hierarchy

Syntax

[ClassInterface(ClassInterfaceType.None)]
public class Objective : Entity<ObjectiveInstance>, IEnumerable<ObjectiveInstance>, IEnumerable, IObjective
class ampl.Entities.Objective

Properties

ampl.Entities.Objective.Astatus

Return the AMPL status

Return type

System.String

public string Astatus { get; }
ampl.Entities.Objective.ExitCode

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

Return type

System.Int32

public int ExitCode { get; }
ampl.Entities.Objective.IsMinimization

Get the sense of this objective, true if minimization, false if maximization

Return type

System.Boolean

public bool IsMinimization { get; }
ampl.Entities.Objective.Message

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

Return type

System.String

public string Message { get; }
ampl.Entities.Objective.Result

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

Return type

System.String

public string Result { get; }
ampl.Entities.Objective.Sstatus

Return the solver status

Return type

System.String

public string Sstatus { get; }
ampl.Entities.Objective.Value

Get the value of this objective

Return type

System.Double

public double Value { get; }

Methods

Drop()

Drop this objective

public void Drop()
Get(System.Object[])
Return type

ObjectiveInstance

public ObjectiveInstance Get(params object[] index)
Get(ampl.Tuple)
Return type

ObjectiveInstance

public override ObjectiveInstance Get(Tuple t = null)
GetEnumerator()
Return type

System.Collections.Generic.IEnumerator<ObjectiveInstance>

public override IEnumerator<ObjectiveInstance> GetEnumerator()
Restore()

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

public void Restore()