From 48560fb3a139ada2a13f73c7901d0563a1b219a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Czeka=C5=84ski?= Date: Sun, 24 May 2020 18:37:46 +0200 Subject: [PATCH] Add >= 15 value in dist from object enum --- .../DTEntities/DTSurvivalInteractable.py | 6 ++++-- .../projectSpecificClasses/DistFromObject.py | 3 ++- .../SurvivalAttributesDefinitions.py | 9 ++++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/AI/DecisionTrees/projectSpecificClasses/DTEntities/DTSurvivalInteractable.py b/src/AI/DecisionTrees/projectSpecificClasses/DTEntities/DTSurvivalInteractable.py index de037d0..db3b28b 100644 --- a/src/AI/DecisionTrees/projectSpecificClasses/DTEntities/DTSurvivalInteractable.py +++ b/src/AI/DecisionTrees/projectSpecificClasses/DTEntities/DTSurvivalInteractable.py @@ -33,8 +33,10 @@ class DTSurvivalInteractable: distanceFromPlayer = DistFromObject.LT_3 elif 3 <= distance < 8: distanceFromPlayer = DistFromObject.GE_3_LT_8 - elif distance >= 8: - distanceFromPlayer = DistFromObject.GE_8 + elif 8 <= distance < 15: + distanceFromPlayer = DistFromObject.GE_8_LT_15 + elif distance >= 15: + distanceFromPlayer = DistFromObject.GE_15 else: return None diff --git a/src/AI/DecisionTrees/projectSpecificClasses/DistFromObject.py b/src/AI/DecisionTrees/projectSpecificClasses/DistFromObject.py index 23f9af9..09207af 100644 --- a/src/AI/DecisionTrees/projectSpecificClasses/DistFromObject.py +++ b/src/AI/DecisionTrees/projectSpecificClasses/DistFromObject.py @@ -9,4 +9,5 @@ class DistFromObject(Enum): LT_3 = 0 GE_3_LT_8 = 1 - GE_8 = 2 + GE_8_LT_15 = 2 + GE_15 = 3 diff --git a/src/AI/DecisionTrees/projectSpecificClasses/SurvivalAttributesDefinitions.py b/src/AI/DecisionTrees/projectSpecificClasses/SurvivalAttributesDefinitions.py index 96ccb79..c641896 100644 --- a/src/AI/DecisionTrees/projectSpecificClasses/SurvivalAttributesDefinitions.py +++ b/src/AI/DecisionTrees/projectSpecificClasses/SurvivalAttributesDefinitions.py @@ -29,13 +29,16 @@ class SurvivalAttributesDefinitions: PlayerStatsValue.THREE_QUARTERS_TO_FULL]) foodDistanceAttrDef = AttributeDefinition(3, "Distance from food", - [DistFromObject.LT_3, DistFromObject.GE_3_LT_8, DistFromObject.GE_8]) + [DistFromObject.LT_3, DistFromObject.GE_3_LT_8, DistFromObject.GE_8_LT_15, + DistFromObject.GE_15]) waterDistanceAttrDef = AttributeDefinition(4, "Distance from water", - [DistFromObject.LT_3, DistFromObject.GE_3_LT_8, DistFromObject.GE_8]) + [DistFromObject.LT_3, DistFromObject.GE_3_LT_8, DistFromObject.GE_8_LT_15, + DistFromObject.GE_15]) restDistanceAttrDef = AttributeDefinition(5, "Distance from rest place", - [DistFromObject.LT_3, DistFromObject.GE_3_LT_8, DistFromObject.GE_8]) + [DistFromObject.LT_3, DistFromObject.GE_3_LT_8, DistFromObject.GE_8_LT_15, + DistFromObject.GE_15]) allAttributesDefinitions = [hungerAttrDef, thirstAttrDef, staminaAttrDef, foodDistanceAttrDef, waterDistanceAttrDef, restDistanceAttrDef]