Question: when I run this code: % Variables and Constants Declaration int: n _ employee; % Number of technicians int: n _ turbine; % Number of

when I run this code: % Variables and Constants Declaration
int: n_employee; % Number of technicians
int: n_turbine; % Number of turbines
int: n_tasks; % Number of tasks
int: n_period; % Number of periods per day
int: n_week; % Number of weeks
int: n_day; % Number of days per week
int: n_skills; % Number of skills
array[1..n_turbine, 1..n_period] of float: productivity; % Productivity of turbine t during period p
array[1..n_tasks] of int: on_turbine; % Turbine assigned to task i
array[1..n_tasks] of int: length; % Duration of task i in periods
array[1..n_employee, 1..n_skills] of int: skills; % Skill availability matrix (0 or 1)
array[1..n_tasks] of int: skill_req; % Required skill for each task (single integer)
% Decision Variables
array[1..n_tasks] of var 1..n_period: Start_time; % Start time of task i
array[1..n_tasks] of var 1..n_period: End_time; % End time of task i
array[1..n_turbine] of var float: Loss_turbine; % Productivity loss for turbine t
array[1..n_tasks, 1..n_period] of var bool: Task_active; % Task activity during period p
array[1..n_turbine, 1..n_period] of var bool: Turbine_active; % Turbine activity during period p
array[1..n_employee, 1..n_tasks] of var bool: Assign; % Technician assignment to tasks
% Objective Function: Maximize total productivity accounting for losses
solve maximize sum(t in 1..n_turbine, p in 1..n_period)(
productivity[t, p]* Turbine_active[t, p]
)- sum(t in 1..n_turbine)(
Loss_turbine[t]
);
% Constraints
% Task activity definition
constraint forall(i in 1..n_tasks, p in 1..n_period)(
Task_active[i, p]= bool2int(Start_time[i]<= p /\ p <= End_time[i])
);
% Turbine activity definition
constraint forall(t in 1..n_turbine, p in 1..n_period)(
Turbine_active[t, p]= bool2int(sum([Task_active[i, p]| i in 1..n_tasks where on_turbine[i]= t])>0)
);
% No overlapping tasks on the same turbine
constraint forall(t in 1..n_turbine, p in 1..n_period)(
sum([Task_active[i, p]| i in 1..n_tasks where on_turbine[i]= t])<=1
);
% Technician constraints
constraint forall(p in 1..n_period)(
sum([Assign[k, i]* Task_active[i, p]| i in 1..n_tasks, k in 1..n_employee])<= n_employee
);
% Skill requirements for technician assignment
constraint forall(i in 1..n_tasks, k in 1..n_employee)(
Assign[k, i]->(skills[k, skill_req[i]]=1)
);
% Duration calculation
constraint forall(i in 1..n_tasks)(
length[i]= End_time[i]- Start_time[i]
);
% Productivity loss calculation
constraint forall(t in 1..n_turbine)(
Loss_turbine[t]= sum(p in 1..n_period)(
(1- Turbine_active[t, p])* productivity[t, p]
)
);
% Tasks must avoid periods that are multiples of 3
constraint forall(i in 1..n_tasks, p in 1..n_period)(
(p mod 3=0)->(Task_active[i, p]=0)
);
when I run the above code in minizinc base on the below data value it shown me unsatisfable , please could you support me to align the code with the below data value: n_employee =6;
n_turbine =8;
n_tasks =19;
n_week =1;
n_day = n_week*5;
n_period = n_day*3;
productivity = array2d(1..n_turbine,1..n_period, [5,7,7,2,3,2,3,2,2,4,8,5,4,7,6,
6,5,6,3,3,2,2,4,3,5,7,3,5,6,5,
5,5,6,2,4,3,3,3,3,4,8,2,4,7,6,
5,6,5,3,3,2,2,2,2,6,6,4,6,8,7,
7,7,8,2,2,2,3,3,2,4,8,2,4,7,6,
6,5,6,4,3,4,4,2,3,4,6,3,5,6,8,
5,5,7,2,2,4,4,3,2,5,7,2,6,6,5,
6,7,7,2,3,3,3,2,2,6,8,4,4,7,6]);
on_turbine = array1d(1..n_tasks,[1,1,1,2,2,2,3,3,3,4,4,5,5,6,6,7,7,8,8]);
length = array1d(1..n_tasks,[3,1,4,3,1,4,3,1,2,3,2,3,2,3,2,3,2,3,2]);
n_skills =3;
%skills[i,j] indique si le technicien i a le skill j
skills = array2d(1..n_employee,1..n_skills,[1,1,1,
1,0,1,
1,1,0,
0,1,1,
0,1,1,
1,0,0]);
%indique quel skill est requis pour quelle tche
skill_req = array1d(1..n_tasks,[1,1,1,2,1,2,3,1,2,3,2,3,2,3,1,1,2,3,2]);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!