FRAMES NO FRAMES

IloCompose

public IloNHood IloCompose(IloEnv env, IloNHood nhood1, IloNHood nhood2, const char * name=0)
Definition file: ilsolver/iimnhood.h
Include file: <ilsolver/ilosolver.h>

This function creates a composed neighborhood. The neighborhood formed is the product of nhood1 and nhood2. Specifically, each neighbor specified by nhood1 is composed with each neighbor specified by nhood2. The size of the resulting neighborhood is the product of the sizes of nhood1 and nhood2. Each call to define creates a composed delta which is a union of the deltas of the corresponding neighbors of the composed neighborhoods. This union operates by placing in the composed delta all variables mentioned in either of two deltas from nhood1 and nhood2. If the delta from nhood1 and that from nhood2 set different values for the same variable, the value in the delta from nhood2 is used in the composed delta. The optional argument name, if provided, becomes the name of the newly created neighborhood.

Note
This neighborhood does not provide a chaining of moves (a move from nhood1 followed by a move from nhood2). It provides simultaneous moves from nhood1 and nhood2. In that sense, only moves from nhood1 and nhood2 that mention different parts of the solution will result in a sensible move; others which mention the same part of the solution will most likely create unwanted interactions and will typically be illegal.

In such a composed neighborhood, the member function IloNHood::define calls IloNHood::define on both nhood1 and nhood2, returning the composed solution delta; the function IloNHood::notify notifies both nhood1 and nhood2; the function IloNHood::start calls IloNHood::start for both nhood1 and nhood2;and the function IloNHood::getSize returns the product of the sizes of nhood1 and nhood2.

See Also: