Example #1
0
 def testSdoeNUSF(self):
     if self.hasNoIndex():
         reply = self.showIndexWarning()
         if reply == QMessageBox.Yes:
             pass
         else:
             return
     if self.hasNoWeight():
         self.showWeightWarning()
         return
     if self.hasWeight():
         self.showWeightBlock()
         return
     if self.hasIndex():
         self.showIndexBlock()
         return
     #test using nr=2
     self.testRuntime = []
     runtime = sdoe.run(self.writeConfigFile(test=True),
                        self.designSize_spin.value(),
                        test=True)
     self.testSdoeButton.setEnabled(False)
     self.progressNUSF_groupBox.setEnabled(True)
     self.updateRunTimeNUSF(runtime)
     self.testRuntime.append(runtime)
Example #2
0
    def testSdoeIRSF(self):
        if self.hasNoIndex():
            reply = self.showIndexWarning()
            if reply == QMessageBox.Yes:
                pass
            else:
                return
        if self.hasNoResponse():
            self.showResponseWarning()
            return
        if self.hasIndex():
            self.showIndexBlock()
            return

        QApplication.processEvents()

        #test using nr=2
        self.testRuntime = []
        t1, t2 = sdoe.run(self.writeConfigFile(test=True),
                          self.designSizeIRSF_spin.value(),
                          test=True)
        runtime = t1 + (5 * (t2 / 2))
        self.testSdoeButton.setEnabled(False)
        self.progress2_groupBox.setEnabled(True)
        self.updateRunTimeIRSF(runtime)
        self.testRuntime.append(runtime)

        QApplication.processEvents()
Example #3
0
    def runSdoe(self):
        self.runSdoeButton.setText('Stop SDOE')
        min_size = self.minDesignSize_spin.value()
        max_size = self.maxDesignSize_spin.value()
        numIter = (max_size + 1) - min_size
        for nd in range(min_size, max_size + 1):
            config_file = self.writeConfigFile()
            mode, design_size, num_restarts, elapsed_time, outfile, best_val = sdoe.run(
                config_file, nd)
            self.analysis.append([
                mode, design_size, num_restarts, elapsed_time, outfile,
                config_file, best_val
            ])
            self.analysisTableGroup.setEnabled(True)
            self.loadAnalysisButton.setEnabled(False)
            self.deleteAnalysisButton.setEnabled(False)
            self.updateAnalysisTable()
            self.designInfo_dynamic.setText('d = %d, n = %d' %
                                            (nd, num_restarts))
            self.SDOE_progressBar.setValue(
                (100 / numIter) * (nd - min_size + 1))
            QApplication.processEvents()

        self.SDOE_progressBar.setValue(0)
        self.runSdoeButton.setText('Run SDOE')
        self.analysisGroup.setEnabled(False)
Example #4
0
 def testSdoe(self):
     #test using max design size and nd=200
     self.testRuntime = []
     runtime = sdoe.run(self.writeConfigFile(test=True), self.maxDesignSize_spin.value(), test=True)
     self.testSdoeButton.setEnabled(False)
     self.progress_groupBox.setEnabled(True)
     self.updateRunTime(runtime)
     self.testRuntime.append(runtime)
