FRAMES NO FRAMES

Class IlcGoal

Definition file: ilsolver/basic.h
Include file: <ilsolver/ilosolver.h>

Goals are the building blocks of search algorithms in Solver. Goals depend on two classes: IlcGoal and IlcGoalI. The class IlcGoal is the handle class. An instance of the class IlcGoal contains a data member (the handle pointer) that points to an instance of the class IlcGoalI (the implementation object) allocated on the Solver heap. If you define a new class of goals, you must define the implementation class together with the corresponding virtual member function, execute, and a member function that returns an instance of the handle class IlcGoal.

For more information, see the concept Goal.

See Also:

Constructor Summary
public IlcGoal()
public IlcGoal(IlcGoalI * impl)
public IlcGoal(const IlcGoal & goal)
Method Summary
public IlcGoalI *getImpl() const
public const char *getName() const
public IlcAnygetObject() const
public IloSolvergetSolver() const
public IloSolverI *getSolverI() const
public voidoperator=(const IlcGoal & h)
public voidsetName(const char * name) const
public voidsetObject(IlcAny object) const
Constructor Detail

IlcGoal

public IlcGoal()

This constructor creates a goal which is empty, that is, one whose handle pointer is null. This object must then be assigned before it can be used, exactly as when you declare a pointer.

This constructor creates a handle object (an instance of the class IlcGoal) from a pointer to an implementation object (an instance of the implementation class IlcGoalI).

This member function returns a pointer to the implementation object of the invoking handle, a goal.

This member function returns the solver (a handle, an instance of IloSolver) associated with the invoking goal.

This assignment operator copies goal into the invoking goal by assigning an address to the handle pointer of the invoking object. That address is the location of the implementation object of the argument goal.

This constructor creates an empty handle. You must initialize it before you use it.

IlcGoal

public IlcGoal(IlcGoalI * impl)
This constructor creates a handle object from a pointer to an implementation object.

IlcGoal

public IlcGoal(const IlcGoal & goal)

This copy constructor creates a reference to a goal. That goal and goal both point to the same implementation object.


Method Detail

getImpl

public IlcGoalI * getImpl() const
This constructor creates an object by copying another one. This constructor creates an object by copying another one. This member function returns a pointer to the implementation object of the invoking handle.

getName

public const char * getName() const
This member function returns the name of the invoking object.

getObject

public IlcAny getObject() const
This member function returns a pointer to the external object associated with the invoking object, if there is such an association. It returns 0 (zero) otherwise.

getSolver

public IloSolver getSolver() const

This member function returns an instance of IloSolver associated with the invoking object.


getSolverI

public IloSolverI * getSolverI() const

This member function returns a pointer to the implementation object of the solver where the invoking object was extracted.


operator=

public void operator=(const IlcGoal & h)
This operator assigns an address to the handle pointer of the invoking object. That address is the location of the implementation object of the provided argument.

setName

public void setName(const char * name) const
This member function sets the name of the invoking object to a copy of name. This assignment is a reversible action.

setObject

public void setObject(IlcAny object) const
This member function establishes a link between the invoking object and an external object of which the invoking object might be a data member.