Presenting the covering example
Summarizes the problem and explains what to do and where to find the files.
The covering example is described
in detail in Set covering in the Language
User’s Manual. This section assumes that you are familiar with
this integer programming problem and the solving strategy as explained
in that document. Here is a summary of the problem.
A set covering problem involves selecting items to fill (cover) a need. In this case, the need is to build a house and the items are workers. The construction of a house can be divided into a number of tasks, each requiring one or more skills, such as plumbing or masonry. A worker may or may not be able to perform a task, depending on his or her skills, and the cost of hiring a worker also depends on his or her skills (qualifications). The problem consists of selecting a set of workers to perform all tasks, while minimizing the cost. A 0/1 variable is associated with each worker to represent whether or not the worker is hired.
The file covering.mod contains the postprocessing script which manipulates the results data to show the resulting crew of hired workers. See Figure 1.
A postprocessing script is encapsulated in an execute statement:
execute {
...
}
The execute statement for postprocessing
must follow the objective function in the model file.
What you are going to do
Working from the covering example described previously, you will:
set up the model and data: see Setting up the covering model and data
run the default configuration, including the postprocessing script, as explained in Executing a postprocessing script, and then:
examine the Scripting Log tab
change an OPL Language option
rerun the model and see the difference in the Scripting Log tab
Where to find the files
The covering example is supplied in the covering project, at the following location:
<Install_dir>\opl\examples\opl\covering
where <Install_dir> is your
installation directory.
The model for the covering project is contained in the file covering.mod. Data for the model covering.mod is contained in the file covering.dat.
You will open this OPL project and all projects in these tutorials using the New Example wizard, which allows you to open and work with a copy of the distributed example, leaving the original example in place. If you need a reminder of how to use the New Example wizard, see Opening distributed examples in the CPLEX Studio IDE.