Example #5
0
    def runSdoeNUSF(self):
        if self.hasNoIndex():
            reply = self.showIndexWarning()
            if reply == QMessageBox.Yes:
                pass
            else:
                return
        if self.hasNoWeight():
            self.showWeightWarning()
            return
        if self.hasWeight():
            self.showWeightBlock()
            return
        if self.hasIndex():
            self.showIndexBlock()
            return
        self.runSdoeNUSFButton.setText('Stop SDOE')
        size = self.designSize_spin.value()
        mwr_list = []
        for item in [
                self.MWR1_comboBox.currentText(),
                self.MWR2_comboBox.currentText(),
                self.MWR3_comboBox.currentText(),
                self.MWR4_comboBox.currentText(),
                self.MWR5_comboBox.currentText()
        ]:
            if item != "":
                mwr_list.append(int(item))

        config_file = self.writeConfigFile()
        fnames, results, elapsed_time = sdoe.run(config_file, size)
        self.analysisTableGroup.setEnabled(True)
        self.loadAnalysisButton.setEnabled(False)
        self.orderAnalysisButton.setEnabled(False)
        self.deleteAnalysisButton.setEnabled(False)

        count = 0
        for mwr in mwr_list:
            self.analysis.append([
                mwr, results[mwr]['design_size'], results[mwr]['num_restarts'],
                results[mwr]['elapsed_time'], fnames[mwr], config_file,
                results[mwr]['best_val'], results[mwr]
            ])

            self.updateAnalysisTable()
            self.designInfoNUSF_dynamic.setText(
                'mwr = %d, n = %d' % (mwr, results[mwr]['num_restarts']))
            count += 1
            self.SDOENUSF_progressBar.setValue((100 / len(mwr_list)) * count)
            QApplication.processEvents()

        self.SDOENUSF_progressBar.setValue(0)
        self.runSdoeNUSFButton.setText('Run SDOE')
        self.analysisGroup.setEnabled(False)
Example #6
0
    def runSdoe(self):

        min_size = self.minDesignSize_spin.value()
        max_size = self.maxDesignSize_spin.value()
        numIter = (max_size + 1) - min_size
        f = open(os.path.join(self.dname, 'tqdm_progress.txt'), 'w')
        for nd in tqdm(range(min_size, max_size+1), file = f):
            config_file = self.writeConfigFile()
            mode, design_size, num_restarts, elapsed_time, outfile = sdoe.run(config_file, nd)
            self.analysis.append([mode, design_size, num_restarts, elapsed_time, outfile, config_file])
            self.analysisTableGroup.setEnabled(True)
            self.updateAnalysisTable()
            self.SDOE_progressBar.setValue((100/numIter) * (nd-min_size+1))
        f.close()
        self.SDOE_progressBar.setValue(0)
        self.analysisGroup.setEnabled(False)
Example #7
0
 def testSdoe(self):
     if self.hasNoIndex():
         reply = self.showIndexWarning()
         if reply == QMessageBox.Yes:
             pass
         else:
             return
     #test using max design size and nd=200
     self.testRuntime = []
     runtime = sdoe.run(self.writeConfigFile(test=True),
                        self.maxDesignSize_spin.value(),
                        test=True)
     self.testSdoeButton.setEnabled(False)
     self.progress_groupBox.setEnabled(True)
     self.updateRunTime(runtime)
     self.testRuntime.append(runtime)
Example #8
0
    def runSdoe(self):
        if self.hasNoIndex():
            reply = self.showIndexWarning()
            if reply == QMessageBox.Yes:
                pass
            else:
                return
        if self.hasIndex():
            self.showIndexBlock()
            return
        self.runSdoeButton.setText('Stop SDOE')
        min_size = self.minDesignSize_spin.value()
        max_size = self.maxDesignSize_spin.value()
        numIter = (max_size + 1) - min_size
        QApplication.processEvents()
        self.freeze()
        for nd in range(min_size, max_size + 1):
            config_file = self.writeConfigFile()
            fnames, results, elapsed_time = sdoe.run(config_file, nd)
            new_analysis = SdoeAnalysisData()
            new_analysis.sf_method = 'usf'
            new_analysis.optimality = results['mode']
            new_analysis.d = results['design_size']
            new_analysis.nr = results['num_restarts']
            new_analysis.runtime = elapsed_time
            new_analysis.criterion = results['best_val']
            new_analysis.config_file = config_file
            new_analysis.fnames = fnames

            self.analysis.append(new_analysis)
            self.analysisTableGroup.setEnabled(True)
            self.loadAnalysisButton.setEnabled(False)
            self.orderAnalysisButton.setEnabled(False)
            self.deleteAnalysisButton.setEnabled(False)
            self.updateAnalysisTable()
            self.designInfo_dynamic.setText('d = %d, n = %d' %
                                            (nd, results['num_restarts']))
            self.SDOE_progressBar.setValue(
                (100 / numIter) * (nd - min_size + 1))
            QApplication.processEvents()

        self.unfreeze()
        self.SDOE_progressBar.setValue(0)
        self.runSdoeButton.setText('Run SDOE')
        self.analysisGroup.setEnabled(False)
