FRAMES NO FRAMES

Class IloPoolOperatorFactory

Definition file: ilsolver/iimoperator.h
Include file: <ilsolver/iim.h>
An operator factory class providing services for simplifying operator creation.

This class eases IloPoolOperator configuration. It allows you to specify common operator parameters at one time before creating many operators. Objects of this class are usually used through one if its subclasses.

See Also:

Constructor Summary
public IloPoolOperatorFactory(IloEnv env)

Creates a factory that can be used to configure pool operators.

Method Summary
public voidaddAfterOperate(IloPoolOperator op) const

Adds a final operator to execute.

public voidaddBeforeOperate(IloPoolOperator op) const

Adds an initial operator to execute.

public voidaddListener(IloListener listener) const

Adds a listener to the factory.

public voidend()
public IloPoolOperatorgetAfterOperate() const

Returns the final operator to execute.

public IloPoolOperatorgetBeforeOperate() const

Returns the initial operator to execute.

public IloEnvgetEnv() const
public const char *getName() const
public IloAnygetObject() const
public IloSolutiongetPrototype() const

Returns the solution prototype.

public IloSearchLimitgetSearchLimit() const

Returns the search limit.

public IloPoolOperatoroperator()(IloPoolOperator op, const char * name=0) const

Configures the given pool operator using the factory parameters.

public voidremoveListener(IloListener listener) const

Removes a listener previously added to the factory.

public voidsetAfterOperate(IloPoolOperator op) const

Sets a final operator to execute.

public voidsetBeforeOperate(IloPoolOperator op) const

Sets an initial operator to execute.

public voidsetName(const char * name) const
public voidsetObject(IloAny obj) const
public voidsetPrototype(IloSolution prototype) const

Sets the solution prototype used by created operators.

public voidsetSearchLimit(IloSearchLimit searchLimit) const

Sets a search limit on operators.

Constructor Detail

IloPoolOperatorFactory

public IloPoolOperatorFactory(IloEnv env)
Creates a factory that can be used to configure pool operators.

This constructor creates a factory that can be used to configure pool operators. If you wish to create a factory which build evolutionary operators, use the subclass IloEAOperatorFactory.


Method Detail

addAfterOperate

public void addAfterOperate(IloPoolOperator op) const
Adds a final operator to execute.

This member function adds a final operator to execute. Any operator of the factory will have operator op executed after it. Note that unlike IloPoolOperatorFactory::setAfterOperate, other operators already set will not be replaced. Also note that op will only be executed if the factory operator executed successfully.

See Also:


addBeforeOperate

public void addBeforeOperate(IloPoolOperator op) const
Adds an initial operator to execute.

This member function adds an initial operator to execute. Any operator of the factory will have operator op executed before it. Note that unlike IloPoolOperatorFactory::setBeforeOperate, other operators already added will not be replaced.

Note
Note the ordering of execution of "before" operators. If you perform factory.addBeforeOperate(a) followed by factory.addBeforeOperate(b), then any operator created by the factory will execute b, then a, then the operator in question.

See Also:


addListener

public void addListener(IloListener listener) const
Adds a listener to the factory.

This member function adds a listener to the factory. Any operator then created by the factory will have the specified listener added.

See Also:


end

public void end()
brief Destroys the object.

This function deletes the object from the environment on which it was allocated and sets the implementation pointer to zero.


getAfterOperate

public IloPoolOperator getAfterOperate() const
Returns the final operator to execute.

This member function returns the final operator to execute, which was last set using IloPoolOperatorFactory#setAfterOperator, or an empty handle if no "after" operator was set.


getBeforeOperate

public IloPoolOperator getBeforeOperate() const
Returns the initial operator to execute.

This member function returns the initial operator to execute, which was last set using setBeforeOperator, or an empty handle if no "before" operator was set.


getEnv

public IloEnv getEnv() const
brief Returns the allocation environment.

This function returns the environment on which the invoking object was allocated.


getName

public const char * getName() const

This member function returns a character string specifying the name of the invoking object (if there is one).


getObject

public IloAny getObject() const

This member function returns the object associated with the invoking object (if there is one). Normally, an associated object contains user data pertinent to the invoking object.


getPrototype

public IloSolution getPrototype() const
Returns the solution prototype.

This member function returns the solution prototype last set using IloPoolOperatorFactory::setPrototype or an empty handle if none has been set.


getSearchLimit

public IloSearchLimit getSearchLimit() const
Returns the search limit.

This member function returns the search limit last set using IloPoolOperatorFactory::setSearchLimit or an empty handle if none was set.


operator()

public IloPoolOperator operator()(IloPoolOperator op, const char * name=0) const
Configures the given pool operator using the factory parameters.

This operator configures the given pool operator using the factory parameters. A new operator will be produced using pool operator op as a template, but which will be parameterized via the parameters of the factory. That is, it will have a prototype, limit, and listeners added as specified by the factory.

See Also:


removeListener

public void removeListener(IloListener listener) const
Removes a listener previously added to the factory.

This member function removes a listener added to the factory. Any operator then created by the factory will no longer have the specified listener added.

See Also:


setAfterOperate

public void setAfterOperate(IloPoolOperator op) const
Sets a final operator to execute.

This member function sets a final operator to execute. Any operator of the factory will have operator op executed after it. Note that op will only be executed if the factory operator executed successfully.

See Also:


setBeforeOperate

public void setBeforeOperate(IloPoolOperator op) const
Sets an initial operator to execute.

This member function sets an initial operator to execute. Any operator then created by the factory will have the "before" operator op executed before it.

See Also:


setName

public void setName(const char * name) const

This member function assigns name to the invoking object.


setObject

public void setObject(IloAny obj) const

This member function associates obj with the invoking object. The member function getObject accesses this associated object afterward. Normally, obj contains user data pertinent to the invoking object.


setPrototype

public void setPrototype(IloSolution prototype) const
Sets the solution prototype used by created operators.

This member function sets the solution prototype used by created operators. Any operator created by the factory will then have its prototype set accordingly.

See Also:


setSearchLimit

public void setSearchLimit(IloSearchLimit searchLimit) const
Sets a search limit on operators.

This member functions sets a search limit on operators. This search limit will apply to any operator then created by the factory.