private void ManufacturingResourcePlanning(Demands dbDemands)
        {
            if (dbDemands == null || dbDemands.Any() == false)
            {
                throw new MrpRunException(
                          "How could it happen, that no dbDemands are given to plan ?");
            }

            // MaterialRequirementsPlanning
            _performanceMonitors.Start(InstanceToTrack.Mrp1);
            IMrp1 mrp1 = new Mrp1.impl.Mrp1(dbDemands);

            mrp1.StartMrp1();
            _performanceMonitors.Stop(InstanceToTrack.Mrp1);


            // BackwardForwardBackwardScheduling
            _performanceMonitors.Start(InstanceToTrack.BackwardForwardBackwardScheduling);

            OrderOperationGraph orderOperationGraph = new OrderOperationGraph();

            ScheduleBackwardFirst(orderOperationGraph);
            AssertEveryDemandAndProviderIsScheduled();

            ScheduleForward(orderOperationGraph, _simulationInterval);
            ScheduleBackwardSecond(orderOperationGraph);

            _performanceMonitors.Stop(InstanceToTrack.BackwardForwardBackwardScheduling);

            // job shop scheduling
            _performanceMonitors.Start(InstanceToTrack.JobShopScheduling);
            JobShopScheduling(orderOperationGraph);
            _performanceMonitors.Stop(InstanceToTrack.JobShopScheduling);
        }
コード例 #2
0
        public void StartOneCycle(SimulationInterval simulationInterval,
                                  Quantity customerOrderQuantity)
        {
            IDbTransactionData dbTransactionData =
                ZppConfiguration.CacheManager.GetDbTransactionData();

            _performanceMonitors.Start(InstanceToTrack.CreateCustomerOrders);
            _customerOrderCreator.CreateCustomerOrders(simulationInterval, customerOrderQuantity);
            _performanceMonitors.Stop(InstanceToTrack.CreateCustomerOrders);

            // Mrp2
            _performanceMonitors.Start(InstanceToTrack.Mrp2);
            Mrp2.impl.Mrp2 mrp2 = new Mrp2.impl.Mrp2(_performanceMonitors, simulationInterval);
            mrp2.StartMrp2();
            _performanceMonitors.Stop(InstanceToTrack.Mrp2);
            DebuggingTools.PrintStateToFiles(simulationInterval, dbTransactionData, "1_after_mrp2",
                                             true);

            // CreateConfirmations
            _performanceMonitors.Start(InstanceToTrack.CreateConfirmations);
            _confirmationManager.CreateConfirmations(simulationInterval);
            _performanceMonitors.Stop(InstanceToTrack.CreateConfirmations);
            DebuggingTools.PrintStateToFiles(simulationInterval, dbTransactionData,
                                             "2_after_create_confirmations", false);

            // ApplyConfirmations
            // TODO: disable these two lines

            /*DemandToProviderGraph demandToProviderGraph = new DemandToProviderGraph();
             * string demandToProviderGraphString = demandToProviderGraph.ToString();
             * ZppConfiguration.CacheManager.UseArchiveForGetters();
             * DemandToProviderGraph demandToProviderGraphArchive = new DemandToProviderGraph();
             * string demandToProviderGraphArchiveString = demandToProviderGraphArchive.ToString();
             * ZppConfiguration.CacheManager.UseArchiveForGettersRevert();*/

            _performanceMonitors.Start(InstanceToTrack.ApplyConfirmations);
            _confirmationManager.ApplyConfirmations();
            _performanceMonitors.Stop(InstanceToTrack.ApplyConfirmations);

            DebuggingTools.PrintStateToFiles(simulationInterval, dbTransactionData,
                                             "3_after_apply_confirmations", false);

            // TODO: disable following lines

            /* DemandToProviderGraph demandToProviderGraph2 = new DemandToProviderGraph();
             * string demandToProviderGraphString2 = demandToProviderGraph2.ToString();
             * /*ZppConfiguration.CacheManager.UseArchiveForGetters();
             * DemandToProviderGraph demandToProviderGraphArchive2 = new DemandToProviderGraph();
             * string demandToProviderGraphArchiveString2 = demandToProviderGraphArchive2.ToString();
             * ZppConfiguration.CacheManager.UseArchiveForGettersRevert();*/
        }