> Languages and APIs > ILOG Concert Technology for C#.NET Users > Describe |
Describe |
INDEX PREVIOUS NEXT |
The aim of this tutorial is build a simple application with ILOG CPLEX and Concert Technology for .NET users. The tutorial is based on the well known diet problem: to minimize the cost of a daily diet that satisfies certain nutritional constraints. The conventional statement of the problem assumes data indicating the cost and nutritional value of each available food.
The finished application accepts a filename and two options -c
and -i
as command line arguments. Option -i
allows you to create a MIP model where the quantities of foods to purchase must be integers (for example, 10 carrots). Otherwise, the application searches for a solution expressed in continuous variables (for example, 1.7 kilos of carrots). Option -c
can be used to build the model by columns. Otherwise, the application builds the model by rows.
The finished application starts by evaluating the command line arguments and reading the input data file. The input data for this example is the same data as for the corresponding C++ and Java examples in this manual. The data is available in the standard distribution at:
yourCPLEXhome\examples\data\diet.dat
Step 1 - | Describe the Problem |
Write a natural language description of the problem and answer these questions:
The amount of nutrition provided by a given quantity of a given food.
The cost per unit of food.
The upper and lower bounds on the foods to be purchased for the diet
The quantities of foods to buy.
The food bought to consume must satisfy basic nutritional requirements.
The amount of each food purchased must be within its bounds
Minimize the cost of food to buy
Step 2 - | Open the file |
Open the file yourCPLEXhome\examples\src\tutorials\Dietlesson.cs
in your integrated development environment, such as Microsoft Visual Studio. Then go to the comment Step 2 in Dietlesson.cs
, and add the following lines to declare a class, a key element of this application.
The input data of the diet problem is read from a file into an object of the nested class Diet.Data
. Its constructor requires a file name as an argument. Using an object of the class InputDataReader,
your application reads the data from that file.
Copyright © 1987-2003 ILOG, S.A. All rights reserved. Legal terms. | PREVIOUS NEXT |