Beispiel #1
0
        public static void GenerateRotterdamPhase2Settings()
        {
            // --> Begin
            Console.WriteLine("Initializing ...");


            Dictionary <string, string> skuFiles = new Dictionary <string, string> {
                { "Mu-1000.xgenc", "1000" }, { "Mu-10000.xgenc", "10000" },
            };
            List <int> orderSizeScenarios = new List <int> {
                1, 2, 3
            };
            List <double> returnOrderProbabilities = new List <double> {
                0, 0.3
            };

            //List<int> pickStationCapacities = new List<int> { 6, 12, 18 };
            List <double> pickStationCounts = new List <double> {
                1.0 / 6.0, 2.0 / 6.0, 3.0 / 6.0, 4.0 / 6.0, 5.0 / 6.0, 6.0 / 6.0,
            };
            //List<double> replStationCounts = new List<double> { 1.0 / 3.0, 2.0 / 3.0, 1.0 };
            List <int> botsPerStations = new List <int> {
                2, 3, 4, 5, 6
            };

            // Build all combinations
            foreach (var botsPerStation in botsPerStations)
            {
                foreach (var skuFile in skuFiles)
                {
                    foreach (var pickStationCount in pickStationCounts)
                    {
                        foreach (var orderSizeScenario in orderSizeScenarios)
                        {
                            foreach (var returnOrderProbability in returnOrderProbabilities)
                            {
                                SettingConfiguration setting = GetRotterdamBaseSetting();
                                setting.OverrideConfig = new OverrideConfiguration()
                                {
                                    OverrideBotCountPerOStation        = true,
                                    OverrideBotCountPerOStationValue   = botsPerStation,
                                    OverrideOutputStationCapacity      = true,
                                    OverrideOutputStationCapacityValue = 8,
                                    OverrideInputStationCount          = true,
                                    OverrideInputStationCountValue     = 2.0 / 6.0,
                                    OverrideOutputStationCount         = true,
                                    OverrideOutputStationCountValue    = pickStationCount,
                                };
                                setting.InventoryConfiguration.SimpleItemConfiguration.GeneratorConfigFile = skuFile.Key;
                                switch (orderSizeScenario)
                                {
                                case 1: /* Do nothing - default scenario */ break;

                                case 2:
                                    setting.InventoryConfiguration.OrderPositionCountMin = 1;
                                    setting.InventoryConfiguration.OrderPositionCountMax = 1;
                                    setting.InventoryConfiguration.PositionCountMin      = 1;
                                    setting.InventoryConfiguration.PositionCountMax      = 1;
                                    break;

                                case 3:
                                    setting.InventoryConfiguration.OrderPositionCountMin = 2;
                                    setting.InventoryConfiguration.PositionCountMin      = 2;
                                    break;

                                default: throw new ArgumentException("Unknown order size scenario: " + orderSizeScenario);
                                }
                                setting.InventoryConfiguration.ReturnOrderProbability = returnOrderProbability;
                                setting.CommentTag1 = "Scen" +
                                                      "-SKU" + skuFile.Value +
                                                      "-O" + (orderSizeScenario == 1 ? "M" : (orderSizeScenario == 2 ? "S" : "L")) +
                                                      "-RO" + (returnOrderProbability > 0 ? "t" : "f");
                                string name = "MaTi" +
                                              "-SKU" + skuFile.Value +
                                              "-O" + (orderSizeScenario == 1 ? "M" : (orderSizeScenario == 2 ? "S" : "L")) +
                                              "-RO" + (returnOrderProbability > 0 ? "t" : "f") +
                                              "-BPOS" + botsPerStation.ToString(IOConstants.EXPORT_FORMAT_SHORTEST_BY_ROUNDING, IOConstants.FORMATTER) +
                                              //"-C" + pickStationCapacity.ToString(IOConstants.FORMATTER) +
                                              "-P" + pickStationCount.ToString(IOConstants.EXPORT_FORMAT_SHORTER, IOConstants.FORMATTER) +
                                              //"-R" + replStationCount.ToString(IOConstants.EXPORT_FORMAT_SHORTER, IOConstants.FORMATTER) +
                                              "";
                                setting.Name = name;
                                string fileName = setting.Name + ".xsett";
                                Console.WriteLine("Saving " + fileName + " ...");
                                InstanceIO.WriteSetting(fileName, setting);
                            }
                        }
                    }
                }
            }
        }
