Creating the decision maker class |
INDEX
PREVIOUS
NEXT
|
Now, you create IloPDPDecisionMakerI, a specialized decision maker class for PDP problems. It will use the decision class PDPDecision that you just created. You will define three member functions: init, getBestDecision, and getBestSerialDecision.
The member function init iterates on all visit pairs that are extracted in the dispatcher and, for each visit, looks for all vehicles that can be assigned to these visits. For each compatible set (vehicle, pickup, delivery) it then does two things. First, it decides whether or not it is worth creating a PDPDecision decision for the set. If the set (vehicle, pickup, delivery) is not "interesting" then no decision is created and this possibility will not be considered by the first solution framework. If the set is "interesting," then this decision is stored.
The member function getBestDecision is the implementation of the virtual member function defined in the abstract IloNADecisionMakerI class. In this example, the extension mode is serial. Therefore, the decision maker fills vehicles one at a time, and this member function returns the best decision concerning the currently open vehicle. At the beginning, no vehicle is open, and the member function returns the best decision among all possible decisions. Afterwards, the decision's vehicle becomes the current vehicle, and only decisions registered with this vehicle are considered. When the vehicle is full, the decision maker looks again for the best global decision and chooses a new current decision, or terminates.
| © Copyright IBM Corp. 1987, 2009. Legal terms. | PREVIOUS NEXT |