def main(): # Create Problem polynomial = Polynomial(num_terms=5, num_dimensions=2) log.info(polynomial) # Define Search Range search_range = SearchRange() search_range.set_feasible_range(10000, 2) # Solvers # brute_force_solver = BruteForceSolver(search_range) genetic_algorithm_solver = GeneticAlgorithmSolver(search_range) gui = Gui(polynomial, search_range) # benchmark = Benchmark([brute_force_solver, genetic_algorithm_solver]) benchmark = Benchmark([genetic_algorithm_solver]) # Benchmark benchmark.evaluate(polynomial) # Visualize Solvers # gui.create_animation(brute_force_solver) animation = gui.create_animation(genetic_algorithm_solver) # Create Default Visual # gui.plot_problem() gui.show()
import sys from PyQt4 import QtGui from gui.gui import Gui from gui.threadgui import ThreadGui from camera.camera import Camera from camera.threadcamera import ThreadCamera import signal signal.signal(signal.SIGINT, signal.SIG_DFL) if __name__ == '__main__': camera = Camera() print(camera) app = QtGui.QApplication(sys.argv) window = Gui() window.setCamera(camera) window.show() t1 = ThreadCamera(camera) t1.start() t2 = ThreadGui(window) t2.start() sys.exit(app.exec_())
import sys import argparse from PyQt5.QtWidgets import QApplication from gui.gui import Gui app = QApplication(sys.argv) app.setOrganizationDomain('rahmedov.com') app.setObjectName('rahmedov') app.setApplicationName('rahmedov') app.setApplicationVersion('0.0.0') parser = argparse.ArgumentParser(description='Home') parser.add_argument('-r', '--root', type=str, default='', help='''Root Path''') args = parser.parse_args() g = Gui(root=args.root, parent=None) g.show() sys.exit(app.exec_())