FRAMES NO FRAMES

IloSingleMove

public IlcGoal IloSingleMove(IloSolver solver, IloSolution s, IloNHood nh, IloMetaHeuristic mh, IlcSearchSelector sel, IlcGoal subgoal, IlcNeighborIdentifier nid, IloInt minChunk=IloMinChunk, IloInt maxChunk=IloMaxChunk)
public IloGoal IloSingleMove(IloEnv env, IloSolution soln, IloNHood nhood, IloMetaHeuristic mh, IloSearchSelector sel, IloGoal subGoal, IloNeighborIdentifier nid, IloInt minChunk=IloMinChunk, IloInt maxChunk=IloMaxChunk)
public IloGoal IloSingleMove(IloEnv env, IloSolution soln, IloNHood nhood, IloMetaHeuristic mh, IloSearchSelector sel, IloGoal subGoal, IloInt minChunk=IloMinChunk, IloInt maxChunk=IloMaxChunk)
public IloGoal IloSingleMove(IloEnv env, IloSolution solution, IloNHood nh)
public IloGoal IloSingleMove(IloEnv env, IloSolution solution, IloNHood nh, IloMetaHeuristic mh, IloSearchSelector sel)
public IloGoal IloSingleMove(IloEnv env, IloSolution solution, IloNHood nh, IloMetaHeuristic mh)
public IloGoal IloSingleMove(IloEnv env, IloSolution solution, IloNHood nh, IloSearchSelector sel)
public IloGoal IloSingleMove(IloEnv env, IloSolution solution, IloNHood nh, IloGoal subGoal)
public IloGoal IloSingleMove(IloEnv env, IloSolution solution, IloNHood nh, IloMetaHeuristic mh, IloGoal subGoal)
public IloGoal IloSingleMove(IloEnv env, IloSolution solution, IloNHood nh, IloSearchSelector sel, IloGoal subGoal)
public IlcGoal IloSingleMove(IloSolver solver, IloSolution solution, IloNHood nhood, IloMetaHeuristic mh, IlcSearchSelector sel, IlcGoal subgoal, IloInt minChunk=IloMinChunk, IloInt maxChunk=IloMaxChunk)
Definition file: ilsolver/iimls.h
Include file: <ilsolver/iimls.h>

This function returns a goal that makes a single local move as defined by a neighborhood, a metaheuristic, and a move selection method. The goal scans the neighborhood nhood using solution as the current solution. The metaheuristic mh is used to filter moves, and the search selector sel to choose a single move from those that become available. Additionally, a goal subgoal can be executed after the deltas from the neighborhood are applied to the current solution. A neighbor identifier nid can be specified which can, on successful completion of a move, be used to provide information about the neighbor.

If no metaheuristic is specified, no metaheuristic filtering is performed. If no selector is specified, IloFirstSolution is assumed. If no subgoal is specified, none is executed.

If a successful move can be found, the goal succeeds. The constrained variables are in the state corresponding to the application of the move. This new state is saved to solution before the goal succeeds. If no successful move can be found, the goal fails, and solution is left unchanged.

When IloSingleMove is used, the IloMetaHeuristic::test and IloMetaHeuristic::notify methods of the supplied metaheuristic are supplied with the relevant solution delta, and the neighborhood is notified with the index of the chosen neighbor. This is done through sharing of the neighbor identifier among IloScanNHood, IloTest, and IloNotify.

Implementation

The execute method of this goal can be implemented as follows:

 IlcGoal IlcSingleMoveI::execute(){
   IlcGoal scan = IloScanNHood(solver, nh, nid, solution, mh.getDeltaCheck());
   IlcGoal testGoal = IloTest(solver, mh, nid);
   IlcGoal exploreNHood = IlcAnd(IloStart(solver, mh, solution),
                                 scan,
                                 testGoal,
                                 subgoal,
                                 testGoal);

   IlcGoal saveGoal = IlcAnd(IloNotify(solver, nh, nid),
                             IloNotify(solver, mh, nid),
                             IloStoreSolution(solver, solution));

   return IlcAnd(IlcSelectSearch(exploreNHood, sel), saveGoal);
 }
 

See Also: