return ""
def call_genetic_algorithm(self):
if not terminalmode:
ui_action_and_signals.signal_progressbar_increase.emit(5)
ui_action_and_signals.signal_status.emit("Updating charts and work in background")
n = L.get_game_count(p.current_strategy)
lg = int(
p.selected_strategy["considerLastGames"]) // only consider lg last games to see if there was a loss
f = L.get_strategy_return(p.current_strategy, lg)
if not terminalmode: ui_action_and_signals.signal_lcd_number_update.emit("gamenumber",int(n))
if not terminalmode: ui_action_and_signals.signal_lcd_number_update.emit("winnings", f)
logger.info("Game //" + str(n) + " - Last " + str(lg) + ": $" + str(f))
if n % int(p.selected_strategy["strategyIterationGames"]) == 0 and f < float(
p.selected_strategy["minimumLossForIteration"]):
if not terminalmode: ui_action_and_signals.signal_status.emit("***Improving current strategy***")
logger.info("***Improving current strategy***")
//winsound.Beep(500, 100)
GeneticAlgorithm(True, logger, L)
p.read_strategy()
After Change
def call_genetic_algorithm(self):
self.gui_signals.signal_progressbar_increase.emit(5)self.gui_signals.signal_status.emit("Updating charts and work in background")
n = L.get_game_count(p.current_strategy)
lg = int(
p.selected_strategy["considerLastGames"]) // only consider lg last games to see if there was a loss
f = L.get_strategy_return(p.current_strategy, lg)
self.gui_signals.signal_lcd_number_update.emit("gamenumber",int(n))
self.gui_signals.signal_lcd_number_update.emit("winnings", f)
self.logger.info("Game //" + str(n) + " - Last " + str(lg) + ": $" + str(f))
if n % int(p.selected_strategy["strategyIterationGames"]) == 0 and f < float(
p.selected_strategy["minimumLossForIteration"]):
self.gui_signals.signal_status.emit("***Improving current strategy***")
self.logger.info("***Improving current strategy***")
//winsound.Beep(500, 100)
GeneticAlgorithm(True, logger, L)