Академический Документы
Профессиональный Документы
Культура Документы
Optimization Studio
Virginie Gabrel -
Modélisation et
résolution de pbs en RO
1 2013-2014 Master ID
Solveurs et Modeleurs
2 2013-2014 Master ID
Cplex Optimization Studio
3 2013-2014 Master ID
{string} Essence={"EA","EB"};
{string} Constituant={"C1","C2","C3"};
subject to {
0.7*x["EA"]["C1"] - 0.3*x["EA"]["C2"] - 0.3*x["EA"]["C3"] <= 0;
0.4*x["EA"]["C1"] - 0.6*x["EA"]["C2"] + 0.4*x["EA"]["C3"] <= 0;
-0.5*x["EA"]["C1"] - 0.5*x["EA"]["C2"] + 0.5*x["EA"]["C3"] <= 0;
0.5*x["EB"]["C1"] - 0.5*x["EB"]["C2"] - 0.5*x["EB"]["C3"] <= 0;
0.1*x["EB"]["C1"] - 0.9*x["EB"]["C2"] + 0.5*x["EB"]["C3"] <=0;
x["EA"]["C1"] + x["EB"]["C1"] <= 3000;
x["EA"]["C2"] + x["EB"]["C2"] <= 2000;
x["EA"]["C3"] + x["EB"]["C3"] <= 4000;
};
6 2013-2014 Master ID
Exemple raffinerie : solution
7 2013-2014 Master ID
Essence={"EA","EB"};
Constituant={"C1","C2","C3"};
nbCont=5;
coefObj=[[2.5,-0.5,1.5],[1.5,-1.5,0.5]];
coefCont=[
[[0.7,-0.3,-0.3],[0,0,0]],
[[0.4,-0.6,0.4],[0,0,0]],
[[-0.5,-0.5,0.5],[0,0,0]],
[[0,0,0],[0.5,-0.5,-0.5]],
[[0,0,0],[0.1,-0.9,0.1]]];
Dispo=[3000,2000,4000];
9 2013-2014 Master ID
10 2013-2014 Master ID
Traduction en .mod du format
général
int n,m;
float c[1..n]=...;
float b[1..m]=...;
float a[1..m][1..n]=...;
11 2013-2014 Master ID
//Paramètres
{string} machine = ...;
{string} tache = ...;
{string} tacheMachine[tache]= ...;
int nbConflit=...;
range rgConflit=1..nbConflit;
tuple Conflit{
string tache1;
string tache2;
string machine;
}
Conflit conf[rgConflit]=...;
//Variables
dvar boolean tacheToMachine[tache][machine];
12 2013-2014 Master ID
Le problème d’affectation sous OPL
Le fichier .mod
//Fonction Objectif
dexpr int NbreTache=sum(t in tache, m in tacheMachine[t])
tacheToMachine[t][m];
maximize NbreTache;
//Constraints
subject to {
forall(t in tache) //Une machine par tache
ctTache:
sum( m in tacheMachine[t])
tacheToMachine[t][m] <= 1;
forall(t in rgConflit) //Conflit
ctConlit:
tacheToMachine[conf[t].tache1][conf[t].machine] +
tacheToMachine[conf[t].tache2][conf[t].machine] <= 1;
13 } 2013-2014 Master ID
machine = {"M1","M2","M3"};
tache = {"T1","T2","T3","T4","T5"};
tacheMachine=[
{"M1","M2","M3"},
{"M2","M3"},
{"M1","M2","M3"},
{"M2","M3"},
{"M2"}];
nbConflit=9;
conf=[<T2,T3,M2>,<T2,T3,M3>,<T2,T4,M2>,<T2,T4,M3>,
<T2,T5,M2>,<T3,T4,M2>,<T3,T4,M3>,<T3,T5,M2>,
<T4,T5,M2>];
14 2013-2014 Master ID