Example #9
0
    def runSdoeIRSF(self):
        if self.hasNoIndex():
            reply = self.showIndexWarning()
            if reply == QMessageBox.Yes:
                pass
            else:
                return
        if self.hasNoResponse():
            self.showResponseWarning()
            return
        if self.hasIndex():
            self.showIndexBlock()
            return

        QApplication.processEvents()
        self.runSdoe2Button.setText('Stop SDOE')
        size = self.designSizeIRSF_spin.value()

        config_file = self.writeConfigFile()
        fnames, results, elapsed_time = sdoe.run(config_file, size)
        new_analysis = SdoeAnalysisData()
        new_analysis.sf_method = 'irsf'
        new_analysis.optimality = 'maximin'
        new_analysis.d = results[1]['design_size']
        new_analysis.nr = results[1]['num_restarts']
        new_analysis.runtime = elapsed_time
        new_analysis.designs = results[1]['num_designs']
        new_analysis.config_file = config_file
        new_analysis.fnames = fnames
        new_analysis.results = results

        self.analysis.append(new_analysis)

        self.updateAnalysisTable()

        self.analysisTableGroup.setEnabled(True)
        self.loadAnalysisButton.setEnabled(False)
        self.orderAnalysisButton.setEnabled(False)
        self.deleteAnalysisButton.setEnabled(False)

        self.SDOE2_progressBar.setValue(0)
        self.runSdoe2Button.setText('Run SDOE')
        self.analysisGroup.setEnabled(False)
        QApplication.processEvents()
Example #10
0
    def runSdoeNUSF(self):
        if self.hasNoIndex():
            reply = self.showIndexWarning()
            if reply == QMessageBox.Yes:
                pass
            else:
                return
        if self.hasNoWeight():
            self.showWeightWarning()
            return
        if self.hasWeight():
            self.showWeightBlock()
            return
        if self.hasIndex():
            self.showIndexBlock()
            return
        self.runSdoe2Button.setText('Stop SDOE')
        size = self.designSize_spin.value()
        mwr_list = []
        for item in [
                self.MWR1_comboBox.currentText(),
                self.MWR2_comboBox.currentText(),
                self.MWR3_comboBox.currentText(),
                self.MWR4_comboBox.currentText(),
                self.MWR5_comboBox.currentText()
        ]:
            if item != "":
                mwr_list.append(int(item))

        config_file = self.writeConfigFile()
        QApplication.processEvents()
        self.freeze()
        fnames, results, elapsed_time = sdoe.run(config_file, size)
        self.analysisTableGroup.setEnabled(True)
        self.loadAnalysisButton.setEnabled(False)
        self.orderAnalysisButton.setEnabled(False)
        self.deleteAnalysisButton.setEnabled(False)

        count = 0
        QApplication.processEvents()
        for mwr in mwr_list:
            new_analysis = SdoeAnalysisData()
            new_analysis.sf_method = 'nusf'
            new_analysis.optimality = 'maximin'
            new_analysis.mwr = mwr
            new_analysis.d = results[mwr]['design_size']
            new_analysis.nr = results[mwr]['num_restarts']
            new_analysis.runtime = results[mwr]['elapsed_time']
            new_analysis.criterion = results[mwr]['best_val']
            new_analysis.config_file = config_file
            new_analysis.fnames = fnames[mwr]
            new_analysis.results = results[mwr]

            self.analysis.append(new_analysis)

            self.updateAnalysisTable()
            self.designInfo2_dynamic.setText(
                'mwr = %d, n = %d' % (mwr, results[mwr]['num_restarts']))
            count += 1
            self.SDOE2_progressBar.setValue((100 / len(mwr_list)) * count)
            QApplication.processEvents()

        self.unfreeze()
        self.SDOE2_progressBar.setValue(0)
        self.runSdoe2Button.setText('Run SDOE')
        self.analysisGroup.setEnabled(False)
        QApplication.processEvents()