-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathType_inventory.sce
More file actions
40 lines (40 loc) · 1.02 KB
/
Type_inventory.sce
File metadata and controls
40 lines (40 loc) · 1.02 KB
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
reorder_point=[125,125,150,175,175]
reorder_quantity=[150,250,250,250,300]
carrying_cost=0.75
goodwill=2
perunit_cost=16
reorder_cost=70
total_cost=[0,0,0,0,0]
a=grand(30, 1, "uin", 0, 99)
for k=1:5
rp=reorder_point(k)
rq=reorder_quantity(k)
quantity=115
reordered=0
time=0
for i=1:30
if a(i)<=quantity then
quantity=quantity-a(i)
else
quantity=0
total_cost(k)=total_cost(k)+(goodwill+perunit_cost)*(a(i)-quantity)
end
if quantity<=rp then
if reordered==0 then
reordered=1
total_cost(k)=total_cost(k)+reorder_cost
else
if time==3 then
quantity=rq
time=0
reordered=0
else
time=time+1
end
end
end
total_cost(k)=total_cost(k)+(quantity*carrying_cost)
end
end
disp("total cost of all 5 policies")
disp(total_cost)