Esempio n. 1
0
 //Actually spends the component from chosen bin
 public void SpendComponent(ComponentTypeUsageDictionary ComponentUsages)
 {
     foreach (ComponentType ct in ComponentUsages.Keys)
     {
         int requirement = ComponentUsages[ct];
         while (requirement > 0)
         {
             Bin currentbin = this.FindBin(ct);
             if (currentbin.Count < requirement)
             {
                 requirement     -= currentbin.Count;
                 currentbin.Count = 0;
             }
             else
             {
                 currentbin.Count -= requirement;
                 requirement       = 0;
             }
             SimulationManager simulationManager = (SimulationManager)this.Parent.Parent.Parent.Parent;
             simulationManager.LayoutManager.Layout.WriteInventoryOnHand((Station)this.Parent, ct, simulationManager.Time, this.GetNumberOfBins(ct));
             Statistics ComponenttypeCount = this.Statistics["ComponentTypeCount-" + currentbin.ComponentType.Name];
             ComponenttypeCount.UpdateWeighted(((SimulationManager)this.Parent.Parent.Parent.Parent).Time, this.GetNumberOfBins(ct));
         }
     }
 }
Esempio n. 2
0
        //Checks current inventory position with safety stock level
        public void CheckComponentOrder(ComponentTypeUsageDictionary ComponentUsages)
        {
            foreach (ComponentType ct in ComponentUsages.Keys)
            {
                double inventoryPosition = GetComponentLevel(ct);
                if (inventoryPosition < this.inventoryPolicy[ct].S)
                {
                    Statistics OutstandingOrderCount = this.Statistics["OutstandingOrderCount"];

                    for (int i = 0; i < this.inventoryPolicy[ct].Q; i++)
                    {
                        Order order = new Order(this, ct, ((SimulationManager)this.Parent.Parent.Parent.Parent).Time);
                        this.outstandingOrders.Add(order);
                        ((SimulationManager)this.Parent.Parent.Parent.Parent).TriggerOrder(order);
                    }
                    OutstandingOrderCount.UpdateWeighted(((SimulationManager)this.Parent.Parent.Parent.Parent).Time, this.outstandingOrders.Count);
                }
            }
        }
Esempio n. 3
0
        //Checks the binmagazine whether its capable or not to do the operation for component type
        public bool CheckComponent(ComponentTypeUsageDictionary ComponentUsages)
        {
            bool flag = true;

            foreach (ComponentType ct in ComponentUsages.Keys)
            {
                int requirement        = ComponentUsages[ct];
                int availablecomponent = 0;

                foreach (Bin bin in this.Content)
                {
                    if (bin.ComponentType == ct)
                    {
                        availablecomponent += (bin.Count);
                    }
                }
                if (!(availablecomponent >= requirement))
                {
                    flag = false;
                }
            }
            return(flag);
        }
Esempio n. 4
0
        private RVGenerator operationTime;                    //IE486fall18

        public Operation()
        {
            componentUsages = new ComponentTypeUsageDictionary();
        }