0% found this document useful (0 votes)
6 views4 pages

Drivers Planning

Uploaded by

Amir Manshourian
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

Drivers Planning

Uploaded by

Amir Manshourian
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

There is an assumption that states each biker can transport a maximum of 4 orders per hour.

Therefore, we can expect a biker to fulfill up to 4 delivery requests within one hour of his schedule.

Sets
I Set of possible shifts
J Set of hours

Parameters
𝑎𝑖𝑗 Presentation planning of hired biker 𝑖 ∈ 𝐼 at hour 𝑗 ∈ 𝐽
𝑑𝑗 demand for hour 𝑗 ∈ 𝐽

Decision making variables


𝑌𝑖 If the company accepts a biker from type 𝑖 ∈ 𝐼 it equals one, if else quals zero.
𝑋𝑖 Count of bikers which belong to 𝑖 ∈ 𝐼 group
𝐼𝑁𝑉𝑗 The extra presenting of bikers at hour 𝑗 ∈ 𝐽
𝐵𝑗 The amount of demand for hour 𝑗 ∈ 𝐽 which has not satisfied

Objective function and constraints


(1)
Ma x 𝑍 = ∑ 𝑋𝑖 + ∑ 𝐼𝑁𝑉𝑗 + ∑ 𝐵𝑗
𝑖 𝑗 𝑗

𝑋𝑖 ≤ 𝑀 𝑌𝑖 ∀𝑖 ∈ 𝐼 (2)

∑𝑖 𝑎𝑖𝑗 𝑋𝑖 = 𝑑𝑗 + 𝐼𝑁𝑉𝑗 − 𝐵𝑗 ∀𝑗 ∈ 𝐽 (3)

The objective function (1) tends to minimize the cost of hiring bikers and penalty of
extra or less presenting the bikers. Relations (2) determine the upper bound of hiring
bikers from kind 𝑖 ∈ 𝐼 . Relations (3) demonstrate the value of less or extra presenting
in each hour 𝑗 ∈ 𝐽 .

1
Sample date
Our demand in each hour is described as below:
𝑗9 𝑗10 𝑗11 𝑗12 𝑗13 𝑗14 𝑗15 𝑗16 𝑗17 𝑗18 𝑗19 𝑗20 𝑗21
20 30 40 20 10 30 5 15 5 0 0 0 0

Moreover, the presentation planning of paid bikers is shown in the below table.
shift 𝑗9 𝑗10 𝑗11 𝑗12 𝑗13 𝑗14 𝑗15 𝑗16 𝑗17 𝑗18 𝑗19 𝑗20 𝑗21
𝑖1 1 1 1 1 1 1 1 1 0 0 0 0 0
𝑖2 0 0 0 0 0 1 1 1 1 1 1 1 1
𝑖3 1 1 1 1 1 1 1 1 1 1 1 1 1
𝑖4 1 1 1 1 0 0 0 0 0 0 0 0 0
𝑖5 0 0 1 1 1 1 0 0 0 1 1 1 1
𝑖6 0 0 0 0 0 0 0 0 0 1 1 1 1
𝑖7 0 0 1 1 1 1 1 1 1 1 1 1 0

It says if you hire a biker from shift 𝑖1 ,he must be present for these hours
(𝑗9 , 𝑗10 , … , 𝑗16 )

Code
SETS
i /i1*i7/ ,
j /j9,j10*j21/ ;

table a(i,j)
j9 j10 j11 j12 j13 j14 j15 j16 j17 j18 j19 j20 j21
i1 1 1 1 1 1 1 1 1 0 0 0 0 0
i2 0 0 0 0 0 1 1 1 1 1 1 1 1
i3 1 1 1 1 1 1 1 1 1 1 1 1 1
i4 1 1 1 1 0 0 0 0 0 0 0 0 0
i5 0 0 1 1 1 1 0 0 0 1 1 1 1
i6 0 0 0 0 0 0 0 0 0 1 1 1 1
i7 0 0 1 1 1 1 1 1 1 1 1 1 0

2
;

PARAMETER
d(j) /j9 20,j10 30,j11 40,j12 20,j13 10,j14 30,j15 5,j16 15,j17 5,j18 0,j19 0,j20 0,j21 0/ ;

binary variable
y(i) ;

free variable
z;

integer variable
x(i) ;

positive variable
inv(j) , b(j), axilary(i,j) ;

equations
of
c1
c2
;

of.. z =e= sum(i , x(i)) + sum(j , inv(j) + b(j) ) ;


c1(i).. x(i) =l= 100 * y(i) ;
c2(j).. sum(i , x(i)*a(i,j) ) =e= d(j) + inv(j) - b(j) ;

3
model ali /all/;
option reslim=3000000000000000 ;
option optcr=0;
option threads=0;
*option minlp = bonmin;
option mip = cplex ;

solve ali using mip minimizing z;


display z.l , x.l , inv.l , b.l ;

You might also like