def run(self): population = self.initialPopulation() for i in range(self.iterations): print pretty("Optimizer iteration number %s" % (i + 1), BLUE) population = self.mutatePopulation(population) print bestSolution(population)
def run(self): pprint("OPT calculating initial population...", BLUE, self.printing) population = self.initialPopulation() for i in range(self.iterations): pprint("OPT iteration number %s" % (i + 1), BLUE, self.printing) population = self.mutatePopulation(population) print bestSolution(population)
def schedule(self): """ Runs the Scheduler with the OrderList from orderListName on the Plant with plantName. """ scheduler = Scheduler(self.plant, self.orderList) evaluator = Evaluator(self.plant) result = scheduler.start() if result != None: solutions = parseSolutions(result, self.plant, self.orderList) evaluator.evaluate(solutions) print bestSolution(solutions)
def optimize(self): simulator = Simulator(self.plant) evaluator = Evaluator.fromXmlFile(self.configFilename, self.plant) optimizer = Optimizer.fromXmlFile(self.configFilename, self.plant, self.orderList, simulator, evaluator) result = optimizer.run() best = bestSolution(result) best.unNormalize(self.normValue) print best
def schedule(args): """ Runs the Scheduler with the OrderList from orderListName on the Plant with plantName. """ plantName = args[0] orderListName = args[1] plant, orderList, normValue = loadPlantAndOrderList( plantName, orderListName) scheduler = Scheduler(plant, orderList) evaluator = Evaluator(plant) result = scheduler.start() if result != None: solutions = parseSolutions(result, plant, orderList) evaluator.evaluate(solutions) print bestSolution(solutions)
def schedule(self): """ Runs the Scheduler with the OrderList from orderListName on the Plant with plantName. """ scheduler = Scheduler(self.plant, self.orderList) evaluator = Evaluator.fromXmlFile(self.configFilename, self.plant) result = scheduler.start() if result != None: solutions = parseSolutions(result, self.plant, self.orderList) evaluator.evaluate(solutions) best = bestSolution(solutions) best.unNormalize(self.normValue) print best
def run(self): simulator = Simulator(self.plant) evaluator = Evaluator.fromXmlFile(self.configFilename, self.plant) optimizer = Optimizer.fromXmlFile(self.configFilename, self.plant, self.orderList, simulator, evaluator) scheduler = Scheduler(self.plant, self.orderList) result = scheduler.start() if result != None: solutions = parseSolutions(result, self.plant, self.orderList) for s in solutions: s.loadStartTimes(self.plant) result = optimizer.run(solutions) best = bestSolution(result) best.unNormalize(self.normValue) print best
def optimize(self): optimizer = Optimizer(self.plant, self.orderList, Simulator(self.plant), Evaluator(self.plant)) result = optimizer.run() print bestSolution(result)