Some of my variables generate looking like this: Y#0#0#0 + 2 Y#0#0#1 + 3 Y#0#0#2 + They should be Y(111), Y(112), Y(113)

Yet others work ok: For example: W(1) W(2)

Why does this happen?

Also, the objective function has the following variable in it: Slack(15) + x151 The slack variable should be there but the x variable shouldn't. Besides that as mentioned above, the X variables in my model genarate as X#0#4#0.

Of course from a purely theoretical standpoint none of this matters as long as I know what the variables mean. But, it makes it hard to interpret results. Below I have copied the appropriate pieces from my mod file and my dat file.

int NbProducts = ...;

int NbPlates = ...;

int NbPositions = ...;

int MaxPositions = ...;

range Products = 1..NbProducts; // i variable

range Plate = 1..NbPlates; // j variable

range Usage = 1..MaxPositions; // k variable

float Demand[Products] = ...;

float M = 1000000;

dvar float+ Y[Products][Plate][Usage];

dvar int X[Products][Plate][Usage] in 0..1;

dvar int Z[Products][Products][Plate] in 0..1;

dvar float+ TP[Products]; //This variable is just to count total production

dvar float+ Slack[Products]; // This variable is just to report over production

Notice there is no "x" in the objective function:

minimize

sum(i in Products, j in Plate, k in Usage) k * Y[i][j][k] +

sum(i in Products)(1 / Demand[i]) * Slack[i];

Here is the dat file:

NbProducts = 15;

NbPlates = 3;

NbPositions = 8;

MaxPositions = 3;

Demand = [4213,12765,20591,21382,26418,27001,32363,33062,53916,54092,57392,58492,72295,91245,97628]

;

dvar float+ W[Plate]; //This will be used to determine how many times each plate is used