from Controller import controller data_file_path = "words.txt" params_file_path = "parameters.txt" controller = controller(data_file_path, params_file_path) print("computing the solution") ''' ''' best_ant = controller.run() result = best_ant.getResult(controller.problem) for i in result: print(i) print("fitness ", best_ant.fitness(controller.problem)) ''' controller.tests() ''' ''' controller.plot() '''
# -*- coding: utf-8 -*- """ Created on Sun Jun 03 17:07:02 2018 @author: Lior Reznik The Main of the program. """ from Tkinter import Tk from Controller import controller #starts a root mainframe and calling to the controller init root = Tk() controller(root) root.mainloop()
from devices.DeviceManager import DeviceManager from devices.simulation.TempSensorSim import TempSensor from Controller import controller from base.Config import Config import threading import json gi.require_version('Gtk', '3.0') from gi.repository import Gtk, GObject, GLib GObject.threads_init() if (__name__ == "__main__"): #read the config-file and make it accesable "like" a singleton with open("brewcontrol.conf", "r") as conf_file: data = json.load(conf_file) confHolder = Config() confHolder.conf = data #cycTime = cycleTime() ctr = controller() #start gtk3 gui if (confHolder.conf["interface"]["gtk3"]["enable"]): myUi = MainWindow() myUi.setController(ctr) myThread = threading.Thread(target=myUi.start) myThread.start() # myDeviceManager = DeviceManager() myTempSensorSim = TempSensor() threading.Thread(target=ctr.start).start()
plt.xlabel('Generation number') plt.show() return results[0] if __name__ == '__main__': args = [] args.append(populationSize) args.append(inidividualSize) args.append(initialCoordinates) args.append(map) args.append(crossOverProb) args.append(mutateProb) repository = repository() controller = controller(args, repository) # f = open("Stats/test.txt", "a") # f.write("-------------------------------------------------------\n") # f.write("| Seed | Average Deviation | Standard Deviation |\n") # f.close() for i in range(1): repository.createPopulation(args) path = oneRun() seed = seeds[i] random.seed(seed) fitAvg = repository.getFitnessAvg() data = np.array(fitAvg) # averageDev = np.average(data) # standardDev = data.std() # f = open("Stats/test.txt", "a")
if __name__ == '__main__': try: # if this is run as a package # it requires arguments args = parser.parse_args() # print ('sources: %s <= %s'%(handlers['source'].keys(), args.source)) # print ('sinks: %s <= %s'%(handlers['sink'].keys(), args.sink)) # src = handlers['source'][args.source] # sink = handlers['sink'][args.sink] mappingManager = mapping_managers[args.mm] # print('chosen source: %s'%src) # print('chosen sink: %s'%sink) c = controller(mappingManager) template_path = None if args.template: template_path = c.make_template() print('created template at %s' % template_path) else: print('--template not provided skipping that') outfile_path = None if args.convert: outfile_path = c.do_convert(template_path=template_path) print('created outfile at %s' % outfile_path) else: print('--convert not provided skipping that')
''' Created on May 3, 2019 @author: Wolf ''' from Controller import controller if __name__ == '__main__': pass ctrl = controller('input.in', 'output.out', 'problem.in') print(ctrl.getV())