Research Article

Solving a Location, Allocation, and Capacity Planning Problem with Dynamic Demand and Response Time Service Level

Algorithm 1

Pseudocode of nearest-neighbour (NN) dispatch algorithm.
For each demand node in the given region: Generate request arrival times
Sort requests from all nodes in ascending order of time into a list
Initialize: Let current time ; = first event in list with event time ≥
Repeat
   If is an arrival request Then
      If all servers are busy Then (no server assigned);
      Else find the estimated earliest arrival time, , among all available servers.
         Let be the server which can arrive the earliest (estimated) at
      Endif
   Else is an actual service completion}
      Let = server available after completing
      If there is any unassigned request(s) on or before current time Then
         Find the unassigned request nearest to the current location of
         Estimate the arrival time, , of to the request location
      Else reset
      Endif
   Endif
   If and session end time Then
      Assign request to server
      Generate the actual travel time and on-site processing time to determine the actual completion time
      Store and related information (request, location, server ) in list
   Else retain and related information (location, server ) in list for later assignment
   Endif
   Sort in ascending order of time
   Advance the first event time (≥) in list . Let denote the event
Until a termination condition* holds.
*3 termination conditions: (i) exceeds the session end time (ii) all requests are assigned or
(iii) all requests have arrived and reaches the completion time of the last event in list