From 5aaba17b2e812349a614119457ab9d7afa0f283c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Czeka=C5=84ski?= Date: Mon, 15 Jun 2020 14:59:37 +0200 Subject: [PATCH] Add printing tree decision to console --- src/game/Game.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/game/Game.py b/src/game/Game.py index 66f9d20..a93c581 100644 --- a/src/game/Game.py +++ b/src/game/Game.py @@ -197,6 +197,7 @@ class Game: # Choose target for player using decision tree if self.player.movementTarget is None: pickedEntity = survivalDecisionTree.pickEntity(self.player, self.map) + self.screen.ui.console.printToConsole("I've decided to go for: {}".format(pickedEntity.classifier.name)) if pickedEntity.classifier == Classifiers.FOOD: result = image_predictor.predict_image() self.screen.ui.console.printToConsole("I think it is a: " + result[1]) @@ -439,8 +440,10 @@ class Game: # Choose target for player using decision tree if self.player.movementTarget is None: - self.player.gotoToTarget(survivalDecisionTree.pickEntity(self.player, self.map), self.map) + pickedEntity = survivalDecisionTree.pickEntity(self.player, self.map) + self.player.gotoToTarget(pickedEntity, self.map) decisionsMade += 1 + self.screen.ui.console.printToConsole("I've decided to go for: {}".format(pickedEntity.classifier.name)) if pauseAfterDecision: pause = True