i'm a newbie using CPLEX Studio IDE 12.8.0 (built on eclipse), i'm trying to write my 1st model. i watched youtube videos and started coding an assignment workforce problem according to their tasks proficiency into 5 teams, i have 3 questions :
1-how to get rid of the errors,in the declaration of the objective function
// parameters
int n=...; //number of operators
int m=...; //number of tasks
int w=...; //number of teams
range operateurs= 1..n; //intervalle des opérateurs
range taches = 1..m; // varier les taches
range equipes = 1..w; // varier les équipes
int notation[operateurs][taches];
dvar boolean affectation[operateurs][taches][equipes];
**Maximize Sum (i in operateurs, j in taches, k in equipes) affectation[i][j][k]*notation[i][j];**
subject to {
forall (i in operateurs,j in taches)
unicite_aff_eq:
sum (k in equipes) affectation[i][j][k]== 1;
forall (k in equipes,i in operateurs)
unicite_aff_tache:
sum (j in taches)affectation[i][j][k]== 1;
forall (k in equipes,j in taches)
contenir_opp:
sum (i in operateurs) affectation[i][j][k]>= 1;
forall (i in operateurs,j in taches,k in equipes)
competence:
sum (i in operateurs,j in taches)
affectation[i][j][k]*notation[i][j]>=6;
}
2- can you give me a hand with modeling this constraint:
//constraint that i did not know to modele it
if (affectation[i][j][k]==1)
//at least there is notation[i][j]>=3;
here's the .dat file
n=56;
m=6;
w=5;
SheetConnection my_sheet ("affectation.xlsx");
notation from sheetread(my_sheet,"notation");
3-how can i make the declaration to import the notation table from excel.
i will be grateful if you can help me guys thanks in advance
her's the error message that i get on the objective function declaration line (Maximize Sum (i in operateurs, j in taches, k in equipes) affectation[i][j][k]*notation[i][j];** ) //Description Ressource Chemin d'accès Emplacement Type syntax error, unexpected (identifier), expecting ';' affectation-Opérateur.mod /affectation-Opérateur 20:59-67 C:/Users/ToualbiaMohamed Lies/opl/affectation-Opérateur/affectation-Opérateur.mod Problème de structure du modèle OPL// with notation underlined in red. so i wonder what i did wrong and if it's possible tu multiply a matrix by a cube (should make a declaration about the number of teams in the .dat file)