-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAssociationPosteEmploye_V1.mzn
64 lines (47 loc) · 1.82 KB
/
AssociationPosteEmploye_V1.mzn
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
include "employes_0.dzn";
include "postes_0.dzn";
include "alldifferent.mzn";
%%%%%%%%%%%%%%
% CONSTANTES %
%%%%%%%%%%%%%%
% Constantes globales
int: NB_EMPLOYES;
int: NB_POSTES;
set of int: EMPLOYES = 1..NB_EMPLOYES;
set of int: POSTES = 1..NB_POSTES;
set of int: DIX_COLONNES = 1..10;
set of int: UNE_COLONNE = 1..1;
set of int: NIVEAUX_HIERARCHIQUES = 1..3;
set of int: NIVEAUX_EDUCATION = 1..7;
set of int: NIVEAUX_LANGUES = 1..4;
set of int: TITRES_PROFESSIONNELS = 0..6;
% Constantes des employés
array[EMPLOYES, UNE_COLONNE] of NIVEAUX_HIERARCHIQUES: NIVEAU_HIERARCHIQUE_E;
array[EMPLOYES, DIX_COLONNES] of int: COMP_CLEES_E;
array[EMPLOYES, DIX_COLONNES] of int: AUTRES_COMP_E;
array[EMPLOYES, UNE_COLONNE] of NIVEAUX_EDUCATION: NIVEAU_EDUCATION_E;
array[EMPLOYES, UNE_COLONNE] of TITRES_PROFESSIONNELS: TITRE_PROFESSIONNEL_E;
array[EMPLOYES, UNE_COLONNE] of NIVEAUX_LANGUES: NIVEAU_FR_E;
array[EMPLOYES, UNE_COLONNE] of NIVEAUX_LANGUES: NIVEAU_EN_E;
array[EMPLOYES, DIX_COLONNES] of int: AUTRES_LANGUES_E;
% Constantes des postes
array[POSTES, UNE_COLONNE] of NIVEAUX_HIERARCHIQUES: NIVEAU_HIERARCHIQUE_P;
array[POSTES, DIX_COLONNES] of int: COMP_CLEES_P;
array[POSTES, DIX_COLONNES] of int: AUTRES_COMP_P;
array[POSTES, UNE_COLONNE] of NIVEAUX_EDUCATION: NIVEAU_EDUCATION_P;
array[POSTES, UNE_COLONNE] of TITRES_PROFESSIONNELS: TITRE_PROFESSIONNEL_P;
array[POSTES, UNE_COLONNE] of NIVEAUX_LANGUES: NIVEAU_FR_P;
array[POSTES, UNE_COLONNE] of NIVEAUX_LANGUES: NIVEAU_EN_P;
array[POSTES, DIX_COLONNES] of int: AUTRES_LANGUES_P;
%%%%%%%%%%%%%
% VARIABLES %
%%%%%%%%%%%%%
array[POSTES] of var 0..NB_EMPLOYES: Match;
%%%%%%%%%%%%%%%
% CONTRAINTES %
%%%%%%%%%%%%%%%
constraint forall(p in POSTES) ([COMP_CLEES_E[Match[p], c]| c in DIX_COLONNES] == [COMP_CLEES_P[p, c]| c in DIX_COLONNES]);
%%%%%%%%%%%%
% Objectif %
%%%%%%%%%%%%
solve satisfy;