| IBM ILOG Solver User's Manual > Local Search > Combining Complete and Local Search: Locating Warehouses > Model > Define search functions | 
Define search functions | 
       
    
    INDEX
     
    
    PREVIOUS
    
    NEXT
    | 
We first define a function, TabuSearch, to perform a simple tabu search with a short-term memory. We define a neighborhood using IloFlip and randomize it using IloRandomize. We define a goal, move, that makes a single move and, if the solution is improved, stores it in the solution object whole. The function IloSingleMove scans the randomized neighborhood nh using sol as the current solution. The metaheuristic mh uses tabu search to filter moves, and the search selector selectMove selects a move that minimizes the cost.
Finally, we define a standard optimization loop that continues the search until all iterations have been completed or the tabu search is complete.
We define a goal, IloSetOffer, that chooses a client with the smallest number of available open warehouses (an open warehouse is available if it has sufficient remaining capacity to satisfy the client's demand), and assign the client to the available open warehouse with the lowest cost.
| © Copyright IBM Corp. 1987, 2009. Legal terms. | PREVIOUS NEXT |