This document is an internship report submitted by Shashi Ranjan summarizing their work developing a Manpower Demand Simulator tool for APL Logistics India Pvt Ltd during a summer internship. The tool uses a News-Vendor model and VBA in Excel to simulate workforce needs on an hourly basis based on order volumes and productivity data, in order to calculate the optimal permanent staffing levels needed over a year to minimize costs. The report describes collecting data on order trends, developing inputs on productivity, running simulations to account for randomness, and analyzing results to determine the best permanent headcount for minimizing total wages and overtime expenses.
This document is an internship report submitted by Shashi Ranjan summarizing their work developing a Manpower Demand Simulator tool for APL Logistics India Pvt Ltd during a summer internship. The tool uses a News-Vendor model and VBA in Excel to simulate workforce needs on an hourly basis based on order volumes and productivity data, in order to calculate the optimal permanent staffing levels needed over a year to minimize costs. The report describes collecting data on order trends, developing inputs on productivity, running simulations to account for randomness, and analyzing results to determine the best permanent headcount for minimizing total wages and overtime expenses.
This document is an internship report submitted by Shashi Ranjan summarizing their work developing a Manpower Demand Simulator tool for APL Logistics India Pvt Ltd during a summer internship. The tool uses a News-Vendor model and VBA in Excel to simulate workforce needs on an hourly basis based on order volumes and productivity data, in order to calculate the optimal permanent staffing levels needed over a year to minimize costs. The report describes collecting data on order trends, developing inputs on productivity, running simulations to account for randomness, and analyzing results to determine the best permanent headcount for minimizing total wages and overtime expenses.
I express my sincerest gratitude to Mr. Bennet Nelson Panikacherry (GM- Global Solutions Centre), Mr. Deepak Tiwari (Head, Contract Logistics), Mr. Amit Gourwar (Sr. Manager, Global Logistics Centre), Ms. Poorvi Kumar (Logistics Engineer), Mr. Michael Pangaraj (Logistics Engineer) and Mr. Desh Deepak Shakya (Logistics Engineer) for their valuable guidance throughout the summer internship. The quality of this work owes a great deal to the help rendered by them and their critical reviews through various stages of this project.
Special Thanks to Mr. V.V.N. Prasad( Manager-Admin & Procurement) and Mr. Sagar Hulyalkar( Sr. Manager-HR) for their kind co-operation and making me comfortable during the entire duration of this project.
Finally, Thanks to APL Logistics (India) Pvt. Ltd. for giving me such a nice opportunity to work with the solution team which helped me in learning the implementation of knowledge and skill on real world problems.
About APL Logistics APL Logistics provides international, integrated supply chain services in 50 countries, including both origin and destination service such as freight consolidation, warehousing and distribution management. With 4,500 professionals in 260 locations globally, APL Logistics offers consulting solutions and uses IT for maximum supply chain visibility and control. APL Logistics is a unit of Singapore-based Neptune Orient Lines (NOL). Services International Logistics Services: Multi-modal transportation services include: o Air-Sea Services o Global Freight Solutions o Origin/Destination Consolidation o Purchase Order, Vendor and Invoice Management o Shipment Planning/Key Performance Indicator (KPI) Reporting/Analytics o Time Definite ServicesOcean Guaranteed LCL Service Land Transport Services: Optimizes customers' domestic transportation network through: o Intermodal Services o Highway Services o Managed Transportation Services o Information Technology Solutions o Engineering Solutions Contract Logistics: Operates a global network of facilities that provide: o Warehousing and Order Fulfilment o Inbound Logistics o Value-added Services o Manufacturing Support o Vendor Managed Inventory o Distribution Management Automotive Logistics: Supports lean manufacturing and distribution activities via: o Inbound Parts Logistics o Finished Vehicle Logistics o Service Parts Distribution o North American Free Trade Agreement o Intermodal Services o Emerging Markets Logistics
Introduction Many times it is observed that the manpower working in warehouses are free and many times they are doing overtime, In both the cases company is not able to utilize the manpower resource at its best. The APL Solution team wanted me to develop a tool in excel to calculate the optimum level of manpower required to finish all the work within a permissible time while minimizing the loss caused due to overtime and unused monthly salary. In warehouse the time required to finish any activity depends upon the volume of reference and the ability of manpower. The volume of reference varies time to time and activity to activity. I segmented the working hours in one hour slots and took the assumption that the activities are reiterating every hour and finished within that one hour slot. As the volume of reference changes every hour, the manpower required to meet our assumption will be different as well. The arrival of volume of reference follows poissons distribution which is just as the arrival of bus at a bus stop. So, I calculate the average volume of references every hour and then generating the data with the help of simulation many times to consider the randomness and minimize the effect caused due to the random nature. After that I need the information about the ability of manpower which can be gathered with the previous observation. Having generated volume of reference and gathered the ability of manpower its easy to calculate the manpower required every hour to finish the activities. Now our problem is quite similar to News-Vendor model which is discussed later. This tool is designed in vba excel which can be run on any computer and is much user-friendly. I run the F&N data on this tool, it took 1hr 25min to calculate the various permanent manpower required for one year. Internship Report on Manpower Demand Simulator At APL Logistics (India) Pvt. Ltd Shashi Ranjan Intern, APL Logistics (India) Pvt. Ltd. - 6 -
Objective This tool is designed to to calculate the optimum level of permanent employee required in warehouse to perform all the activities in providing the logistics facilities to the client at the minimum cost. Approach The 1 st question raised in my mind why do I need to calculate the optimum level. Well, lets understand this with an example- Ive hired 22 people to finish any work in a hour while I receive a work which can be finished by 20 people only in a hour. That means I am incurring fixed cost on 2 employee who are unused. If Ive hired 18 people my work would remain due next hour. After all Ive to fulfill the clients requirement, that work must be completed. So I need to pay overtime to get that work done. That overtime per manpower is always greater that the fixed cost incurred on a manpower. So I need to calculate the permanent manpower for a year for which the total fixed cost + overtime cost will be minimum for the year. In warehouse the time required to finish any activity depends upon the volume of reference and the ability of manpower. The volume of reference varies time to time and activity to activity. I segmented the working hours in one hour slots and took the assumption that the activities are reiterating every hour and finished within that one hour slot. As the volume of reference changes every hour, the manpower required to meet our assumption will be different as well. Once Ive calculated the manpower required every hour I need to calculate the optimum level for a year. I used New-Vendor model on this problem to meet my objective. To apply New-vendor model we must have the information to calculate the manpower required every hour. In the previous section Ive mentioned that the required manpower depends upon the arrival of volume of reference per hour and the productivity of manpower to finish the activity. From the previous observation the APL team has seen that the volume of reference follows certain trend which varies monthly, weekly, daily and hourly. The team also expects 15% growth next year. With the help of trend and growth rate i generate arrival of demand/order every hour. Now I require a productivity sheet which will give me the productivity of manpower with different activities which would help me in calculating the manpower required per hour.
Internship Report on Manpower Demand Simulator At APL Logistics (India) Pvt. Ltd Shashi Ranjan Intern, APL Logistics (India) Pvt. Ltd. - 7 - News-Vendor Model This model helps the vendor in deciding how many newspaper he should supply to the market in order to maximize his profit as the demand of market varies everyday. Lets understand this with an example- The news-vendor collected the previous 100 days demand of market
Procurement cost = 1.5 Selling price = 3 Scrap price =0.25 Profit per newspaper =1.5 Loss per newspaper = 1.25 Expected loss(x) expected loss if he supplies x newspaper Expected loss(20) = 1.5 *{P(21)*(21-20) + P(22)*(22-20) + P(23)*(23-20)} = 2.025 Expected loss(21) = 1.25*P(20)*(21-20) + 1.5*{P(22)*(22-21) + P(23)*(23-21)} = 1.075 Expected loss(22)= 1.25*{P(20)*(22-20) + P(21)*(22-12)} + 1.5*p(23)*(23-22) = 1.225 Expected loss(23) = 1.25 * {P(20)*(23-20) + P(21) * (23-21) + P(22)*(23-22)} = 2.0625 Demand of newspaper Frequency Probability 20 newspaper 20 0.2 21 newspaper 40 0.4 22 newspaper 25 0.25 23 newspaper 15 0.15 Internship Report on Manpower Demand Simulator At APL Logistics (India) Pvt. Ltd Shashi Ranjan Intern, APL Logistics (India) Pvt. Ltd. - 8 -
IF I solved this problem using classical approach 21 newspaper supply would cost him the least loss. The same problem can be solved using News-Vendor model in few steps only. According to this model- Underage cost The loss caused per unit if the demand exceeds supply Overage cost - the loss caused per unit if the supply exceeds demand Here, underage cost = 1.5, overage cost = 1.25 Critical ratio = underage cost/(underage cost + overage cost) = 1.5/2.75 = 0.545 a/c to this model the vendor should supply the quantity whose cumulative probability is just greater than critical ratio . so, for 21, cumulative probability = 0.6 and hence this is the quantity which would cost him least loss.
Our problem is no more different than this new-vendor problem. If I replace newspaper by manpower required this would meet my objective. Here, Underage cost = overtime cost Overage cost = fixed cost unused Critical ratio = overtime / (overtime +fixed) cost suppose, overtime cost = 100 fixed cost/hr = 60 critical ratio = 100/160 = 0.625 and from the newsvendor table , 21 manpower is the optimum level for this critical ratio.
Implementation of Manpower Demand Simulator using VBA Excel Before going in details of this project I want to mention the color codes used in the project which would help you in differentiating various data types.
Input Drop down Input Formula Output Heading Bold Subheading Bold Minor heading Bold Page heading Bold
This is the master column of Manpower Demand Simulator which contains 10 buttons comprised of 5 input buttons, 2 commanding buttons and 3 output buttons. All these buttons guide the user to move to the corresponding tables. These buttons are arranged in a sequential manner in order to run this software properly. These are the steps listed below to operate it easily- Step 1 : Click the "Master Data Input" and fill the Master Data column which contains "Manpower Type", "Resources", "Activities", "UOM", "Activity type" and "Volume reference". Step 2 : Click "the Productivity Sheet Input" button which takes you to the Productivity Sheet table and fill the required fields. Step 3: Click the Manpower Details Input button which takes you to the Manpower Details table where you require to fill the monthly salary , overtime cost and working hours of manpower type. Internship Report on Manpower Demand Simulator At APL Logistics (India) Pvt. Ltd Shashi Ranjan Intern, APL Logistics (India) Pvt. Ltd. - 11 -
Step 4: Click the Inbound/Outbound button which takes you to Inbound /Outbound sheet where you've to fill the available volume of reference, the expected growth, it's yearly, Monthly, weekly, daily and hourly distribution. Then there is a conversion table with the help of which you can generate the other volume of reference. Step 5: Click the "Simulation Input" button which takes you the table which asks the user to fill the no. of times you want to run the code for simulation, the day simulation start and the day it terminates. Step 6: Click the "Run" button but just wait my friend, before doing that click the "Reset" button to make sure that the previous output got evaporated. Step 7: Click the "Result " button to see the result which contains the recommended quantity of manpower type generated from the code. If you are more interested to know the Intermediate and News-Vendor output please click the corresponding buttons.
These are the brief summary of steps one should follow in order to run this tool properly.
Table 1: Manpower Type As the User follows the steps described in the previous page the 1 st table he encounters is Manpower Type. There are 20 Input fields where user can enter the types of manpower involved in the various activities of warehousing. So even if he enters more than 20 manpower types this will take the 1 st 20 entries as the input and perform operation on them only. Its not mandatory to fill all the 20 entries. So, enter only the types of manpower who matter to your purpose as it will help the software to process faster. For the sample data Ive kept 4 manpower types. Table 2: Resources This table also accepts maximum 20 entries as its input. So the user has to list down here the resources used by various manpower while performing the activities. For the sample data 6 resources has been used. Internship Report on Manpower Demand Simulator At APL Logistics (India) Pvt. Ltd Shashi Ranjan Intern, APL Logistics (India) Pvt. Ltd. - 13 -
Activities Receive Inbound ASN Receive inbound docs Scan cartons at pallet level Unloading Pallets Visual Check of Cartons Visual Check of Pallet Stretch wrapping and palletizing of loose cartons from imports Putaway pallets to rack storage locations Putaway pallets to block storage locations
UOM Truck Shipment Carton Piece Bag Crate Wooden box
Table 3: Activities User requires to list down the various activities performed in warehouse as the input to this table. Maximum entries 40 For the sample data total 9 activities has been used. Table 4: UOM UOM- Unit of measurement User requires to list down the unit of measurements used for different activities in warehouse as the input to this table. Maximum entries 20 For the sample data total 7 UOM has been used. Internship Report on Manpower Demand Simulator At APL Logistics (India) Pvt. Ltd Shashi Ranjan Intern, APL Logistics (India) Pvt. Ltd. - 14 -
Table 5
So, the Master Data input contains total 5 tables for 5 different kinds of inputs. Once the user is finished with this he is supposed to follow step 2 which will take him to the Productivity Sheet
Step 2:- Productivity Sheet Input
The 1 st column of this table is Activity and cells of this column are drop-down input which prompts the user to select the activity from the activity table belonging to Master data. The 2 nd column is Manpower whose cells are linked to the Manpower Type table of Master data with the drop down menu. So, the user can select the manpower involved in the activity listed in the corresponding cell of column1. The 3 rd column is Team size and the cells of this column are direct user input. The 4 th column is UOM whose cells are linked to UOM table of Master Data through drop down menu. The 5 th column is Minutes/Unit and the cells of this column are direct user input. The user requires to fill the time consumes in performing the corresponding activity per UOM. The 6 th column is Unit/Hr whose cell values are calculated from the formula 60/(min/unit) i.e the no. of units processed per Hr for the corresponding activity.
volume reference Total inbound shipments Total inbound pallets Inbound cartons Outbound shipments Outbound pallets outbound cartons
Table 5: Volume of reference User requires to enter the volume of reference for different activities in warehouse as the input to this table. Maximum entries 20 For the sample data total 7 UOM has been used. Internship Report on Manpower Demand Simulator At APL Logistics (India) Pvt. Ltd Shashi Ranjan Intern, APL Logistics (India) Pvt. Ltd. - 15 -
The 7 th column is Resource used while performing the corresponding activity of column 1. This is also a drop down input linked to Resource table of Master Data. The 8 th column is Volume reference which is linked to Volume reference table of Master Data through drop down menu.
Step 3:- Manpower Details Input
Manpower Monthly Cost overtime cost/hr opening time closing time Total working day Unskilled labor 12000 100 4 12 25 Data Entry Operator 15000 120 4 12 25
The 1 st column is Manpower and the cells of this column directly fetches the list of manpower entered by the user in Manpower Type table of Master Data. The 2 nd (Monthly cost), 3 rd (Overtime Cost/hr), 4 th (Opening Time),5 th (closing time)& 6 th (Total working day in a month) columns are user input . Opening &closing time gives the working hour information of manpower. This facility is given to deal with many cases when different manpower types have different working hours in warehouse.
This step consists of many sub-steps as many tables are there which must be filled in a proper sequence. The 1 st input is-
The 2 nd cell colored sky blue is a drop-down input which is linked to the volume of reference table of Master data. This is the reference volume whose information is available to the user and with the help of this and the conversion table (discussed later), user can extract the information of other volume references. Reference yr Demand/Order Growth rate Year 1 Total inbound shipments 2010 20000 15.00% 2013 30417.5
This is the 2 nd table of Inbound/Outbound Input which takes 4 inputs- 1. Reference yr User is supposed to enter the year of which volume reference selected as the 1 st input is available to him. 2. Deman/Order - This input field is supposed to get the quantity of selected VOR i.e the available information 3. Growth rate- This is the expected growth rate of VOR per year . 4. Year1- This is year of which demand/order is calculated for our calculation purpose. 5. 5 th Column is the quantity of selected VOR expected in year 1.This is not a user input- this is calculated with the compound interest formula- (Demand/order) year1 = (Demand/Order) reference yr *(1+growth rate/100) year1 reference yr
After feeding these inputs user has to fill the observed yearly, monthly, weekely, daily and hourly demand/order distribution. Tables for these distribution are described on the next page.
Select VoR Total inbound shipments Internship Report on Manpower Demand Simulator At APL Logistics (India) Pvt. Ltd Shashi Ranjan Intern, APL Logistics (India) Pvt. Ltd. - 18 -
Month %age demand Jan 9.67% Feb 8.03% Mar 7.87% Apr 8.06% May 8.30% June 8.52% July 9.00% Aug 9.00% Sep 8.17% Oct 7.80% Nov 7.60% Dec 7.98% Table: Yearly Demand distribution This table requires the user to fill the yearly demand/Order distribution observed in warehouse. 9.67% means 9.67% of total VOR selected as the 1 st input comes or delivers in January. This yearly distribution is taken from sample data. One can change this as per his distribution. Table : Monthly Demand distribution This table requires the user to fill the monthly demand/Order distribution observed in warehouse. The 1 st 3 week is considered to be of 7 days each while the 4&5 contains the remaining days of month. So, this is the demand distribution of monthly demands/orders. Eg- For the sample data 1 st week of any month observes the 23% of demand/orders of that month Internship Report on Manpower Demand Simulator At APL Logistics (India) Pvt. Ltd Shashi Ranjan Intern, APL Logistics (India) Pvt. Ltd. - 19 -
Weekly demand distribution Day %age demand Sunday 0.00% Monday 9.00% Tuesday 9.00% Wednesday 30.00% Thursday 31.00% Friday 15.00% Saturday 6.00% Daily demand/order distribution Hr %age demand 0 4.50% 1 4.00% 2 3.50% 3 3.00% 4 3.00% 5 3.50% 6 3.60% 7 4.00% 8 4.00% 9 4.20% 10 5.00% 11 5.00% 12 5.00% 13 5.00% Table : Monthly Demand distribution This table requires the user to fill the weekly demand/Order distribution observed in warehouse. So, the total input user has too enter is 7. Eg- For the sample data demand on Sunday is kept 0 as this is the holiday but its not mandatory to be 0 always. In most of the warehouses most of the demand/order are noticed on Wednesday and Thursday. For the sample data its 30% on Wednesday and 31% on Thursday. Table: Daily Demand Distribution This table asks the user to feed the daily demand distribution observed in the warehouse. 0 hr means demand observed between 12 am to 1 am 1hr means demand observed between 1am to 2am So on.. For the sample data warehouse operates round the clock. User can input 0% for the hrs warehouse is closed. Internship Report on Manpower Demand Simulator At APL Logistics (India) Pvt. Ltd Shashi Ranjan Intern, APL Logistics (India) Pvt. Ltd. - 20 -
Available VoR Required VoR %age equiv Total dispatch NO. Of UoM1/UOM2 Total no. of UOM2 Total inbound shipments Total inbound pallets 100.00% 30417.5 0.066666667 456263 Total inbound pallets Inbound cartons 100.00% 456263 0.166666667 2737578 Total inbound shipments outbound cartons 100.00% 30417.5 0.066666667 456263 82.90% 0 0 90.00% 0 0 0.00% 0 0 0.00% 0 0 0.00% 0 0 0.00% 0 0 0.00% 0 0
This table helps the user in calculating the other volume of references from the available VOR. The 1 st column of this table is a drop down input linked to the VOR table of Master data. The 1 st cell always contains the VOR entered by the user in the 1 st table of Inbound/Outbound. The 2 nd column is also the drop down input linked to the VOR table of Master Data. The cells of this table contains the VOR which is required and calculated from the cells of 1 st column. The 3 rd column is %age equivalence which asks the user to feed the %age of 1 st column VOR equivalent to the required VOR . The 4 th column coverts the %age equivalence into quantity using the formula %age equiv * available VOR. The 4 th column is No. of UOM1/UOM2- Each volume of reference are measured in some units. UOM1- Unit of Measurement of 1 st column cell UOM2- Unit of Measurement of 2nd column cell UOM1/UOM2- average no. of UOM1 per UOM2 5 th column- Total no. of UOM2 = 3 rd column cell/ 4 th column cell
After filling all the input tables User is supposed to click the Reset macro and then the Run macro to process the data.
As the process finishes you will get such messege demonstrating the total run time in processing the data. It took 6 min 36 sec to process 1 month data for 5 times. Now the user can go to result table to see the result.
How many times to run 5 simulation starts at day 1 simulation stops at day 31 Internship Report on Manpower Demand Simulator At APL Logistics (India) Pvt. Ltd Shashi Ranjan Intern, APL Logistics (India) Pvt. Ltd. - 22 -
Result Analysis:
The recommended quantity evolved from simulation is 15 for Unskilled labor and 4 for data entry operator.
Lets analyse the result : The critical ratio for unskilled labor = 100/160 = 0.63 Critical ratio for data entry operator = 120/195 = 0.62 Now the user needs to refer the news-vendor output for further details-
The 1 st column of table contains the quantity of manpower. The 2 nd column is the frequency of quantity of Unskilled labor required per hour . The 3 rd column gives the cumulative distribution of the Unskilled labor required per hour.
As the cumulative distribution of unskilled labor exceeded the critical ratio i.e 0.63 it stopped calculating this for next quantities and the corresponding quantity i.e 15 is the optimum level which would cost the least loss of company. The same concept is applicable for data entry operator, and hence the answer is 4.
Internship Report on Manpower Demand Simulator At APL Logistics (India) Pvt. Ltd Shashi Ranjan Intern, APL Logistics (India) Pvt. Ltd. - 24 - Module 1: Labor calculator Sub laborcalc()
On Error Resume Next
Application.ScreenUpdating = False Dim manpower As String Dim resource As String Dim volume_ref As String Dim total As Double Dim ratio As Double Dim hr As Integer Dim m As Integer Dim start_time, end_time Dim start_day, end_day Dim total_manpower Dim total_act Dim total_vol
For h = 7 + 24 * (start_day - 1) To 6 + 24 * end_day hr = Cells(h, 66).Value For i = 90 To (89 + total_manpower) manpower = Cells(6, i) total = 0 For j = 11 To (10 + total_act) If manpower = Sheets("Master Data").Cells(j, 7).Value Then If Cells(i - 11, 11).Value < Cells(i - 11, 12).Value Then If WorksheetFunction.And(hr >= Cells(i - 11, 11), hr < Cells(i - 11, 12)) Then
volume_ref = Cells(j, 13) For k = 67 To 66 + total_vol If volume_ref = Sheets("Master Data").Cells(6, k).Value Then If Cells(h, k).Value = "" Then Cells(h, k).Value = 0 End If Internship Report on Manpower Demand Simulator At APL Logistics (India) Pvt. Ltd Shashi Ranjan Intern, APL Logistics (India) Pvt. Ltd. - 25 - total = total + (Sheets("Master Data").Cells(h, k).Value / Sheets("Master Data").Cells(j, 11).Value) * Sheets("Master Data").Cells(j, 8).Value End If Next k Sheets("Master Data").Cells(h, i).Value = WorksheetFunction.RoundUp(total, 0)
End If
ElseIf Cells(i - 11, 11).Value > Cells(i - 11, 12).Value Then If WorksheetFunction.Or(hr >= Cells(i - 11, 11), hr < Cells(i - 11, 12)) Then
volume_ref = Sheets("Master Data").Cells(j, 13).Value For k = 67 To 66 + total_vol If volume_ref = Sheets("Master Data").Cells(6, k).Value Then If Cells(h, k).Value = "" Then Cells(h, k).Value = 0 End If total = total + (Sheets("Master Data").Cells(h, k).Value / Sheets("Master Data").Cells(j, 11).Value) * Sheets("Master Data").Cells(j, 8).Value End If Next k Sheets("Master Data").Cells(h, i).Value = WorksheetFunction.RoundUp(total, 0)
End If
End If
End If Next j If Cells(h, i) = "" Then Cells(h, i) = "" Else Cells(Cells(h, i) + 7, 2 * (i - 90) + 115) = 1 + Cells(Cells(h, i) + 7, 2 * (i - 90) + 115) End If Next i Next h
For i = 0 To (total_manpower - 1) shift_length = Cells(79 + i, 12) - Cells(79 + i, 11) If shift_length > 0 Then Cells(7, 115 + 2 * i) = Cells(7, 115 + 2 * i) - Int((Cells(155, 7) - Cells(154, 7) + 1) / 7) * shift_length Else Cells(7, 115 + 2 * i) = Cells(7, 115 + 2 * i) - Int((Cells(155, 7) - Cells(154, 7) + 1) / 7) * (24 + shift_length) End If Next i
For i = 0 To (total_manpower - 1) total = 0 ratio = 0 Internship Report on Manpower Demand Simulator At APL Logistics (India) Pvt. Ltd Shashi Ranjan Intern, APL Logistics (India) Pvt. Ltd. - 26 - myrange = Range(Cells(7, 115 + 2 * i), Cells(507, 115 + 2 * i)) total = WorksheetFunction.Sum(myrange) Cells(508, 115 + 2 * i) = total For j = 0 To 500 ratio = ratio + Cells(7 + j, 115 + 2 * i) / total Cells(7 + j, 116 + 2 * i) = ratio If ratio >= Cells(7 + i, 167) Then Cells(7 + i, 168) = j j = 500 End If Next j Next i
Next simulate
end_time = Now() Cells(26, 168) = DateDiff("s", start_time, end_time) MsgBox "Total Run Time = " & Int(Cells(26, 168).Value / 60) & " min " & Cells(26, 168).Value Mod 60 & " sec"
End Sub
Internship Report on Manpower Demand Simulator At APL Logistics (India) Pvt. Ltd Shashi Ranjan Intern, APL Logistics (India) Pvt. Ltd. - 27 - Module 2: Public function to generate Poisson no.
Function RandPois(lambda As Single, _ Optional bVolatile As Boolean = False) As Long
Dim L As Single Dim k As Long Dim p As Single
If bVolatile Then Application.Volatile
L = Exp(-lambda) p = 1 Do k = k + 1 p = p * Rnd Loop Until p <= L
RandPois = k - 1 End Function
Module 3: Reset
Sub CommandButton1_Click() Application.ScreenUpdating = False