예제 #1
0
        public MainWindow()
        {
            allGeneratedBenchmarks = new List <BenchmarkInstance>();
            generationArgs         = new GenerationArgs();

            InitializeComponent();
            MainWindowSetup();
        }
        public static string UpdateStatusWithGenerationArgs(GenerationArgs genArgs, TextBox txStatus)
        {
            string status = txStatus.Text;

            status += string.Format($"Jobs: {genArgs.NumberOfJobs} \n Machine Capacity: {genArgs.MachineCapacity}\n");
            status += string.Format($"Proc. time: [ {genArgs.JobProcessingTimeFrom} , {genArgs.JobProcessingTimeTo} ]\n");
            status += string.Format($"Sizes: [ {genArgs.JobSizeFrom} , {genArgs.JobSizeTo} ]\n\n");

            return(status);
        }
        public static string UpdateStatusWithGenArgsAndSaveDirectory(GenerationArgs genArgs, string directory)
        {
            string status = "";

            status  = "Benchmarks parameters: \n";
            status += string.Format($"Jobs: {genArgs.NumberOfJobs} \n Machine Capacity: {genArgs.MachineCapacity}\n");
            status += string.Format($"Proc. time: [ {genArgs.JobProcessingTimeFrom} , {genArgs.JobProcessingTimeTo} ]\n");
            status += string.Format($"Sizes: [ {genArgs.JobSizeFrom} , {genArgs.JobSizeTo} ]\n\n");

            status += "Benchmark instnaces will be saved in: \n";
            status += directory + "\n\n";

            return(status);
        }
        public static void SetJobSizeArgs(string jobSizeRange, GenerationArgs genArgs)
        {
            int[] jobSizeArgs = DecomposeSquareBracketStringToInts(jobSizeRange);

            try
            {
                genArgs.JobSizeFrom = jobSizeArgs[0];
                genArgs.JobSizeTo   = jobSizeArgs[1];
            }
            catch (System.NullReferenceException nrex)
            {
                MessageBox.Show($"Message: {nrex.Message} \n Source: {nrex.Source}");
            }
            catch (System.Exception ex)
            {
                MessageBox.Show($"Message: {ex.Message} \n Source: {ex.Source}");
            }
        }
예제 #5
0
        private void GenerateAndAddBencharkInstanceToList(GenerationArgs gArgs)
        {
            BenchmarkInstance benchmark = null;

            try
            {
                benchmark = BPMGeneratorMethods.GenerateOneBencharkInstance(gArgs);
            }
            catch (ArgumentOutOfRangeException rex)
            {
                MessageBox.Show(rex.Message);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            if (benchmark != null)
            {
                allGeneratedBenchmarks.Add(benchmark);
            }
        }
 public static void SetNumberOfJobsArgs(string numberOfJobs, GenerationArgs genArgs)
 {
     genArgs.NumberOfJobs = int.Parse(numberOfJobs);
 }
 public static void SetMachineCapacityArgs(string machineCapacity, GenerationArgs genArgs)
 {
     genArgs.MachineCapacity = int.Parse(machineCapacity);
 }