IBM ILOG Solver User's Manual > Extending the Library > Writing a Search Limit: Car Sequencing > Writing a search limit: Car sequencing

You will now write a custom search limit for a car sequencing problem. Apart from the custom search limit, the problem is that same as that modeled in Chapter 6, Using the Distribute Constraint: Car Sequencing.

Note
This is a simplified version of the car sequencing problem that appears in Chapter 18, Writing a Goal: Car Sequencing.

Assume that you have 8 cars to paint in three available colors: green, yellow, and blue. Due to technical limitations on the assembly line, no more than three cars can be painted green, exactly three cars must be painted yellow, and no more than two cars can be painted blue. The first car off the assembly line cannot be painted green.

You will add a search limit that stops the search after two solutions have been found that contain a sequence where the sixth car is green.

Note

This example implements this unusual limit to demonstrate the fact that the limit behavior is completely customizable.