IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Mathématiques Discussion :

[Recherche opérationnelle] Inventory Routing Problem avec CPLEX


Sujet :

Mathématiques

  1. #1
    Membre à l'essai

    Homme Profil pro
    Étudiant
    Inscrit en
    Avril 2016
    Messages
    11
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 36
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2016
    Messages : 11
    Points : 17
    Points
    17
    Billets dans le blog
    1
    Par défaut [Recherche opérationnelle] Inventory Routing Problem avec CPLEX
    Bonsoir

    Je dois résoudre le problème IRP avec Cplex mais je suis novice % a ce logiciel

    j'ai commencé a codé mais je ne sais pas comment inclure une instance de donnée

    Ci joint le modèle mathématique le code que j'ai fait et l'instance de donnée

    S'il y a qq chose pas clair merci de me laisser vos commentaire.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    int n=...;// nombre des sommets 
    int T=...;// Horizon de planification 
     
    tuple arc { 
    int i; int j;
    } 
    setof (arc) arcs = {<i,j> | ordered i,j in 0..n : i!=j};// l'ensemble des arcs 
    float A[arcs] = ...; 
     
    int q[i in 1..n][t in 1..T] = 1;// la quantité de produit livré a un sommet
     
    int I[i in 1..n][t in 1..T] = 2; // niveau de stock a un sommet 
     
    float Q = ...; // la capacité du fournisseur 
     
    int c =...;// la capacité de véhicule 
     
    int t [1..T]=...;// periode temps 
     
    tuple Position {
        key int id;
        int x;
        int y;
      };
     
      tuple Demand {
        key int id;
        int q;
      };
     
      {Position} Positions = ...;
      {Demand} Demands = ...;
     
      {int} Customers = { p.id | p in Positions };
     
      tuple triplet { 
      int c1; 
      int c2; 
      int d; 
      };
     
      {triplet} Dist = { <p1.id,p2.id,(sqrt(pow(p2.x-p1.x,2)+pow(p2.y-p1.y,2)))> | p1, p2 in Positions };
     
      execute {
         writeln(Dist);
      };
     
     
    // Decision variables
     
    dvar boolean y[0..n][0..n][1..T];/* = 1 if the arc (i,j)*/
     
    dvar boolean x[0..n]; /* = 1 if the node j*/
     
    dexpr float Cobj= 
    sum(ordered i,j in 0..n : i!=j)sum(t in 1..T) A[<i,j>]*y[i][j][t]+sum(i in 1..n)sum(t in 1..T) w[i]*x[i][t]+
    sum(i in 1..n)sum(t in 1..T) h[i]*I[i][t]+
    sum(t in 1..T) h[0]*I[0][t] ;
     
     
    //objective function 
     
    minimize Cobj;
     
    //constraints 
     
    subject to{ 
     
    forall (t in 1..T )
    I[0][t]=I[0][t-1]+r[0][t]-sum(i in 1..n)q[i][t]; //Inventory definition at the supplier
     
    forall (t in 1..T )forall (i in 1..n )
    I[i][t]=I[i][t-1]-r[i][t]+q[i][t]; //Inventory definition at the retailers
     
    forall (t in 1..T )forall (i in 1..n )
    I[i][t]>=0; // Stockout constraints at the retailers
     
    forall (t in 1..T )forall (i in 1..n )
    I[i][t]<=U[i]; // Born Sup
     
    forall (t in 1..T )forall (i in 1..n )
    I[i][t]>=L[i]; // Born Inf
     
    forall (t in 1..T )forall (i in 1..n )
    q[i][t]>=U[i]*x[i][t]-I[i][t-1]; // Order-up-to level constraints
     
    forall (t in 1..T )forall (i in 1..n )
    q[i][t]<=U[i]-I[i][t-1]; // Order-up-to level constraints
     
    forall (t in 1..T )forall (i in 1..n )
    q[i][t]<=U[i]x[i][t]; // Order-up-to level constraints
     
    forall (t in 1..T )
    sum(i in 1..n)q[i][t]<=Q; // Capacity constraints
     
     
    forall (t in 1..T )
    sum(i in 1..n)q[i][t]<=Q*x[0][t]; // Routing constraints
     
     
    forall (t in 1..T )forall (i in 1..n )
    sum(j in 1..n : j<i)y[i][j][t]+sum(j in 1..n : j>i)y[j][i][t]=2*x[i][t]; // Routing constraints
     
    forall (t in 1..T )forall (s in 1..n)
    sum(i in 1..n)sum(j in 1..n : j<i)y[i][j][t]<=sum(i in 1..n)x[i][t]-x[s][t]; // Subtours elimination constraints
     
    forall (t in 1..T )forall (i in 1..n )
    q[i][t]<=1; // Nonnegativity and integrality constraints
     
    forall (t in 1..T )forall (i in 1..n )forall (j in 1..n )
    y[i][j][t]<=1;
     
    forall (t in 1..T )forall (i in 1..n )forall (j in 1..n )
    y[i][j][t]>=0;
     
    forall (t in 1..T )forall (i in 1..n )
    x[i][t]<=1;
     
    forall (t in 1..T )forall (i in 1..n )
    x[i][t]>=0;
     
    forall (t in 1..T )forall (j in 1..n )
    y[0][j][t]<=2;
     
    forall (t in 1..T )forall (j in 1..n )
    y[0][j][t]>=0;
     
    };
    execute { 
    writeln ("objectif=", Cobj) 
    }
    les données :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
      TYPE:	ORDER-UP-TO-LEVEL-TSP
     COMMENT: NODE 1 REPRESENTS THE SUPPLIER
     COMMENT: THE QUANTITY ABSORBED BY RETAILER AND THE
              QUANTITY MADE AVAILABLE AT THE SUPPLIER 
              ARE CONSTANT OVER TIME
     TRANSPORTATION-COST-TYPE: EUC_2 (T(i,j)=
      T(J,I)=INT((SQRT((X(I)-X(J))**2+(Y(I)-Y(J))**2))+.5)
     
     DIMENSION:        6
     HORIZON:          3
     CAPACITY:       600
     id_SUPPLIER    x_COORD_STARTING    y_COORD_STARTING    STARTING LEVEL   QUANTITY MADE AVAILABLE    COST
       1                 436.0               498.0               1120                 2628              .30
      id    x_COORD_STARTING  y_COORD_STARTING   LEVEL  LEVEL_MAX LEVEL_MIN  QUANTITY_ABSORBED    COST
       2       391.0                96.0          84       168        0              84           .23
       3       268.0               146.0         166       249        0              83           .32
       4       358.0               133.0         112       168        0              56           .33
       5        12.0               256.0         170       255        0              85           .23
       6       165.0               108.0          98       147        0              49           .18
    Fichiers attachés Fichiers attachés

Discussions similaires

  1. Réponses: 6
    Dernier message: 25/02/2011, 10h45
  2. probleme avec des filtres de recherche sur des dates
    Par MCarole dans le forum Access
    Réponses: 2
    Dernier message: 24/07/2006, 10h22
  3. Réponses: 4
    Dernier message: 25/04/2006, 11h10
  4. Réponses: 3
    Dernier message: 18/03/2006, 19h51
  5. Réponses: 2
    Dernier message: 10/10/2005, 02h25

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo