From 873bfd0d8e16a9d4944cb3cf7367ab9ff99cad82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Czeka=C5=84ski?= Date: Sun, 24 May 2020 18:26:10 +0200 Subject: [PATCH] Add method returning description of dt survival example --- .../projectSpecificClasses/SurvivalDTExample.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/AI/DecisionTrees/projectSpecificClasses/SurvivalDTExample.py b/src/AI/DecisionTrees/projectSpecificClasses/SurvivalDTExample.py index 7888aea..d1b704c 100644 --- a/src/AI/DecisionTrees/projectSpecificClasses/SurvivalDTExample.py +++ b/src/AI/DecisionTrees/projectSpecificClasses/SurvivalDTExample.py @@ -60,3 +60,14 @@ class SurvivalDTExample(DecisionTreeExample): attrsAreEqual = False return attrsAreEqual + + def getDescription(self): + dsc = "Classification: {}".format(self.classification) + dsc += "\nHunger: {}".format(self.hungerVal.name) + dsc += "\nThirst: {}".format(self.thirstVal.name) + dsc += "\nStamina: {}".format(self.staminaVal.name) + dsc += "\nDistance from food: {}".format(self.distFromFood.name) + dsc += "\nDistance from water: {}".format(self.distFromWater.name) + dsc += "\nDistance from rest place: {}".format(self.distFromRestPlace.name) + + return dsc