Beispiel #2
0
        public static void GenerateRepositioningSet3()
        {
            Dictionary <bool, StationActivationConfiguration> stationControllers = new Dictionary <bool, StationActivationConfiguration>()
            {
                { false, new ActivateAllStationActivationConfiguration() },
                { true, new WorkShiftStationActivationConfiguration(new DefaultConstructorIdentificationClass()) },
            };
            List <Tuple <double, double> > speedUtilityWeights = new List <Tuple <double, double> >()
            {
                new Tuple <double, double>(0, 1),
                new Tuple <double, double>(1, 0),
                new Tuple <double, double>(1, 1),
            };
            List <Tuple <PodStorageConfiguration, RepositioningConfiguration> > positioningControllers = new List <Tuple <PodStorageConfiguration, RepositioningConfiguration> >()
            {
                new Tuple <PodStorageConfiguration, RepositioningConfiguration>(
                    new NearestPodStorageConfiguration(),
                    new UtilityRepositioningConfiguration()),
                new Tuple <PodStorageConfiguration, RepositioningConfiguration>(
                    new NearestPodStorageConfiguration(),
                    new CacheDropoffRepositioningConfiguration()),
                new Tuple <PodStorageConfiguration, RepositioningConfiguration>(
                    new UtilityPodStorageConfiguration(),
                    new UtilityRepositioningConfiguration()),
                new Tuple <PodStorageConfiguration, RepositioningConfiguration>(
                    new CachePodStorageConfiguration(),
                    new CacheDropoffRepositioningConfiguration()),
            };
            List <OrderBatchingConfiguration> orderBatchers = new List <OrderBatchingConfiguration>()
            {
                new DefaultOrderBatchingConfiguration()
                {
                    OrderSelectionRule   = Core.Control.Defaults.OrderBatching.DefaultOrderSelection.FCFS,
                    StationSelectionRule = Core.Control.Defaults.OrderBatching.DefaultOutputStationSelection.Random,
                },
            };
            List <RepositioningSubExperiment> subExperiments = new List <RepositioningSubExperiment>()
            {
                new RepositioningSubExperiment()
                {
                    NightDown = false, BotsPerOStation = 4, BotAllocation = new Tuple <bool, double, double, double>(false, 1, 3, 0)
                },
                new RepositioningSubExperiment()
                {
                    NightDown = false, BotsPerOStation = 4, BotAllocation = new Tuple <bool, double, double, double>(true, 1, 2, 1)
                },
                new RepositioningSubExperiment()
                {
                    NightDown = false, BotsPerOStation = 5, BotAllocation = new Tuple <bool, double, double, double>(true, 1, 3, 1)
                },
                new RepositioningSubExperiment()
                {
                    NightDown = true, BotsPerOStation = 4, BotAllocation = new Tuple <bool, double, double, double>(true, 1, 3, 0)
                },
                new RepositioningSubExperiment()
                {
                    NightDown = true, BotsPerOStation = 4, BotAllocation = new Tuple <bool, double, double, double>(false, 1, 3, 0)
                },
            };
            int counter = 0;

            foreach (var subExperiment in subExperiments)
            {
                string dir = "SubExp" + (++counter);
                while (!Directory.Exists(dir))
                {
                    Directory.CreateDirectory(dir);
                }

                foreach (var speedUtilityWeight in speedUtilityWeights)
                {
                    foreach (var positioningController in positioningControllers)
                    {
                        foreach (var orderBatcher in orderBatchers)
                        {
                            // Prepare setting
                            SettingConfiguration setting = GetRepositioningBaseSetting();
                            setting.OverrideConfig = new OverrideConfiguration()
                            {
                                OverrideBotCountPerOStation      = true,
                                OverrideBotCountPerOStationValue = subExperiment.BotsPerOStation,
                            };
                            if (subExperiment.NightDown)
                            {
                                setting.InventoryConfiguration.DemandInventoryConfiguration.BundleCount = 0;
                                setting.InventoryConfiguration.SubmitBatches = true;
                                setting.InventoryConfiguration.BatchInventoryConfiguration = new BatchInventoryConfiguration()
                                {
                                    MaxTimeForBundleSubmissions = TimeSpan.FromDays(1).TotalSeconds,
                                    MaxTimeForOrderSubmissions  = TimeSpan.FromDays(1).TotalSeconds,
                                    BundleBatches = new List <Skvp <double, double> >()
                                    {
                                        new Skvp <double, double>()
                                        {
                                            Key = TimeSpan.FromHours(16).TotalSeconds, Value = 0.75
                                        }
                                    },
                                    OrderBatches = new List <Skvp <double, int> >()
                                    {
                                        new Skvp <double, int>()
                                        {
                                            Key = TimeSpan.FromHours(22).TotalSeconds, Value = 1500
                                        }
                                    },
                                };
                            }
                            // Prepare config
                            ControlConfiguration config = new ControlConfiguration()
                            {
                                StationActivationConfig = stationControllers[subExperiment.NightDown],
                                TaskAllocationConfig    = new BalancedTaskAllocationConfiguration()
                                {
                                    RepositionBeforeRest = subExperiment.BotAllocation.Item1,
                                    WeightInputStations  = subExperiment.BotAllocation.Item2,
                                    WeightOutputStations = subExperiment.BotAllocation.Item3,
                                    WeightRepositioning  = subExperiment.BotAllocation.Item4,
                                },
                                OrderBatchingConfig = orderBatcher,
                                PodStorageConfig    = positioningController.Item1,
                                RepositioningConfig = positioningController.Item2,
                            };
                            // Set weights
                            if (config.PodStorageConfig is CachePodStorageConfiguration)
                            {
                                (config.PodStorageConfig as CachePodStorageConfiguration).WeightSpeed   = speedUtilityWeight.Item1;
                                (config.PodStorageConfig as CachePodStorageConfiguration).WeightUtility = speedUtilityWeight.Item2;
                            }
                            if (config.PodStorageConfig is UtilityPodStorageConfiguration)
                            {
                                (config.PodStorageConfig as UtilityPodStorageConfiguration).UtilityConfig.WeightSpeed   = speedUtilityWeight.Item1;
                                (config.PodStorageConfig as UtilityPodStorageConfiguration).UtilityConfig.WeightUtility = speedUtilityWeight.Item2;
                            }
                            if (config.RepositioningConfig is CacheDropoffRepositioningConfiguration)
                            {
                                (config.RepositioningConfig as CacheDropoffRepositioningConfiguration).WeightSpeed   = speedUtilityWeight.Item1;
                                (config.RepositioningConfig as CacheDropoffRepositioningConfiguration).WeightUtility = speedUtilityWeight.Item2;
                            }
                            if (config.RepositioningConfig is UtilityRepositioningConfiguration)
                            {
                                (config.RepositioningConfig as UtilityRepositioningConfiguration).UtilityConfig.WeightSpeed   = speedUtilityWeight.Item1;
                                (config.RepositioningConfig as UtilityRepositioningConfiguration).UtilityConfig.WeightUtility = speedUtilityWeight.Item2;
                            }
                            // Name setting
                            setting.Name = "ScenRep-" + (subExperiment.NightDown ? "NightDown" : "NoDown") + "-BPOS" + subExperiment.BotsPerOStation;
                            // Name controller
                            string saTag;
                            if (config.StationActivationConfig is ActivateAllStationActivationConfiguration)
                            {
                                saTag = "A";
                            }
                            else if (config.StationActivationConfig is WorkShiftStationActivationConfiguration)
                            {
                                saTag = "W";
                            }
                            else
                            {
                                throw new ArgumentException("Unknown!");
                            }
                            string psTag;
                            if (config.PodStorageConfig is RandomPodStorageConfiguration)
                            {
                                psTag = "R";
                            }
                            else if (config.PodStorageConfig is NearestPodStorageConfiguration)
                            {
                                psTag = "N";
                            }
                            else if (config.PodStorageConfig is CachePodStorageConfiguration)
                            {
                                psTag = "C";
                            }
                            else if (config.PodStorageConfig is UtilityPodStorageConfiguration)
                            {
                                psTag = "U";
                            }
                            else
                            {
                                throw new ArgumentException("Unknown!");
                            }
                            string rpTag;
                            if (config.RepositioningConfig is DummyRepositioningConfiguration)
                            {
                                rpTag = "D";
                            }
                            else if (config.RepositioningConfig is CacheDropoffRepositioningConfiguration)
                            {
                                rpTag = "C";
                            }
                            else if (config.RepositioningConfig is UtilityRepositioningConfiguration)
                            {
                                rpTag = "U";
                            }
                            else
                            {
                                throw new ArgumentException("Unknown!");
                            }
                            string obTag;
                            if (config.OrderBatchingConfig is QueueOrderBatchingConfiguration)
                            {
                                obTag = "Q";
                            }
                            else if (config.OrderBatchingConfig is PodMatchingOrderBatchingConfiguration)
                            {
                                obTag = "M";
                            }
                            else if (config.OrderBatchingConfig is DefaultOrderBatchingConfiguration)
                            {
                                obTag = "D";
                            }
                            else
                            {
                                throw new ArgumentException("Unknown!");
                            }
                            config.Name =
                                "PS" + psTag + "-" +
                                "RP" + rpTag + "-" +
                                "SA" + saTag + "-" +
                                "OB" + obTag + "-" +
                                "Bot" + (subExperiment.BotAllocation.Item1 ? "t" : "f") + "I" + subExperiment.BotAllocation.Item2 + "O" + subExperiment.BotAllocation.Item3 + "R" + subExperiment.BotAllocation.Item4 + "-" +
                                "Wei" +
                                speedUtilityWeight.Item1.ToString(IOConstants.EXPORT_FORMAT_SHORTER, IOConstants.FORMATTER) +
                                speedUtilityWeight.Item2.ToString(IOConstants.EXPORT_FORMAT_SHORTER, IOConstants.FORMATTER);
                            // Save it
                            string fileNameController = Path.Combine(dir, config.Name + ".xconf");
                            Console.WriteLine("Saving " + fileNameController + " ...");
                            InstanceIO.WriteConfiguration(fileNameController, config);
                            string fileNameSetting = Path.Combine(dir, setting.Name + ".xsett");
                            Console.WriteLine("Saving " + fileNameSetting + " ...");
                            InstanceIO.WriteSetting(fileNameSetting, setting);
                        }
                    }
                }
            }
        }
