0
class SomNetwork(object):
def __init__(self, dataset):
# some parameters that are not important here
pass
def one_step_learn(self, k, sigma_0, gamma_0, alfa, mcolor,population_of_ids):
pass
def learn(self):
pass
class StartQT4(QtGui.QMainWindow):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.ui = Ui_QSom()
self.ui.setupUi(self)
self.frame = MyFrame(self)
self.setCentralWidget(self.frame)
self.frame.start()
self.show()
class MyFrame(QtGui.QFrame):
simulationSpeed = 5000
def __init__(self, parent):
super(Ramka, self).__init__(parent)
self.init_Board()
def init_Board(self):
self.timer = QtCore.QBasicTimer()
我希望能夠與SomNetwork類進行交互,以便能夠從內部調用其方法MyFrame類方法。是否有任何特別的設計模式最適合這個例子,或者我應該只將類的實例作爲字段添加到MyFrame類中。什麼是將程序邏輯嵌入到pyqt4用戶界面的某些算法類中的最佳方式
感謝您的幫助提前!