Originally posted by: SystemAdmin
I am new to CPLEX so my apologies if I am missing something obvious.
Here is a reduced version of my problem:
I would like to index arrays in my objective function with the values of the decision variables. However, when I tried to do it I get: "Indexing array "Q" with type dvar int not supported by this algorithm." error. So, I tried to work around with a separate int variable "t" but this results in an unexpected outcome: instead of a positive value of the objective function (which is expected because we are maximizing a sum of products of positive values) the solver returns zero because all rows and columns are eliminated at the pre-solve stage.
When I tried to force the first value of "t" the solver reported infeasibility.
There will be more constraints imposed on the decision variables once the problem of using it as an index for defined arrays is resolved.
Any help will be much appreciated.
int k = 144;
range time = 1..k;
range time0 = 0..k;
int Qmax = 400;
range states = 0..Qmax;
float Q
statesstates = ...; //non negative values read from the data file
float P
time=...; //non-negative values read from the data file
int t
time0; //I had to introduce this variable because d can not act as an index for Q
dvar int d
time0 in states;
maximize
sum(k in time) P[k]*Q[t
k-1][t
k]; //sum of products of positive values
subject to {
forall(k in time0) t[k]==d[k];
}
#DecisionOptimization#OPLusingCPLEXOptimizer