From 8bc292f06dec3bcaaeea175d199c795889ee1584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Czeka=C5=84ski?= Date: Sat, 23 May 2020 17:16:28 +0200 Subject: [PATCH] Create survival dt attributes definitions Definitions like hungerAttribute etc... --- .../SurvivalAttributesDefinitions.py | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/AI/DecisionTrees/projectSpecificClasses/SurvivalAttributesDefinitions.py diff --git a/src/AI/DecisionTrees/projectSpecificClasses/SurvivalAttributesDefinitions.py b/src/AI/DecisionTrees/projectSpecificClasses/SurvivalAttributesDefinitions.py new file mode 100644 index 0000000..169ec3b --- /dev/null +++ b/src/AI/DecisionTrees/projectSpecificClasses/SurvivalAttributesDefinitions.py @@ -0,0 +1,34 @@ +from src.AI.DecisionTrees.AttributeDefinition import AttributeDefinition +from src.AI.DecisionTrees.projectSpecificClasses.DistFromObject import DistFromObject +from src.AI.DecisionTrees.projectSpecificClasses.PlayerStatsValue import PlayerStatsValue + + +class SurvivalAttributesDefinitions: + attrsDefinitionsCount = 6 + + hungerAttrDef = AttributeDefinition(0, "Hunger", [PlayerStatsValue.ZERO_TO_QUARTER, + PlayerStatsValue.QUARTER_TO_HALF, + PlayerStatsValue.HALF_TO_THREE_QUARTERS, + PlayerStatsValue.THREE_QUARTERS_TO_FULL]) + + thirstAttrDef = AttributeDefinition(1, "Thirst", [PlayerStatsValue.ZERO_TO_QUARTER, + PlayerStatsValue.QUARTER_TO_HALF, + PlayerStatsValue.HALF_TO_THREE_QUARTERS, + PlayerStatsValue.THREE_QUARTERS_TO_FULL]) + + staminaAttrDef = AttributeDefinition(2, "Stamina", [PlayerStatsValue.ZERO_TO_QUARTER, + PlayerStatsValue.QUARTER_TO_HALF, + PlayerStatsValue.HALF_TO_THREE_QUARTERS, + PlayerStatsValue.THREE_QUARTERS_TO_FULL]) + + foodDistanceAttrDef = AttributeDefinition(3, "Distance from food", + [DistFromObject.LT_3, DistFromObject.GE_3_LT_8, DistFromObject.GE_8]) + + waterDistanceAttrDef = AttributeDefinition(4, "Distance from water", + [DistFromObject.LT_3, DistFromObject.GE_3_LT_8, DistFromObject.GE_8]) + + restDistanceAttrDef = AttributeDefinition(5, "Distance from rest place", + [DistFromObject.LT_3, DistFromObject.GE_3_LT_8, DistFromObject.GE_8]) + + allAttributesDefinitions = [hungerAttrDef, thirstAttrDef, staminaAttrDef, + foodDistanceAttrDef, waterDistanceAttrDef, restDistanceAttrDef]