Reputation: 1
Scheduling output# binary variable assignement in lingo
binary variable assignement in lingo
the schedule is not continuous rather my period start and end time is influencing the batch start and completion time.
SETS:
JOBS:R_TIME,DUE_DATE,PENALTY,PENALTY_TWV,TARDINESS,CT_JOB,TW,TWV,RT_TW,ST_JOB;
FAMILIES:PR_TIME;
BATCHES:CT_BATCH,RT_BATCH,PT_BATCH, TWV_BATCH;
PERIOD:E_COST,P_START,P_END;
D_SET_JF(JOBS,FAMILIES):JF;
D_SET_JB(JOBS,BATCHES):JB;
D_SET_FB(FAMILIES,BATCHES):FB;
ASSIGNED_PB(PERIOD, BATCHES):ASB;
ALLOTED_PB(PERIOD, BATCHES):APB;
yz(PERIOD, BATCHES):z;
D_SET_PS(PERIOD):PS;
D_SET_PE(PERIOD):PE;
ENDSETS
DATA:
T =84;
JOBS=J1,J2,J3,J4,J5,J6;
FAMILIES=F1,F2,F3,F4,F5;
BATCHES=B1,B2,B3,B4,B5,B6;
PERIOD = P1, P2, P3;
R_TIME=5,8,8,4,8,1;
TW = 10,0,8,4,0,0;
E_COST = 3,2,1;
DUE_DATE=39,15,36,56,18,36;
PENALTY=10,4,9,10,5,10;
PENALTY_TWV=20,0,18,20,0,0;
PR_TIME=2,4,10,16,20;
CAPACITY=2;
AVAILABILITY=2;
D_SET_PS, PS =
P1 0
P2 29
P3 57;
D_SET_PE,PE=
P1 28
P2 56
P3 84;
D_SET_JF,JF =
J1 F1 0
J1 F2 0
J1 F3 0
J1 F4 0
J1 F5 1
J2 F1 1
J2 F2 0
J2 F3 0
J2 F4 0
J2 F5 0
J3 F1 0
J3 F2 0
J3 F3 0
J3 F4 1
J3 F5 0
J4 F1 0
J4 F2 0
J4 F3 1
J4 F4 0
J4 F5 0
J5 F1 0
J5 F2 1
J5 F3 0
J5 F4 0
J5 F5 0
J6 F1 0
J6 F2 1
J6 F3 0
J6 F4 0
J6 F5 0;
Objective function;
`MIN= @SUM(PERIOD(p):@SUM(BATCHES(b):ASB(p, b) * E_COST(p))); `
Constraint-18: Total sum of assigned processing time of a batch in all periods is exactly equal to its processing time of the batch;
`@FOR(BATCHES(b):
@SUM(PERIOD(p): ASB(p, b)) = PT_BATCH(b));`
Constraint-19: Assigned processing time of batch in period should be less than or equal to the processing time of the batch;
`@FOR(PERIOD(p):
@FOR(BATCHES(b):
ASB(p, b) <= APB(p, b) * PT_BATCH(b)));`
Constraint-20: sum of processing time assigned to a period should be less than or equal to the duration of the period;
`@FOR(PERIOD(p1):
@SUM(BATCHES(b): ASB(p1, b)) <= 28 - RT_BATCH(1));
@FOR(PERIOD(p2):
@SUM(BATCHES(b): ASB(p2, b)) <= 28);
@FOR(PERIOD(p3):
@SUM(BATCHES(b): ASB(p3, b)) <= 28);`
Constraint-21: a batch is assigned to a period if the release time of the batch falls within the period - here the APB is a binary variable;
how to assign APB(p,b) binary value?
Constraint-22 & 23: Assign binary values to the decision variable;
`@BND(0,P1,28);
@BND(29,P2,56);
@BND(57,P3,84);
@FOR(ALLOTED_PB:@BIN(APB));
@FOR(D_SET_JB:@BIN(JB));
@FOR(D_SET_FB:@BIN(FB)); `
END
the schedule is not continuous rather my period start and end time is influencing the batch start and completion time. i want a continuous schedule without any break
here RT_BATCH(B4)
is 29 rather than 28 similar case with RT_BATCH(B6) is 57 rather than 56
Upvotes: 0
Views: 33