Esempio n. 1
0
        static void Main(string[] args)
        {
            SimulationParameter parameters = new SimulationParameter();

            parameters.Seed = 46;

            //1-Specify the xml files
            parameters.LayoutPath             = "flow_layout.xml";
            parameters.JobPath                = "flow_jobmix.xml";
            parameters.Configuration.ToolPath = "flow_binloading.xml";
            //parameters.Configuration.TracePath = Directory.GetCurrentDirectory() +  "\\Trace Files\\" + parameters.Seed + ".xml";
            // parameters.Configuration.TracePath = Directory.GetCurrentDirectory() + "\\Trace Files\\A100.xml";   //IE486f18
            parameters.Configuration.TracePath = Directory.GetCurrentDirectory() + "\\Trace Files\\Trace-B.xml";   //IE486f18
            // parameters.Configuration.TracePath = Directory.GetCurrentDirectory() + "\\Trace Files\\B100.xml";   //IE486f18
            //parameters.Configuration.TracePath = Directory.GetCurrentDirectory() + "\\Trace Files\\A1B1.xml";   //IE486f18
            //parameters.Configuration.TracePath = Directory.GetCurrentDirectory() + "\\Trace Files\\A10B10.xml";   //IE486f18
            //parameters.Configuration.TracePath = Directory.GetCurrentDirectory() + "\\Trace Files\\A50B50.xml";   //IE486f18

            //2-Specify the simulation run time parameters
            parameters.Configuration.SimulationPeriodTime = 75600;
            parameters.Configuration.WarmupPeriodTime     = 18000; //  486update 25.12.2018
            parameters.Configuration.FinalArrivalTime     = 75600;
            parameters.Configuration.PlanningPeriodTime   = 75600;

            //Below are the set of algorithms that will be used during the simulation
            //3-Modify the algorithms as you desire
            parameters.Algorithms.PartSequencingForProcessorAlgorithm = "FirstComeMustGo";
            parameters.Algorithms.StationControllerAlgorithm          = "MixedProcessorConfiguration";
            parameters.Algorithms.OrderControllerAlgorithm            = "ByPassReplenish";
            parameters.Algorithms.OrderReleaseAlgorithm       = "CyclicalImmediate";
            parameters.Algorithms.StationSelectionAlgorithm   = "SelectionOfFirstStation";
            parameters.Algorithms.PullAlgorithm               = "FirstBlockedFirstServed";
            parameters.Algorithms.PushAlgorithm               = "AlwaysPush";
            parameters.Algorithms.ProcessorSelectionAlgorithm = "NonDelaySPT";


            parameters.Configuration.JobArrivalType = JobArrivalType.TraceBased;
            //parameters.Configuration.JobArrivalType = JobArrivalType.DistributionBased; //IE486f18
            parameters.Configuration.SimulationPeriodType = SimulationPeriodType.TimeBased;
            parameters.Configuration.PlanningPeriodType   = PlanningPeriodType.TimeBased;
            parameters.Configuration.LoadingPeriodType    = LoadingPeriodType.TimeBased;

            parameters.Configuration.PeriodState = new FileOutput(true, "periodstate.xml");

            //4-Prepare the environment and run the simulation
            SimulationManager simulationManager = new SimulationManager();
            string            path = "Seed-" + parameters.Seed + "OnhandInventory.txt";

            simulationManager.path      = path;
            simulationManager.Parameter = parameters;
            simulationManager.ConstructSystem();
            simulationManager.PrepareSimulation();
            simulationManager.PerformSimulation();

            //5-Reporting. Note that the report xml file will be generated in the Wrapper\bin\Debug folder with a random name i.e. c2ed605b-088d-474a-98c6-f939765683cd.xml
            Reporter reporter = new Reporter();

            path = "Seed-" + parameters.Seed + "Report";
            reporter.BuildStatisticsReport(simulationManager, path);
        }