IBM ILOG Solver User's Manual > Evolutionary Algorithms > Car Sequencing Using EA > Problem representation: Car priorities |
Problem representation: Car priorities |
INDEX
![]() |
The first job to perform in the principal function SolveWithGA
is to create the indirect representation of the car sequencing problem. Here, a system based on priorities has been chosen. A priority is assigned to each car to be built. Later a decoder will build the sequence of cars based on these priorities. The indirect representation thus defines an order in which cars should be built just as the direct representation does by assigning a car configuration to each slot. In this sense, the two representations are similar. It is important to notice the differences though. The indirect representation based on priorities gives a desired order, not a required order. The decoder will take these priorities, and try to respect the order defined by them as much as possible, but in reality, constraint propagation will mean that the order cannot be respected completely. Thus the indirect representation can be seen as a guide as to producing a solution.
You now create the indirect representation and add it to the model.
Step 2 - | Create the indirect representation |
Add the following code after the comment // Indirect representation
IloEnv env(solver.getEnv()); IloIntVarArray prio(problem._env, problem._numberOfCars, 0, 1000); model.add(prio); |
Here, priorities go from 0 to 1000, but any upper bound would be reasonable so long as it is not too low; a low maximum priority would result in too many cars with equal priority in any solution, which could lead to arbitrary tie-breaking rules being applied frequently in the decoder. Such reliance on tie-breaking rules is undesirable as it moves the search emphasis from the genetic search to these tie-breaking rules.
© Copyright IBM Corp. 1987, 2009. Legal terms. | PREVIOUS NEXT |