GA skelethon
This commit is contained in:
parent
87a341744c
commit
d363120ef4
4
src/AI/GaTravelingForHerbs/GeneticAlgorithm.py
Normal file
4
src/AI/GaTravelingForHerbs/GeneticAlgorithm.py
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
from random import random, choice
|
||||||
|
|
||||||
|
class GeneticAlgorithm:
|
||||||
|
pass
|
10
src/AI/GaTravelingForHerbs/Traveling.py
Normal file
10
src/AI/GaTravelingForHerbs/Traveling.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
from random import randint, sample
|
||||||
|
from math import sqrt
|
||||||
|
|
||||||
|
START_COORD = [(6, 2)]
|
||||||
|
END_COORD = [(10, 7)]
|
||||||
|
COORDS = [(12, 2), (16, 2), (17, 5), (14, 7), (17, 17), (13, 17), (5, 15), (2, 9), (8, 5), (11, 10)]
|
||||||
|
|
||||||
|
class Traveling:
|
||||||
|
def __init__(self, coords):
|
||||||
|
self.coords = coords
|
@ -44,11 +44,12 @@ class Interactable(Entity):
|
|||||||
Player.herbs += 1
|
Player.herbs += 1
|
||||||
print(Player.herbs)
|
print(Player.herbs)
|
||||||
|
|
||||||
if Player.herbs == 10:
|
if Player.herbs == 10 and self.classifier == Classifiers.REST:
|
||||||
|
print("Should reset")
|
||||||
Player.statistics.set_hp(100)
|
Player.statistics.set_hp(100)
|
||||||
Player.statistics.set_stamina(100)
|
Player.statistics.set_stamina(100)
|
||||||
Player.statistics.set_thirst(0)
|
Player.statistics.set_thirst(-100)
|
||||||
Player.statistics.set_hunger(0)
|
Player.statistics.set_hunger(-100)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "Entity - ID:{}, pos:({}x, {}y), {}".format(self.id, self.x, self.y, self.classifier.name)
|
return "Entity - ID:{}, pos:({}x, {}y), {}".format(self.id, self.x, self.y, self.classifier.name)
|
||||||
|
@ -54,11 +54,14 @@ class Player(Entity):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
# looses hunger
|
# looses hunger
|
||||||
self.statistics.set_hunger(1.7)
|
# self.statistics.set_hunger(1.7)
|
||||||
|
self.statistics.set_hunger(0.7)
|
||||||
# gets more thirsty
|
# gets more thirsty
|
||||||
self.statistics.set_thirst(2.2)
|
# self.statistics.set_thirst(2.2)
|
||||||
|
self.statistics.set_thirst(1.2)
|
||||||
# gets tired
|
# gets tired
|
||||||
self.statistics.set_stamina(-1.9)
|
# self.statistics.set_stamina(-1.9)
|
||||||
|
self.statistics.set_stamina(-0.9)
|
||||||
|
|
||||||
def applyTimeFatigue(self):
|
def applyTimeFatigue(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user