Overview | Group | Tree | Graph | Index | Concepts |
An IloPoolProc
is an object dedicated to solution pool
processing. Such pool processors can be chained together using the
>>
operator of the C++ language. This chaining specifies how pool
elements flow between processors. For example, the following code solves a
goal composed by chaining solution processors:
IloSolutionPool initialPool = ...; IloPoolProc producer = ...; IloPoolProc consumer = ...; IloSolutionPool resultPool = ...; solver.solve(IloExecuteProcessor( initialPool >> producer(10) >> consumer >> resultPool ));
The >>
operator is overloaded so that:
initialPool
and resultPool
).The ()
operator is overloaded and used to specify how many pool
elements should be generated by a processor. In the above example,
the code specifies that producer
should generate ten solutions.
Constructor Summary | |
---|---|
public | IloPoolProc(IloSolutionPool pool) Creates a pool processor from a solution pool. |
Method Summary | |
---|---|
public void | end() |
public const char * | getDisplayName() const Get the "display name" of a processor. |
public IloEnv | getEnv() const |
public const char * | getName() const |
public IloAny | getObject() const |
public IloPoolProc | operator()(IlcInt size) const Specifies the desired number of outputs to a processor. |
public void | setName(const char * name) const |
public void | setObject(IloAny obj) const |
Constructor Detail |
---|
This constructor creates a processor from a solution pool.
The created processor acts as a type of synchronizer such
that the solutions transferred on the resulting processor's output
port will also be placed in the solution pool pool
passed as argument.
The behavior of the created processor will depend upon its environment,
and in particular, if the processor is supplied an input using a
>> to its left.
If the processor is supplied an input, then the processor places that
input into pool
, while also transferring to the output.
If, on the other hand, the processor is not supplied any input, then
the contents of pool
are placed on the output.
Assuming you have "population" and "offspring" pools as well as a processor "proc" able to process the population to produce offspring, you can perform a processing chain such as:
IloPoolProc chain = population >> proc >> offspring;
where the population
pool feeds the processor
proc
, whose result is stored in the offspring
pool.
See Also:
Method Detail |
---|
This function deletes the object from the environment on which it was allocated and sets the implementation pointer to zero.
This member function returns the display name of the processor, which is useful for display purposes when type information is required on the processor. The name returned will be based on the function of the processor.
This function returns the environment on which the invoking object was allocated.
This member function returns a character string specifying the name of the invoking object (if there is one).
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.
This operator creates a new pool processor that wraps the invoked pool
processor and retrieves the number of elements specified by size
.
This operator is used to specify the number of outputs to a processor.
The following code initializes a population with populationSize
solutions. In this particular case, the ()
operator is applied to the
processor returned by the randomize
method of the
IloEAOperatorFactory
factory:
solver.solve(IloExecuteProcessor( env, factory.randomize("rand")(populationSize) >> population ));
This member function assigns name
to the invoking object.
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.