IBM ILOG Dispatcher User's Manual > Developing Dispatcher Applications > Developing Your Own Neighborhoods > Implementing the Neighborhood |
Implementing the Neighborhood |
INDEX
![]() |
Recall that the above function only swaps a single visit with a predefined set of visits. Our initial goal was to create a neighborhood which would swap all visits within a certain range of each other. This more complete neighborhood is constructed by the following function. The essential technique is quite simple. You construct an array of neighborhoods, one corresponding to each visit (an instance of LocalizedExchange
). The set of visits for each LocalizedExchange
is calculated according to a proximity rule and to a symmetry rule. The array of neighborhoods is then concatenated to produce one larger neighborhood. The function is passed with the following parameters:
IloDimension2
used for measuring distances
Given this information, the implementation of the function follows:
You can view the entire program and output online in the file YourDispatcherHome/examples/src/newnhood.cpp.
© Copyright IBM Corp. 1987, 2009. Legal terms. | PREVIOUS NEXT |