set Actors;
param salary {Actors} >=0;

param sceneCount;
set Scene:=1..sceneCount;

param time{Scene} >=0;

param shooting {Scene, Actors} binary;


param dayCount;
set Days:=1..dayCount;

param hoursADay;


var doScene{Scene, Days} binary;
var actorComeIn{Actors, Days} binary;

#Max forgatási idő
s.t. MaxShootingHoursADay{d in Days}: sum{s in Scene} doScene[s, d] * time[s] <= hoursADay;

#Forgat e a színész
s.t. IfActorActsADay{d in Days, s in Scene, a in Actors: shooting[s,a]==1}: doScene [s, d] <= actorComeIn[a, d];

#Minden jelenet legyen leforgatva
s.t. DoAllScene {s in Scene}: sum{d in Days} doScene[s, d]=1;

minimize CostOfShooting: sum{ d in Days, a in Actors} actorComeIn[a, d] * salary [a];

data;
set Actors:= A B C D E;
param sceneCount:=5;
param dayCount:=10;
param hoursADay:=8;


param salary:=
A 180
B 280
C 250
D 230
E 450
;

param shooting:
	A	B	C	D	E :=
1	1	0	0	0	1
2	0	1	1	1	0
3	1	0	0	1	1
4	0	1	1	0	0
5	0	0	1	1	0
;

param time:=
1	1
2	1.5
3	2.3
4	1.4
5	1.7
;