コード例 #1
0
        public CustomerOrderCreator(Quantity defaultCustomerOrderQuantityPerCycle)
        {
            if (defaultCustomerOrderQuantityPerCycle != null &&
                defaultCustomerOrderQuantityPerCycle.IsSmallerThan(
                    _defaultCustomerOrderQuantityPerCycle))
            {
                _defaultCustomerOrderQuantityPerCycle = defaultCustomerOrderQuantityPerCycle;
            }

            var orderArrivalRate = new OrderArrivalRate(0.025);
            IDbMasterDataCache masterDataCache = ZppConfiguration.CacheManager.GetMasterDataCache();

            _orderGenerator = TestScenario.GetOrderGenerator(new MinDeliveryTime(200),
                                                             new MaxDeliveryTime(1430), orderArrivalRate, masterDataCache.M_ArticleGetAll(),
                                                             masterDataCache.M_BusinessPartnerGetAll());
        }
コード例 #2
0
        public static IOrderGenerator GetOrderGenerator(MinDeliveryTime minDeliveryTime,
                                                        MaxDeliveryTime maxDelivery, OrderArrivalRate orderArrivalRate,
                                                        IEnumerable <M_Article> articles, IEnumerable <M_BusinessPartner> businessPartners)
        {
            var config = Master40.SimulationCore.Environment.Configuration.Create(args: new object[]
            {
                new Seed(value: 1337),
                new SimulationNumber(value: 1),
                orderArrivalRate,
                maxDelivery,
                minDeliveryTime,
            });
            var productIds     = articles.Where(x => x.ArticleType.Name == "Product").Select(x => x.Id).ToList();
            var orderGenerator = new OrderGeneratorPerformance(config, productIds, articles, businessPartners);

            return(orderGenerator);
        }
コード例 #3
0
        public OrderGeneratorPerformance(Configuration simConfig, List <int> productIds,
                                         IEnumerable <M_Article> articles, IEnumerable <M_BusinessPartner> businessPartners)
        {
            _seededRandom = new Random(Seed: simConfig.GetOption <Seed>().Value +
                                       simConfig.GetOption <SimulationNumber>().Value);
            _exponential = new Exponential(rate: simConfig.GetOption <OrderArrivalRate>().Value,
                                           randomSource: _seededRandom);
            _productIds = productIds;

            //get equal distribution from 0 to 1
            _prodVariation = new DiscreteUniform(lower: 0, upper: _productIds.Count() - 1,
                                                 randomSource: _seededRandom);

            //get equal distribution for duetime
            _duetime = new DiscreteUniform(lower: simConfig.GetOption <MinDeliveryTime>().Value,
                                           upper: simConfig.GetOption <MaxDeliveryTime>().Value, randomSource: _seededRandom);

            _articles.AddRange(articles);
            _businessPartners.AddRange(businessPartners);
            _orderArrivalRate = simConfig.GetOption <OrderArrivalRate>();
        }