Step 7: Create the variables: build and populate by rows

Shows lines to create variables for this example.

Go to the comment Step 7 in Dietlesson.cs , and add the following lines to create a loop that creates the variables of the problem with the bounds specified by the input data.


      for (int j = 0; j < nFoods; j++) {
         Buy[j] = model.NumVar(data.foodMin[j], data.foodMax[j], type);
      }