Exemplo n.º 1
0
		def setupUi(self, nodeLibraryView):
				nodeLibraryView.setObjectName(_fromUtf8("nodeLibraryView"))
				nodeLibraryView.resize(447, 443)
				self.verticalLayout = QtModule.QVBoxLayout(nodeLibraryView)
				self.verticalLayout.setSpacing(0)
				self.verticalLayout.setContentsMargins(2, 2, 2, 0)
				self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
				self.horizontalLayout = QtModule.QHBoxLayout()
				self.horizontalLayout.setSpacing(-1)
				self.horizontalLayout.setContentsMargins(8, -1, 8, -1)
				self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
				self.btn_reload = QtModule.QPushButton(nodeLibraryView)
				self.btn_reload.setMinimumSize(QtCore.QSize(60, 20))
				self.btn_reload.setMaximumSize(QtCore.QSize(60, 20))
				self.btn_reload.setObjectName(_fromUtf8("btn_reload"))
				self.horizontalLayout.addWidget(self.btn_reload)
				spacerItem = QtModule.QSpacerItem(40, 20, QtModule.QSizePolicy.Expanding, QtModule.QSizePolicy.Minimum)
				self.horizontalLayout.addItem(spacerItem)
				self.horizontalLayout.setStretch(1, 1)
				self.verticalLayout.addLayout(self.horizontalLayout)
				self.nodeList = NodeList(nodeLibraryView)
				self.nodeList.setObjectName(_fromUtf8("nodeList"))
				self.verticalLayout.addWidget(self.nodeList)
				self.verticalLayout.setStretch(1, 1)

				self.retranslateUi(nodeLibraryView)
				
				if  usePyQt4 :
					QtCore.QObject.connect(self.btn_reload, QtCore.SIGNAL(_fromUtf8("clicked()")), nodeLibraryView.onReload)
				else :
					self.btn_reload.clicked.connect( nodeLibraryView.onReload)
				QtCore.QMetaObject.connectSlotsByName(nodeLibraryView)
Exemplo n.º 2
0
 def __init__(self):
     self.__map = Map()
     self.__map.loadMap("test1.map")
     self.__mapSurface = self.__map.getMapSurface()
     self.__drone = Drone(5, 5)
     self.__nodeList = NodeList(self.__map)
     self.__placeDroneOnEmptyPosition()
     self.__pheromoneTable = [[1.0 for _ in range(Constants.NODE_COUNT)]
                              for _ in range(Constants.NODE_COUNT)]
     self.__distanceTable = self.__nodeList.getDistanceBetweenNodes()