-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgui.py
329 lines (323 loc) · 20.2 KB
/
gui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'fuzzyui.ui'
#
# Created by: PyQt5 UI code generator 5.15.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(800, 749)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
MainWindow.setSizePolicy(sizePolicy)
MainWindow.setMaximumSize(QtCore.QSize(2000, 2000))
MainWindow.setStyleSheet("background-color: rgb(211,211,211);")
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.gridLayoutWidget = QtWidgets.QWidget(self.centralwidget)
self.gridLayoutWidget.setGeometry(QtCore.QRect(50, 10, 714, 693))
self.gridLayoutWidget.setObjectName("gridLayoutWidget")
self.verticalLayout = QtWidgets.QVBoxLayout(self.gridLayoutWidget)
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
self.verticalLayout.setSpacing(2)
self.verticalLayout.setObjectName("verticalLayout")
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.verticalLayout.addItem(spacerItem)
self.browse_file_label = QtWidgets.QLabel(self.gridLayoutWidget)
font = QtGui.QFont()
font.setPointSize(16)
self.browse_file_label.setFont(font)
self.browse_file_label.setAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop)
self.browse_file_label.setObjectName("browse_file_label")
self.verticalLayout.addWidget(self.browse_file_label)
self.horizontalLayout1 = QtWidgets.QHBoxLayout()
self.horizontalLayout1.setSpacing(1)
self.horizontalLayout1.setObjectName("horizontalLayout1")
self.browse_file_text_edit = QtWidgets.QTextEdit(self.gridLayoutWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Ignored)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.browse_file_text_edit.sizePolicy().hasHeightForWidth())
self.browse_file_text_edit.setSizePolicy(sizePolicy)
self.browse_file_text_edit.setStyleSheet("background-color: rgb(255,255,255); margin-right: 20px")
self.browse_file_text_edit.setObjectName("browse_file_text_edit")
self.horizontalLayout1.addWidget(self.browse_file_text_edit)
self.browse_file_button = QtWidgets.QPushButton(self.gridLayoutWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.browse_file_button.sizePolicy().hasHeightForWidth())
self.browse_file_button.setSizePolicy(sizePolicy)
self.browse_file_button.setStyleSheet("background-color: rgb(161,161,161); padding: 4px 10px;")
self.browse_file_button.setDefault(False)
self.browse_file_button.setFlat(False)
self.browse_file_button.setObjectName("browse_file_button")
self.horizontalLayout1.addWidget(self.browse_file_button)
self.verticalLayout.addLayout(self.horizontalLayout1)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.verticalLayout.addItem(spacerItem1)
self.train_percentage_label = QtWidgets.QLabel(self.gridLayoutWidget)
font = QtGui.QFont()
font.setPointSize(16)
self.train_percentage_label.setFont(font)
self.train_percentage_label.setAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop)
self.train_percentage_label.setObjectName("train_percentage_label")
self.verticalLayout.addWidget(self.train_percentage_label)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.trainSlider = QtWidgets.QSlider(self.gridLayoutWidget)
self.trainSlider.setEnabled(False)
self.trainSlider.setOrientation(QtCore.Qt.Horizontal)
self.trainSlider.setObjectName("trainSlider")
self.horizontalLayout.addWidget(self.trainSlider)
self.train_spin_box = QtWidgets.QSpinBox(self.gridLayoutWidget)
self.train_spin_box.setEnabled(False)
self.train_spin_box.setStyleSheet("margin-left:20px")
self.train_spin_box.setObjectName("train_spin_box")
self.horizontalLayout.addWidget(self.train_spin_box)
self.verticalLayout.addLayout(self.horizontalLayout)
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.verticalLayout.addItem(spacerItem2)
self.data_train_label = QtWidgets.QLabel(self.gridLayoutWidget)
font = QtGui.QFont()
font.setPointSize(16)
self.data_train_label.setFont(font)
self.data_train_label.setStyleSheet("margin-bottom: 5px")
self.data_train_label.setAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop)
self.data_train_label.setObjectName("data_train_label")
self.verticalLayout.addWidget(self.data_train_label)
self.train_button = QtWidgets.QPushButton(self.gridLayoutWidget)
self.train_button.setEnabled(False)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.train_button.sizePolicy().hasHeightForWidth())
self.train_button.setSizePolicy(sizePolicy)
self.train_button.setLayoutDirection(QtCore.Qt.LeftToRight)
self.train_button.setStyleSheet("background-color: rgb(161,161,161); padding: 4px 10px; margin: 0 auto;")
self.train_button.setObjectName("train_button")
self.verticalLayout.addWidget(self.train_button)
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.verticalLayout.addItem(spacerItem3)
self.classify_label = QtWidgets.QLabel(self.gridLayoutWidget)
font = QtGui.QFont()
font.setPointSize(16)
self.classify_label.setFont(font)
self.classify_label.setStyleSheet("")
self.classify_label.setAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop)
self.classify_label.setObjectName("classify_label")
self.verticalLayout.addWidget(self.classify_label)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setContentsMargins(-1, 0, -1, -1)
self.horizontalLayout_2.setSpacing(6)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.mutation_label = QtWidgets.QLabel(self.gridLayoutWidget)
self.mutation_label.setStyleSheet("margin: 0 auto;")
self.mutation_label.setObjectName("mutation_label")
self.horizontalLayout_2.addWidget(self.mutation_label)
self.poblation_label = QtWidgets.QLabel(self.gridLayoutWidget)
self.poblation_label.setStyleSheet("margin: 0 auto;")
self.poblation_label.setObjectName("poblation_label")
self.horizontalLayout_2.addWidget(self.poblation_label)
self.generation_label = QtWidgets.QLabel(self.gridLayoutWidget)
self.generation_label.setStyleSheet("margin: 0 auto;")
self.generation_label.setObjectName("generation_label")
self.horizontalLayout_2.addWidget(self.generation_label)
self.tourney_label = QtWidgets.QLabel(self.gridLayoutWidget)
self.tourney_label.setStyleSheet("margin: 0 auto;")
self.tourney_label.setObjectName("tourney_label")
self.horizontalLayout_2.addWidget(self.tourney_label)
self.verticalLayout.addLayout(self.horizontalLayout_2)
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.mutation_box = QtWidgets.QDoubleSpinBox(self.gridLayoutWidget)
self.mutation_box.setEnabled(False)
self.mutation_box.setStyleSheet("background-color: rgb(255); margin: 10 auto;")
self.mutation_box.setSingleStep(0.05)
self.mutation_box.setProperty("value", 0.05)
self.mutation_box.setObjectName("mutation_box")
self.horizontalLayout_4.addWidget(self.mutation_box)
self.poblation_box = QtWidgets.QSpinBox(self.gridLayoutWidget)
self.poblation_box.setEnabled(False)
self.poblation_box.setAutoFillBackground(False)
self.poblation_box.setStyleSheet("background-color: rgb(255); margin: 10 auto;")
self.poblation_box.setMinimum(1)
self.poblation_box.setProperty("value", 20)
self.poblation_box.setObjectName("poblation_box")
self.horizontalLayout_4.addWidget(self.poblation_box)
self.generation_box = QtWidgets.QSpinBox(self.gridLayoutWidget)
self.generation_box.setEnabled(False)
self.generation_box.setAutoFillBackground(False)
self.generation_box.setStyleSheet("background-color: rgb(255); margin: 10 auto;")
self.generation_box.setMinimum(1)
self.generation_box.setProperty("value", 20)
self.generation_box.setObjectName("generation_box")
self.horizontalLayout_4.addWidget(self.generation_box)
self.tourney_box = QtWidgets.QSpinBox(self.gridLayoutWidget)
self.tourney_box.setEnabled(False)
self.tourney_box.setAutoFillBackground(False)
self.tourney_box.setStyleSheet("background-color: rgb(255); margin: 10 auto;")
self.tourney_box.setMinimum(2)
self.tourney_box.setMaximum(10)
self.tourney_box.setProperty("value", 5)
self.tourney_box.setObjectName("tourney_box")
self.horizontalLayout_4.addWidget(self.tourney_box)
self.verticalLayout.addLayout(self.horizontalLayout_4)
self.classify_button = QtWidgets.QPushButton(self.gridLayoutWidget)
self.classify_button.setEnabled(False)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.classify_button.sizePolicy().hasHeightForWidth())
self.classify_button.setSizePolicy(sizePolicy)
self.classify_button.setLayoutDirection(QtCore.Qt.LeftToRight)
self.classify_button.setStyleSheet("background-color: rgb(161,161,161); padding: 4px 10px; margin: 0 auto;")
self.classify_button.setObjectName("classify_button")
self.verticalLayout.addWidget(self.classify_button)
spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.verticalLayout.addItem(spacerItem4)
self.graphics_label = QtWidgets.QLabel(self.gridLayoutWidget)
font = QtGui.QFont()
font.setPointSize(16)
self.graphics_label.setFont(font)
self.graphics_label.setStyleSheet("")
self.graphics_label.setAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop)
self.graphics_label.setObjectName("graphics_label")
self.verticalLayout.addWidget(self.graphics_label)
self.horizontalLayout_6 = QtWidgets.QHBoxLayout()
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
self.genre_label = QtWidgets.QLabel(self.gridLayoutWidget)
self.genre_label.setStyleSheet("margin: 0 auto;")
self.genre_label.setObjectName("genre_label")
self.horizontalLayout_6.addWidget(self.genre_label)
self.genre_box = QtWidgets.QComboBox(self.gridLayoutWidget)
self.genre_box.setEnabled(False)
self.genre_box.setStyleSheet("background-color: rgb(255); margin: 10 auto;")
self.genre_box.setObjectName("genre_box")
self.genre_box.addItem("")
self.genre_box.addItem("")
self.genre_box.addItem("")
self.horizontalLayout_6.addWidget(self.genre_box)
self.parametro_graphic_label = QtWidgets.QLabel(self.gridLayoutWidget)
self.parametro_graphic_label.setStyleSheet("margin: 0 auto;")
self.parametro_graphic_label.setObjectName("parametro_graphic_label")
self.horizontalLayout_6.addWidget(self.parametro_graphic_label)
self.combo_box_parametros = QtWidgets.QComboBox(self.gridLayoutWidget)
self.combo_box_parametros.setEnabled(False)
self.combo_box_parametros.setStyleSheet("background-color: rgb(255); margin: 10 auto;")
self.combo_box_parametros.setObjectName("combo_box_parametros")
self.combo_box_parametros.addItem("")
self.combo_box_parametros.addItem("")
self.combo_box_parametros.addItem("")
self.combo_box_parametros.addItem("")
self.combo_box_parametros.addItem("")
self.horizontalLayout_6.addWidget(self.combo_box_parametros)
self.verticalLayout.addLayout(self.horizontalLayout_6)
self.plot_button = QtWidgets.QPushButton(self.gridLayoutWidget)
self.plot_button.setEnabled(False)
self.plot_button.setStyleSheet("background-color: rgb(161,161,161); padding: 4px 10px; margin: 0 auto;")
self.plot_button.setObjectName("plot_button")
self.verticalLayout.addWidget(self.plot_button)
spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.verticalLayout.addItem(spacerItem5)
self.rule_act_label = QtWidgets.QLabel(self.gridLayoutWidget)
font = QtGui.QFont()
font.setPointSize(16)
self.rule_act_label.setFont(font)
self.rule_act_label.setStyleSheet("")
self.rule_act_label.setAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop)
self.rule_act_label.setObjectName("rule_act_label")
self.verticalLayout.addWidget(self.rule_act_label)
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.parameter1_box = QtWidgets.QComboBox(self.gridLayoutWidget)
self.parameter1_box.setEnabled(False)
self.parameter1_box.setStyleSheet("background-color: rgb(255); margin: 10 auto;")
self.parameter1_box.setObjectName("parameter1_box")
self.horizontalLayout_3.addWidget(self.parameter1_box)
self.parameter2_box = QtWidgets.QComboBox(self.gridLayoutWidget)
self.parameter2_box.setEnabled(False)
self.parameter2_box.setStyleSheet("background-color: rgb(255); margin: 10 auto;")
self.parameter2_box.setObjectName("parameter2_box")
self.horizontalLayout_3.addWidget(self.parameter2_box)
self.parameter3_box = QtWidgets.QComboBox(self.gridLayoutWidget)
self.parameter3_box.setEnabled(False)
self.parameter3_box.setStyleSheet("background-color: rgb(255); margin: 10 auto;")
self.parameter3_box.setObjectName("parameter3_box")
self.horizontalLayout_3.addWidget(self.parameter3_box)
self.parameter4_box = QtWidgets.QComboBox(self.gridLayoutWidget)
self.parameter4_box.setEnabled(False)
self.parameter4_box.setStyleSheet("background-color: rgb(255); margin: 10 auto;")
self.parameter4_box.setObjectName("parameter4_box")
self.horizontalLayout_3.addWidget(self.parameter4_box)
self.verticalLayout.addLayout(self.horizontalLayout_3)
spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.verticalLayout.addItem(spacerItem6)
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.rules_button = QtWidgets.QPushButton(self.gridLayoutWidget)
self.rules_button.setEnabled(False)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.rules_button.sizePolicy().hasHeightForWidth())
self.rules_button.setSizePolicy(sizePolicy)
self.rules_button.setStyleSheet("background-color: rgb(161,161,161); padding: 4px 10px;")
self.rules_button.setObjectName("rules_button")
self.horizontalLayout_5.addWidget(self.rules_button)
self.act_button = QtWidgets.QPushButton(self.gridLayoutWidget)
self.act_button.setEnabled(False)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.act_button.sizePolicy().hasHeightForWidth())
self.act_button.setSizePolicy(sizePolicy)
self.act_button.setStyleSheet("background-color: rgb(161,161,161); padding: 4px 10px;")
self.act_button.setObjectName("act_button")
self.horizontalLayout_5.addWidget(self.act_button)
self.verticalLayout.addLayout(self.horizontalLayout_5)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 21))
self.menubar.setObjectName("menubar")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.browse_file_label.setText(_translate("MainWindow", "Introducir archivo"))
self.browse_file_text_edit.setPlaceholderText(_translate("MainWindow", "Introduzca la ubicacion del archivo"))
self.browse_file_button.setText(_translate("MainWindow", "Examinar"))
self.train_percentage_label.setText(_translate("MainWindow", "Porcentaje Entrenar"))
self.data_train_label.setText(_translate("MainWindow", "Entrenar Datos"))
self.train_button.setText(_translate("MainWindow", "Comenzar Entrenamiento"))
self.classify_label.setText(_translate("MainWindow", "Generar y Clasificar Reglas con Algoritmo Genético"))
self.mutation_label.setText(_translate("MainWindow", "Probabilidad de Mutación"))
self.poblation_label.setText(_translate("MainWindow", "Población"))
self.generation_label.setText(_translate("MainWindow", "Número de Generaciones"))
self.tourney_label.setText(_translate("MainWindow", "Tamaño de torneo"))
self.classify_button.setText(_translate("MainWindow", "Generar y Clasificar Reglas"))
self.graphics_label.setText(_translate("MainWindow", "Gráficas de Funciones Miembro"))
self.genre_label.setText(_translate("MainWindow", "Género de Videojuego"))
self.genre_box.setItemText(0, _translate("MainWindow", "Escoja"))
self.genre_box.setItemText(1, _translate("MainWindow", "Plataforma"))
self.genre_box.setItemText(2, _translate("MainWindow", "Calculo"))
self.parametro_graphic_label.setText(_translate("MainWindow", "Parámetro"))
self.combo_box_parametros.setItemText(0, _translate("MainWindow", "Escoja"))
self.combo_box_parametros.setItemText(1, _translate("MainWindow", "SepalLargo"))
self.combo_box_parametros.setItemText(2, _translate("MainWindow", "SepalAncho"))
self.combo_box_parametros.setItemText(3, _translate("MainWindow", "PetalLargo"))
self.combo_box_parametros.setItemText(4, _translate("MainWindow", "PetalAncho"))
self.plot_button.setText(_translate("MainWindow", "Graficar Función"))
self.rule_act_label.setText(_translate("MainWindow", "Reglas del Sistema Y Activación de Parámetros"))
self.rules_button.setText(_translate("MainWindow", "Reglas de Sistema"))
self.act_button.setText(_translate("MainWindow", "Muestra"))