Beispiel #1
0
        /// <summary>
        /// Removes the request to extract the item.
        /// </summary>
        /// <param name="request">The request to remove.</param>
        public void RemoveExtractRequest(ExtractRequest request)
        {
            // Manage overall list of available requests
            _availableExtractRequests.Remove(request);
            _availableExtractRequestsPerOrder[request.Order].Remove(request);

            // Manage requests available per station
            if (request.Station != null)
            {
                _availableExtractRequestsPerStation[request.Station].Remove(request);
                request.Station.StatCurrentlyOpenRequests = _availableExtractRequestsPerStation[request.Station].Count;
                // Update demand
                _assignedDemand[request.Item]--;
            }
            // Remove from queue of the station
            else if (_stationQueuedPerExtractRequest.ContainsKey(request))
            {
                _availableExtractRequestsPerStationQueue[_stationQueuedPerExtractRequest[request]].Remove(request);
                _stationQueuedPerExtractRequest[request].StatCurrentlyOpenQueuedRequests = _availableExtractRequestsPerStationQueue[_stationQueuedPerExtractRequest[request]].Count;
                // Update demand
                _queuedDemand[request.Item]--;
            }
            // Remove from overall backlog
            else
            {
                // Update demand
                _backlogDemand[request.Item]--;
            }
        }
Beispiel #2
0
 /// <summary>
 /// Adds the request to extract the corresponding item again.
 /// </summary>
 /// <param name="request">The request to insert again.</param>
 public void ReInsertExtractRequest(ExtractRequest request)
 {
     // Mark request as available again
     request.ReInsert();
     // Manage overall list of available requests
     _availableExtractRequests.Add(request);
     _availableExtractRequestsPerOrder[request.Order].Add(request);
     // Manage requests available per station
     if (request.Station != null)
     {
         _availableExtractRequestsPerStation[request.Station].Add(request);
         request.Station.StatCurrentlyOpenRequests = _availableExtractRequestsPerStation[request.Station].Count;
         // Update demand
         _assignedDemand[request.Item]++;
     }
     else if (_stationQueuedPerExtractRequest.ContainsKey(request))
     // Re-add to queue of the station
     {
         _availableExtractRequestsPerStationQueue[_stationQueuedPerExtractRequest[request]].Add(request);
         _stationQueuedPerExtractRequest[request].StatCurrentlyOpenQueuedRequests = _availableExtractRequestsPerStationQueue[_stationQueuedPerExtractRequest[request]].Count;
         // Update demand
         _queuedDemand[request.Item]++;
     }
     // Re-add to overall backlog
     else
     {
         // Update demand
         _backlogDemand[request.Item]++;
     }
 }
Beispiel #3
0
 /// <summary>
 /// Creates requests for all placed orders.
 /// </summary>
 /// <param name="order">The order that was just placed.</param>
 public void CreateExtractRequests(Order order)
 {
     // Create requests for all lines and units of the order
     foreach (var l in order.Positions)
     {
         for (int i = 0; i < l.Value; i++)
         {
             ExtractRequest request = new ExtractRequest(l.Key, order, null);
             order.AddRequest(l.Key, request);
             _availableExtractRequests.Add(request);
         }
     }
     _availableExtractRequestsPerOrder[order] = new HashSet <ExtractRequest>(order.Requests);
     // Update demand tracking
     foreach (var pos in order.Positions)
     {
         _backlogDemand[pos.Key] += pos.Value;
     }
 }