mercredi 15 mars 2017

"No value" for decision variables and the objective function of my CPLEX optimization program

I have a problem which I couldnt debug till now. I programmed a normal MILP (Mixed integer linear program) which does not give me any values for the decision variables or the objective funktion. I really have no clue what could be wrong. If anybody could know what the reason could be.... please let me know.

I will post my program in here :

using CP;

 //Sets
 {int} J = ...;          
 {int} T = ...;           
 int nbN = ...;         
 range N = 1..nbN;         


//Parameter
 int c[J] = ...;       
//float w[T] = ...;       
 int o[J] = ...;       
//float A[J] = ...;        
//float a[J][T] = ...;      
int f[T] = ...;           
int r[T] = ...;          
int g[J] = ...;           
int p[T] = ...;           
//float d[J][T] = ...; 
int d1[J][T] = ...;      
int d2[J][T] = ...;    
int b[J][N] = ...;       
float K = ...;          
float Q = ...;            
float M = ...;            

{int} T0=T union {0};

//Ladefunktion-Parameter
float kL = ...;           
float s = ...;          
float PL = ...;          
float nL = ...;          
float W  = ...;        
float u  = ...;        
 //Entscheidungsvariablen
dvar int+ x[J][T];       
dvar int+ theta[J][T];   
dvar int+ z[T0];        
dvar boolean y[J][T];    
dvar boolean q[T];        

dexpr float Ladekosten = sum(j in J, t in T) ((x[j][t]*c[j])*y[j][t]+theta[j][t]*g[j]);
dexpr float Eroeffnungskosten = sum(j in J, t in T) (y[j][t]*o[j]);

//Zielfunktion 
minimize Ladekosten + Eroeffnungskosten;

//Nebenbedingungen 
constraint ctLadezeit[T];              
constraint ctBatteriebilanz[T];           
constraint ctMinimumBatterie[T];       
constraint ctLadefahrten[J][T];            
constraint ctBatterieKapazitaet[T];         
constraint ctKundenabholung[T];              
constraint ctMinuten[J][T][N];              
constraint ctLadestationKapazitaet[J][T];   
constraint ctLadeEntscheidung[T];          


subject to{
    forall (t in T) ctLadezeit[t]:
        sum(j in J) x[j][t] == sum(j in J)(p[t] - f[t] - d[j][t] - theta[j][t])*y[j][t];


    z[0] == 20; 
    ctBatteriebilanz1:
        //z[1] == (z[0]/u + (((PL*exp(s*(((z[1]/u)/Q)/kL)*100))/W * sum(j in J)x[j][1]*nL)/Q) - sum(j in J) (d[j][1]*y[j][1]) - r[1]*q[1] - f[1])*u;
        z[1] == z[0] + sum(j in J)x[j][1]*y[j][1] - sum(j in J) (d[j][1]*y[j][1]) - r[1]*q[1] - f[1];
    forall (t in T: t!=1) ctBatteriebilanz[t]:
        //z[t] == (z[t-1]/u + (((PL*exp(s*(((z[t-1]/u)/Q)/kL)*100))/W * sum(j in J)x[j][t]*nL)/Q) - sum(j in J) (d[j][t]*y[j][t]) - r[t]*q[t] - f[t])*u;
        z[t] == (z[t-1] +  sum(j in J)x[j][t]*y[j][t] - sum(j in J) (d[j][t]*y[j][t]) - r[t]*q[t] - f[t]);
    forall (t in T) ctMinimumBatterie[t]:
        z[t] == f[t] + sum(j in J) d1[j][t] * y[j][t] + r[t]*q[t];

    forall (j in J, t in T) ctLadefahrten[j][t]:
        d[j][t] == d1[j][t] + d2[j][t];

    forall (t in T) ctBatterieKapazitaet[t]:
        z[t] <= K;

    forall (t in T) ctKundenabholung[t]:
        p[t] >= f[t] + sum(j in J) (x[j][t] + d[j][t] + theta[j][t])*y[j][t] + r[t]*q[t];


    forall (t in T,  n in N, j in J) ctMinuten[j][t][n]:
        sum(k in (f[t]+d1[j][t])..(p[t]-d2[j][t])) b[j][k] >= (1-y[j][t])*M; 

    /*forall (j in J, t in T) ctLadestationKapazitaet[j][t]:
        a[j][t] + y[j][t] <= A[j]; */

    forall (t in T) ctLadeEntscheidung[t]:
        sum(j in J) y[j][t] + q[t] == 1;

}

If you need the .dat file as well please let me know....




Aucun commentaire:

Enregistrer un commentaire