Beispiel #1
0
 def add_heat_map(self):
     algorithms = self.get_active_algorithm()
     param_x = support_func.get_value_from_combobox(
         self.ui.param_heat_map_1)
     param_y = support_func.get_value_from_combobox(
         self.ui.param_heat_map_2)
     if (param_x == param_y) or (param_x == {
             None: ''
     }) or (param_y == {
             None: ''
     }):
         error = "Параметры итерирования выбраны некорректно!"
         self.print_error(error)
         return
     if len(algorithms) != 1:
         error = "Должен быть выбран один алгоритм!"
         self.print_error(error)
         return
     p_x = AlgorithmParameter.get_parameters(list(param_x.keys())[0])
     p_y = AlgorithmParameter.get_parameters(list(param_y.keys())[0])
     n = self.ui.list_graph.count()
     if n > 0:
         self.ui.list_graph.takeAt(n - 1)
     graph = PossibleGraph("HEAT_MAP", [p_x, p_y], [], self.to_test_list)
     graph_widget = HeatMapWidget(graph)
     self.ui.list_graph.addWidget(
         graph_widget.get_widget(lower_limit=0,
                                 top_limit=1000,
                                 step_limit=1,
                                 algorithm=algorithms,
                                 print_error=self.print_error))
     self.ui.list_graph.addStretch(1)
Beispiel #2
0
 def add_linear_graph(self):
     algorithms = self.get_active_algorithm()
     d = support_func.get_value_from_combobox(self.ui.param_linear_graph)
     if d == {None: ''}:
         error = "Выберите параметр итерирования"
         self.print_error(error)
         return
     p = AlgorithmParameter.get_parameters(list(d.keys())[0])
     n = self.ui.list_graph.count()
     if n > 0:
         self.ui.list_graph.takeAt(n - 1)
     if p.allowable_values is not None:
         point_graph = PossibleGraph("POINT_GRAPH", p, [], algorithms)
         point_graph_wdg = PointGraphWidget(point_graph)
         self.ui.list_graph.addWidget(
             point_graph_wdg.get_widget(parent=self,
                                        algorithms=algorithms,
                                        print_error=self.print_error))
     else:
         line_graph = PossibleGraph("LINE_GRAPH", p, [], [])
         line_graph_wdg = LineGraphWidget(line_graph)
         self.ui.list_graph.addWidget(
             line_graph_wdg.get_widget(lower_limit=0,
                                       top_limit=1000,
                                       step_limit=1,
                                       algorithms=algorithms,
                                       print_error=self.print_error))
     self.ui.list_graph.addStretch(1)
Beispiel #3
0
 def set_params_value(self, list_p, **kwargs):
     # TODO: нигде не используется (к удалению)
     for k in kwargs.keys():
         obj = AlgorithmParameter.get_param_from_list(list_p, k)
         if obj is not None:
             obj.set_selected_values(kwargs.get(k))
         else:
             print("Параметра не существует")
Beispiel #4
0
    def __init__(self):
        super().__init__()
        self.name = "Standard GSA"
        self.full_name = "Гравитационный поиск"
        self.config_file = "..\\algorithms_exe\\standard_gsa_config.json"
        self.result_file_name = "..\\algorithms_exe\\result\\standard_gsa_res.json"

        self.parameters = [
            AlgorithmParameter.get_MI(),
            AlgorithmParameter.get_NP(),
            AlgorithmParameter.get_KN(),
            AlgorithmParameter.get_IG(),
            AlgorithmParameter.get_G0(),
            AlgorithmParameter.get_AG(),
            AlgorithmParameter.get_EC(),
            AlgorithmParameter.get_RN(),
            AlgorithmParameter.get_RP(),
            AlgorithmParameter.get_gamma()
        ]
Beispiel #5
0
 def f():
     for i in range(self.ui.form.count()):
         item = self.ui.form.itemAt(i).widget()
         if type(item) == QtWidgets.QSpinBox:
             name = self.ui.form.itemAt(i - 1).widget().text()
             value = item.value()
             s = AlgorithmParameter.get_param_on_name(settings, name)
             s.set_selected_values(value)
         elif type(item) == QtWidgets.QDoubleSpinBox:
             name = self.ui.form.itemAt(i - 1).widget().text()
             value = round(item.value(), 2)
             s = AlgorithmParameter.get_param_on_name(settings, name)
             s.set_selected_values(value)
         elif type(item) == QtWidgets.QComboBox:
             name = self.ui.form.itemAt(i - 1).widget().text()
             value = item.currentText()
             s = AlgorithmParameter.get_param_on_name(settings, name)
             s.set_selected_values(value)
     for p in self.parent().to_test_list[0].get_parameters():
         print(p.get_selected_values())
    def __init__(self):
        super().__init__()
        self.name = "Standard SAC"
        self.full_name = "Метод селективного усреднения"
        self.config_file = "..\\algorithms_exe\\standard_sac_config.json"
        self.result_file_name = "..\\algorithms_exe\\result\\standard_sac_res.json"

        self.parameters = [AlgorithmParameter.get_MI(), AlgorithmParameter.get_NP(), AlgorithmParameter.get_KN(),
                           AlgorithmParameter.get_gamma(), AlgorithmParameter.get_SF(), AlgorithmParameter.get_KQ(),
                           AlgorithmParameter.get_NF()]
Beispiel #7
0
    def __init__(self):
        super().__init__()
        self.name = "SAC-ACSA"
        self.full_name = "Метод селективного усреднения с ассиметричной областью"
        self.config_file = "..\\algorithms_exe\\sac_acsa_config.json"
        self.result_file_name = "..\\algorithms_exe\\result\\sac_acsa_res.json"

        self.parameters = [
            AlgorithmParameter.get_MI(),
            AlgorithmParameter.get_NP(),
            AlgorithmParameter.get_KN(),
            AlgorithmParameter.get_gamma(),
            AlgorithmParameter.get_SF(),
            AlgorithmParameter.get_KQ(),
            AlgorithmParameter.get_NF()
        ]
Beispiel #8
0
    def __init__(self):
        super().__init__()
        self.name = "Noise Resistance GSA"
        self.full_name = "Помехоустойчивый алгоритм гравитационного поиска"

        self._relative_path = "..\\algorithms_exe\\nr_gsa.exe"  # пусть до exe-шника с алгоритмом на golang
        self.config_file = "..\\algorithms_exe\\nr_gsa_config.json"
        self.result_file = "..\\algorithms_exe\\result\\nr_gsa_res.json"

        self.parameters = [
            AlgorithmParameter.get_MI(),
            AlgorithmParameter.get_NP(),
            AlgorithmParameter.get_KN(),
            AlgorithmParameter.get_IG(),
            AlgorithmParameter.get_G0(),
            AlgorithmParameter.get_AG(),
            AlgorithmParameter.get_EC(),
            AlgorithmParameter.get_RN(),
            AlgorithmParameter.get_RP(),
            AlgorithmParameter.get_gamma(),
            AlgorithmParameter.get_SF(),
            AlgorithmParameter.get_NF(),
            AlgorithmParameter.get_KQ(),
            AlgorithmParameter.get_EndNP(),
            AlgorithmParameter.get_ILCNP()
        ]