From 290b14d0b44164e3d75c40e7d8e4248e2cf14faa Mon Sep 17 00:00:00 2001 From: Kcunningham20 <31940556+Kcunningham20@users.noreply.github.com> Date: Wed, 25 Apr 2018 17:19:44 -0700 Subject: [PATCH] update decision function. allows one pudgi to make decisions --- virtupet/.idea/misc.xml | 2 +- virtupet/Pudgi.py | 106 +++++++++++++++++++-- virtupet/data/decisions.json | 45 +++++---- virtupet/data/pudgies/0x11979.json | 84 ---------------- virtupet/data/pudgies/0x1280e.json | 148 ----------------------------- virtupet/data/pudgies/0x15b1.json | 148 ----------------------------- virtupet/data/pudgies/0x1607.json | 148 ----------------------------- virtupet/data/pudgies/0x1790b.json | 84 ---------------- virtupet/data/pudgies/0x17b07.json | 148 ----------------------------- virtupet/data/pudgies/0x1cfc.json | 148 ----------------------------- virtupet/data/pudgies/0x249a.json | 84 ---------------- virtupet/data/pudgies/0x3b44.json | 84 ---------------- virtupet/data/pudgies/0x4be0.json | 84 ---------------- virtupet/data/pudgies/0x54d0.json | 84 ---------------- virtupet/data/pudgies/0x57e9.json | 148 ----------------------------- virtupet/data/pudgies/0x6a86.json | 84 ---------------- virtupet/data/pudgies/0x6d8.json | 148 ----------------------------- virtupet/data/pudgies/0x743d.json | 84 ---------------- virtupet/data/pudgies/0x8653.json | 148 ----------------------------- virtupet/data/pudgies/0x9d3b.json | 84 ---------------- virtupet/data/pudgies/0xa333.json | 148 ----------------------------- virtupet/data/pudgies/0xa51.json | 84 ---------------- virtupet/data/pudgies/0xbbec.json | 148 ----------------------------- virtupet/data/pudgies/0xc443.json | 84 ---------------- virtupet/data/pudgies/0xf1f.json | 148 ----------------------------- virtupet/data/pudgies/default.json | 2 +- virtupet/main.py | 15 +-- 27 files changed, 130 insertions(+), 2592 deletions(-) delete mode 100644 virtupet/data/pudgies/0x11979.json delete mode 100644 virtupet/data/pudgies/0x1280e.json delete mode 100644 virtupet/data/pudgies/0x15b1.json delete mode 100644 virtupet/data/pudgies/0x1607.json delete mode 100644 virtupet/data/pudgies/0x1790b.json delete mode 100644 virtupet/data/pudgies/0x17b07.json delete mode 100644 virtupet/data/pudgies/0x1cfc.json delete mode 100644 virtupet/data/pudgies/0x249a.json delete mode 100644 virtupet/data/pudgies/0x3b44.json delete mode 100644 virtupet/data/pudgies/0x4be0.json delete mode 100644 virtupet/data/pudgies/0x54d0.json delete mode 100644 virtupet/data/pudgies/0x57e9.json delete mode 100644 virtupet/data/pudgies/0x6a86.json delete mode 100644 virtupet/data/pudgies/0x6d8.json delete mode 100644 virtupet/data/pudgies/0x743d.json delete mode 100644 virtupet/data/pudgies/0x8653.json delete mode 100644 virtupet/data/pudgies/0x9d3b.json delete mode 100644 virtupet/data/pudgies/0xa333.json delete mode 100644 virtupet/data/pudgies/0xa51.json delete mode 100644 virtupet/data/pudgies/0xbbec.json delete mode 100644 virtupet/data/pudgies/0xc443.json delete mode 100644 virtupet/data/pudgies/0xf1f.json diff --git a/virtupet/.idea/misc.xml b/virtupet/.idea/misc.xml index 3565ed8..8305311 100644 --- a/virtupet/.idea/misc.xml +++ b/virtupet/.idea/misc.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/virtupet/Pudgi.py b/virtupet/Pudgi.py index ec5c22b..c3e285d 100644 --- a/virtupet/Pudgi.py +++ b/virtupet/Pudgi.py @@ -270,10 +270,6 @@ def go_left(self): def stop(self): self.change_x = 0 - def make_decision(self): - # make decision - return - def import_from_json(self, load): self.handler.load_file(load) self.json_object = self.handler.get_data() @@ -335,12 +331,102 @@ def select_parents(active_agent_list): return parents - def make_decicion(self): - self.handler.load_file("./data/decisions.py") + def make_decision(self): + self.handler.load_file("./data/decisions.json") decision_file = self.handler.get_data() - self.handler.load_file("./data/pudgi" + self.uid + ".json") - pudgi_file = self.handler.get_data() - - if (random.random() > 0.5): + self.handler.load_file("./data/pudgies/" + self.uid + ".json") + choice_index = -1 + happiness_optimized = 0 + t = 0 + choice = None + + w_att = self.weights["attachment"] + w_hum = self.weights["humor"] + w_enj = self.weights["enjoyment"] + w_exc = self.weights["excitement"] + w_conf = self.weights["confidence"] + w_cont = self.weights["contentment"] + w_vit = self.weights["vitality"] + w_phy = self.weights["physical"] + w_ment = self.weights["mental"] + + if random.random() > 1.0: + index = 0 for decision in self.known_decisions: name = decision["name"] + + att = None + hum = None + enj = None + exc = None + conf = None + cont = None + vit = None + phy = None + ment = None + ent = None + + for dec in decision_file: + if dec["name"] == name: + + att = dec["values"]["attachment"] + hum = dec["values"]["humor"] + enj = dec["values"]["enjoyment"] + exc = dec["values"]["excitement"] + conf = dec["values"]["confidence"] + cont = dec["values"]["contentment"] + vit = dec["values"]["vitality"] + phy = dec["values"]["physical_energy"] + ment = dec["values"]["mental_energy"] + ent = dec["values"]["entertainment"] + + for dec in self.known_decisions: + if dec["name"] == name: + t = dec["count"] + + happiness = pow(ent, t) * ((pow(att, w_att))+(pow(hum, w_hum))+(pow(enj, w_enj)) + + (pow(exc, w_exc)) + (pow(conf, w_conf))+(pow(cont, w_cont)) - + (pow(vit, w_vit)) - (pow(phy, w_phy)) - (pow(ment, w_ment))) + + if happiness > happiness_optimized: + happiness_optimized = happiness + choice = decision + choice_index = index + + index += 1 + + else: + dec_attempt = random.choice(decision_file) + for known in self.known_decisions: # iterate through all known + if dec_attempt["name"] == known["name"]: # if we find a match, break out. We don't want this + break + else: + choice = dec_attempt + att = choice["values"]["attachment"] + hum = choice["values"]["humor"] + enj = choice["values"]["enjoyment"] + exc = choice["values"]["excitement"] + conf = choice["values"]["confidence"] + cont = choice["values"]["contentment"] + vit = choice["values"]["vitality"] + phy = choice["values"]["physical_energy"] + ment = choice["values"]["mental_energy"] + ent = choice["values"]["entertainment"] + + happiness_optimized = pow(ent, t)*((pow(att, w_att)) + (pow(hum, w_hum)) + (pow(enj, w_enj)) + + (pow(exc, w_exc)) + (pow(conf, w_conf)) + (pow(cont, w_cont)) - + (pow(vit, w_vit)) - (pow(phy, w_phy)) - (pow(ment, w_ment))) + + self.known_decisions.append({"name": choice["name"], "count": 0}) + choice_index = len(self.known_decisions) - 1 + + if choice is not None: + if self.happiness + happiness_optimized <= 0: + self.happiness = 0 + else: + if self.happiness + happiness_optimized <= 10: + self.happiness += happiness_optimized + else: + self.happiness = 10 + + self.known_decisions[choice_index]["count"] += 1 diff --git a/virtupet/data/decisions.json b/virtupet/data/decisions.json index b51bc7b..5f9a1c0 100644 --- a/virtupet/data/decisions.json +++ b/virtupet/data/decisions.json @@ -7,9 +7,9 @@ "confidence": 0.2, "contentment": 0.6, "entertainment": 1, - "vitality": -0.1, - "mental_energy": -0.2, - "physical_energy": -0.2 + "vitality": 0.1, + "mental_energy": 0.2, + "physical_energy": 0.2 } }, {"name": "push_car", "values": @@ -20,9 +20,9 @@ "confidence": 0.3, "contentment": 0.6, "entertainment": 1, - "vitality": -0.1, - "mental_energy": -0.2, - "physical_energy": -0.2 + "vitality": 0.1, + "mental_energy": 0.2, + "physical_energy": 0.2 } }, {"name": "eat_cake", "values": @@ -33,12 +33,12 @@ "confidence": 0.1, "contentment": 0.7, "entertainment": 1, - "vitality": -0.7, - "mental_energy": -0.5, + "vitality": 0.7, + "mental_energy": 0.5, "physical_energy": 0.3 } }, - {"name": "sleep", "values": + {"name": "sleep", "values": {"attachment": 0.1, "humor": 0.1, "enjoyment": 0.1, @@ -49,21 +49,23 @@ "vitality": 0.8, "mental_energy": 0.5, "physical_energy": 0.5 - } - }, + } + }, { "name": "reading", - "values": { - "attachment": 0.1, + "values": + {"attachment": 0.1, "humor": 0.5, "enjoyment": 0.9, "excitement": 0.4, "confidence": 0.3, "contentment": 0.7, "entertainment": 0.7, - "vitality": -0.1, - "mental_energy": -0.5, - "physical_energy": -0.1 + "vitality": 0.1, + "mental_energy": 0.5, + "physical_energy": 0.1 + } + }, { "name": "eat_veggies", "values": {"attachment": 0.3, "humor": 0.1, @@ -72,9 +74,10 @@ "confidence": 0.4, "contentment": 0.1, "entertainment": 0.1, - "vitality": -0.1, + "vitality": 0.1, "mental_energy": 0.1, - "physical_energy": 0.1} + "physical_energy": 0.1 + } }, {"name": "meditate", "values": {"attachment": 0.3, @@ -98,9 +101,9 @@ "confidence": 0.1, "contentment": 0.1, "entertainment": 0.5, - "vitality": -0.1, - "mental_energy": -0.1, - "physical_energy": -0.1 + "vitality": 0.1, + "mental_energy": 0.1, + "physical_energy": 0.1 } } ] diff --git a/virtupet/data/pudgies/0x11979.json b/virtupet/data/pudgies/0x11979.json deleted file mode 100644 index 7dd123b..0000000 --- a/virtupet/data/pudgies/0x11979.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "uid": "0x11979", - "name": "Pudgi", - "dna": [ - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 1 - ], - "color": "White", - "personality": "ENFP", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0x1280e.json b/virtupet/data/pudgies/0x1280e.json deleted file mode 100644 index f532c64..0000000 --- a/virtupet/data/pudgies/0x1280e.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "uid": "0x1280e", - "name": "Marvin", - "dna": [ - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 0, - 1, - 0, - 0, - 1, - 0, - 1, - 1, - 0, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1 - ], - "color": "Red", - "personality": "INTP", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0x15b1.json b/virtupet/data/pudgies/0x15b1.json deleted file mode 100644 index 6b5cf75..0000000 --- a/virtupet/data/pudgies/0x15b1.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "uid": "0x15b1", - "name": "Tyrone", - "dna": [ - 0, - 1, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 0, - 1, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 1, - 0, - 0, - 1, - 1, - 0, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 0 - ], - "color": "White", - "personality": "INTJ", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0x1607.json b/virtupet/data/pudgies/0x1607.json deleted file mode 100644 index 5fa75a5..0000000 --- a/virtupet/data/pudgies/0x1607.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "uid": "0x1607", - "name": "Haiden", - "dna": [ - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 1, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 0, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 1 - ], - "color": "Blue", - "personality": "ISFP", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0x1790b.json b/virtupet/data/pudgies/0x1790b.json deleted file mode 100644 index aa1c336..0000000 --- a/virtupet/data/pudgies/0x1790b.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "uid": "0x1790b", - "name": "Pudgi", - "dna": [ - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 1 - ], - "color": "Red", - "personality": "ISTP", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0x17b07.json b/virtupet/data/pudgies/0x17b07.json deleted file mode 100644 index b6d1bc7..0000000 --- a/virtupet/data/pudgies/0x17b07.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "uid": "0x17b07", - "name": "Lila", - "dna": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 1, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 0, - 1 - ], - "color": "Green", - "personality": "ESTJ", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0x1cfc.json b/virtupet/data/pudgies/0x1cfc.json deleted file mode 100644 index 43f8390..0000000 --- a/virtupet/data/pudgies/0x1cfc.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "uid": "0x1cfc", - "name": "Jeramiah", - "dna": [ - 0, - 0, - 1, - 0, - 0, - 1, - 0, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 1, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 0, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 0, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1 - ], - "color": "Angel", - "personality": "INFJ", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0x249a.json b/virtupet/data/pudgies/0x249a.json deleted file mode 100644 index 89f2a12..0000000 --- a/virtupet/data/pudgies/0x249a.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "uid": "0x249a", - "name": "Pudgi", - "dna": [ - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 1 - ], - "color": "Red", - "personality": "ISTJ", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0x3b44.json b/virtupet/data/pudgies/0x3b44.json deleted file mode 100644 index ff21426..0000000 --- a/virtupet/data/pudgies/0x3b44.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "uid": "0x3b44", - "name": "Pudgi", - "dna": [ - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 1 - ], - "color": "Blue", - "personality": "ISTJ", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0x4be0.json b/virtupet/data/pudgies/0x4be0.json deleted file mode 100644 index d44c7f3..0000000 --- a/virtupet/data/pudgies/0x4be0.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "uid": "0x4be0", - "name": "Pudgi", - "dna": [ - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 1 - ], - "color": "Vampire", - "personality": "INTP", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0x54d0.json b/virtupet/data/pudgies/0x54d0.json deleted file mode 100644 index 6c60f11..0000000 --- a/virtupet/data/pudgies/0x54d0.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "uid": "0x54d0", - "name": "Pudgi", - "dna": [ - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 1 - ], - "color": "White", - "personality": "ISTJ", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0x57e9.json b/virtupet/data/pudgies/0x57e9.json deleted file mode 100644 index fcdf053..0000000 --- a/virtupet/data/pudgies/0x57e9.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "uid": "0x57e9", - "name": "Cindy", - "dna": [ - 1, - 0, - 1, - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 1 - ], - "color": "Angel", - "personality": "INTJ", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0x6a86.json b/virtupet/data/pudgies/0x6a86.json deleted file mode 100644 index 873f6b9..0000000 --- a/virtupet/data/pudgies/0x6a86.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "uid": "0x6a86", - "name": "Pudgi", - "dna": [ - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 1 - ], - "color": "White", - "personality": "ESTJ", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0x6d8.json b/virtupet/data/pudgies/0x6d8.json deleted file mode 100644 index c7060c1..0000000 --- a/virtupet/data/pudgies/0x6d8.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "uid": "0x6d8", - "name": "Porter", - "dna": [ - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 0, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - 1, - 0, - 0, - 1, - 0, - 1, - 0 - ], - "color": "Purple", - "personality": "ESFJ", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0x743d.json b/virtupet/data/pudgies/0x743d.json deleted file mode 100644 index eadad96..0000000 --- a/virtupet/data/pudgies/0x743d.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "uid": "0x743d", - "name": "Pudgi", - "dna": [ - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 1 - ], - "color": "Red", - "personality": "ENFJ", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0x8653.json b/virtupet/data/pudgies/0x8653.json deleted file mode 100644 index 054ce93..0000000 --- a/virtupet/data/pudgies/0x8653.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "uid": "0x8653", - "name": "Madalynn", - "dna": [ - 0, - 1, - 1, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 1, - 0, - 0, - 1, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 1, - 1 - ], - "color": "Purple", - "personality": "ISTP", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0x9d3b.json b/virtupet/data/pudgies/0x9d3b.json deleted file mode 100644 index 3784c62..0000000 --- a/virtupet/data/pudgies/0x9d3b.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "uid": "0x9d3b", - "name": "Pudgi", - "dna": [ - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 1 - ], - "color": "Red", - "personality": "ESFP", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0xa333.json b/virtupet/data/pudgies/0xa333.json deleted file mode 100644 index 62f26c5..0000000 --- a/virtupet/data/pudgies/0xa333.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "uid": "0xa333", - "name": "Alison", - "dna": [ - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 1, - 0, - 1, - 1, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 0, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 0, - 1 - ], - "color": "Green", - "personality": "ISFP", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0xa51.json b/virtupet/data/pudgies/0xa51.json deleted file mode 100644 index 0e3a89b..0000000 --- a/virtupet/data/pudgies/0xa51.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "uid": "0xa51", - "name": "Pudgi", - "dna": [ - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 1 - ], - "color": "White", - "personality": "ISFP", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0xbbec.json b/virtupet/data/pudgies/0xbbec.json deleted file mode 100644 index 57159bb..0000000 --- a/virtupet/data/pudgies/0xbbec.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "uid": "0xbbec", - "name": "Andrew", - "dna": [ - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 1, - 0, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 0, - 1, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 0, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 1, - 1, - 0 - ], - "color": "Green", - "personality": "ISFJ", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0xc443.json b/virtupet/data/pudgies/0xc443.json deleted file mode 100644 index f9acf08..0000000 --- a/virtupet/data/pudgies/0xc443.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "uid": "0xc443", - "name": "Pudgi", - "dna": [ - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - 0, - 1, - 1 - ], - "color": "Midnight", - "personality": "ISTJ", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/0xf1f.json b/virtupet/data/pudgies/0xf1f.json deleted file mode 100644 index fefea16..0000000 --- a/virtupet/data/pudgies/0xf1f.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "uid": "0xf1f", - "name": "Leah", - "dna": [ - 1, - 0, - 0, - 1, - 0, - 0, - 1, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 1, - 1, - 1, - 0, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 1, - 1, - 1, - 0, - 1, - 0, - 1, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 1, - 0, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 0, - 0, - 1, - 0, - 0, - 0, - 1, - 1, - 1, - 0, - 0, - 1 - ], - "color": "Midnight", - "personality": "ISFP", - "parents": [ - null, - null - ], - "happiness": 0.5, - "known_decisions": [] -} \ No newline at end of file diff --git a/virtupet/data/pudgies/default.json b/virtupet/data/pudgies/default.json index 80cca7e..e3fc788 100644 --- a/virtupet/data/pudgies/default.json +++ b/virtupet/data/pudgies/default.json @@ -77,5 +77,5 @@ "personality": null, "parents": [null, null], "happiness": 0.5, - "known_decisions": [] + "known_decisions": [{"name": "nothing", "count": 0}] } diff --git a/virtupet/main.py b/virtupet/main.py index 442e75c..9f98c04 100644 --- a/virtupet/main.py +++ b/virtupet/main.py @@ -36,10 +36,9 @@ def main(): agent2.export_to_json() pygame.display.set_caption("Pudgi Simulation") - parents = ["0x9c08", "0x11e66"] + # parents = ["0x9c08", "0x11e66"] # agent = Pudgi(parents) - agent = Pudgi(None, "./data/pudgies/0x8653.json") - # agent = Pudgi() + # agent = Pudgi(None, "./data/pudgies/0x8653.json") env_list = [environments.EnvironmentHouse(agent)] current_env_no = 0 @@ -73,13 +72,15 @@ def main(): # for char in number: # node = node[char] + agent.make_decision() + # --------------Main While loop--------------- while not done: - for parents in high_happiness: - pudgi = Pudgi(parents) - active_sprite_list.add(pudgi) - active_agent_list.append(pudgi) + # for parents in high_happiness: + # pudgi = Pudgi(parents) + # active_sprite_list.add(pudgi) + # active_agent_list.append(pudgi) for event in pygame.event.get(): # User did something if event.type == pygame.QUIT: # If user clicked close