Originally posted by: Moit1910
Hi,
I have a problem with Cplex when I want to divide one parameter by another.
I know that using CPlex it is impossible to divide something by a descision variable, but is it also impossible to divide by a parameter?
My problem in detail:
I have build some kind of a traveling-salesman problem in CPlex where I want CPlex to calculate the time, that elapses when a vehicle v travels from a node i to a node j of a network.
For this I give CPlex two parameters for the distance between i and j ( d[i][j] ) and the velocity of vehicle v ( vel[v] ) respectively.
Now I want CPlex to calculate the travelling times in the objective function as well as in some constraints.
So I added the term d[i][j] / vel[v] wherever I need that time. But when I try to solve the problem CPlex gives me the error "Exception from IBM ILOG Concert: Access value of a non substituted index" in the very first constraint I used that term. Cplex does not mention the term in the objective function but in the first constraint, that is (in the variable tau you have the point of time the vehicle finishes the service at node j, what I need for subtour-elemination, T is the maximum operation time and x is a descision variable that equals one if vehicle v travels from i to j):
forall (i in N : i>=1)
forall (j in N : j==0)
forall (v in V)
tau[j][v] >= tau[i][v] + ( d[i][j] / vel[v] ) - T * ( 1 - x[i][j][v] )
Here is how I declared the parameters/variables:
int StationsAnzahl =...;
range N =0..StationsAnzahl;
int FahrzeugAnzahl =...;
range V =1..FahrzeugAnzahl;
float d[N][N] = ...;
float vel[v] =...;
float T =...;
dvar float+ tau [N][V];
dvar boolean x[N][N][V];
When I exchange this term in the constraint by just one parameter, in with I give CPlex the time that is needed for travelling from i to j (without consideration of the vehicle that is travelling) I get a solution without errors. But I want to use different vehicles with different velocities. So I need this calculation.
Did I make a mistake or is it generally not possible to divide a paramater by another parameter in CPlex?
Thank you for your help in advance.
#DecisionOptimization#OPLusingCPLEXOptimizer