Пример #1
0
        /**
         * no confirmations are created and applied
         */
        private void StartTestCycle(SimulationInterval simulationInterval, bool shouldPersist)
        {
            Quantity customerOrderQuantity = new Quantity(ZppConfiguration.CacheManager
                                                          .GetTestConfiguration().CustomerOrderPartQuantity);


            // init transactionData
            ZppConfiguration.CacheManager.ReloadTransactionData();

            _customerOrderCreator = new CustomerOrderCreator(customerOrderQuantity);
            _customerOrderCreator.CreateCustomerOrders(simulationInterval, customerOrderQuantity);

            // execute mrp2
            Zpp.Mrp2.impl.Mrp2 mrp2 = new Zpp.Mrp2.impl.Mrp2(simulationInterval);
            mrp2.StartMrp2();

            DebuggingTools.PrintStateToFiles(simulationInterval,
                                             ZppConfiguration.CacheManager.GetDbTransactionData(), "", true);

            // no confirmations

            // persisting cached/created data
            if (shouldPersist)
            {
                ZppConfiguration.CacheManager.Persist();
            }
        }
Пример #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();*/
        }