Beispiel #3
0
        internal static void GenerateRotterdamMark2Set()
        {
            // --> Begin
            Console.WriteLine("Initializing ...");

            // SKUs
            List <string> skuScenarios = new List <string>
            {
                // 100 SKUs
                "Mu-100.xgenc",
                // 500 SKUs
                "Mu-500.xgenc",
                // 1000 SKUs
                "Mu-1000.xgenc",
            };
            // BotsPerOStation
            List <int> botsPerOStationCounts = new List <int>
            {
                // 2 bots per output station
                2,
                // 4 bots per output station
                4,
                // 6 bots per output station
                6,
                // 8 bots per output station
                8,
            };
            // OStationCapacity
            List <int> oStationCapacities = new List <int>
            {
                // 6 orders in parallel
                6,
                // 12 orders in parallel
                12,
                // 18 orders in parallel
                18,
            };
            // ReplenishmentStations
            List <double> iStationAmounts = new List <double>
            {
                // Use only one (the override will always save the last station)
                0,
                // Use only 50 %
                0.5,
                // Use all
                1,
            };

            // --> Generate the settings
            Console.WriteLine("Generating all settings ...");
            List <SettingConfiguration> settings = new List <SettingConfiguration>();

            foreach (var skuScenario in skuScenarios)
            {
                foreach (var botsPerOStationCount in botsPerOStationCounts)
                {
                    foreach (var oStationCapacity in oStationCapacities)
                    {
                        foreach (var iStationAmount in iStationAmounts)
                        {
                            settings.Add(new SettingConfiguration()
                            {
                                Name = "Mu" +
                                       "-SKU" + skuScenario.Replace("Mu-", "").Replace(".xgenc", "") +
                                       "-B" + botsPerOStationCount +
                                       "-O" + oStationCapacity +
                                       "-I" + iStationAmount.ToString(IOConstants.FORMATTER),
                                SimulationWarmupTime   = 0,
                                SimulationDuration     = 86400,
                                InventoryConfiguration = new InventoryConfiguration()
                                {
                                    ItemType         = Core.Items.ItemType.SimpleItem,
                                    OrderMode        = Core.Management.OrderMode.Fill,
                                    InitialInventory = 0.7,
                                    WarmupOrderCount = 5000,
                                    // Specify item weight and bundle size (though they will be overriden by the simple item config)
                                    ItemWeightMin = 2,
                                    ItemWeightMax = 8,
                                    BundleSizeMin = 4,
                                    BundleSizeMax = 12,
                                    // Lines per order
                                    OrderPositionCountMean   = 1,
                                    OrderPositionCountStdDev = 1,
                                    OrderPositionCountMin    = 1,
                                    OrderPositionCountMax    = 4,
                                    // Units per order line
                                    PositionCountMean   = 1,
                                    PositionCountStdDev = 0.3,
                                    PositionCountMin    = 1,
                                    PositionCountMax    = 3,
                                    // Further demand / fill mode settings
                                    DemandInventoryConfiguration = new DemandInventoryConfiguration()
                                    {
                                        OrderCount  = 200,
                                        BundleCount = 200,
                                        InventoryLevelDrivenBundleGeneration = true,
                                        InventoryLevelBundleStopThreshold    = 0.85,
                                        InventoryLevelBundleRestartThreshold = 0.65,
                                        InventoryLevelDrivenOrderGeneration  = true,
                                        InventoryLevelOrderStopThreshold     = 0.1,
                                        InventoryLevelOrderRestartThreshold  = 0.6,
                                    },
                                    // Simple item scenario
                                    SimpleItemConfiguration = new SimpleItemConfiguration()
                                    {
                                        GeneratorConfigFile = skuScenario
                                    },
                                },
                                // Override values
                                OverrideConfig = new OverrideConfiguration()
                                {
                                    OverrideInputStationCount          = true,
                                    OverrideInputStationCountValue     = iStationAmount,
                                    OverrideOutputStationCapacity      = true,
                                    OverrideOutputStationCapacityValue = oStationCapacity,
                                    OverrideBotCountPerOStation        = true,
                                    OverrideBotCountPerOStationValue   = botsPerOStationCount,
                                }
                            });
                        }
                    }
                }
            }

            // --> Save configurations
            Console.WriteLine("Writing all settings ...");
            foreach (var config in settings)
            {
                // Save
                string fileName = config.Name + ".xsett";
                Console.WriteLine("Saving " + fileName + " ...");
                InstanceIO.WriteSetting(fileName, config);
            }
        }