diff --git a/virtupet/.idea/misc.xml b/virtupet/.idea/misc.xml index 9aedb13..255fc46 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 6160d08..0bed7f0 100644 --- a/virtupet/Pudgi.py +++ b/virtupet/Pudgi.py @@ -319,10 +319,21 @@ def export_to_json(self): print("Parents: " + str(self.parents)) return - def select_parents(self, active_sprite_list): + @staticmethod + def select_parents(active_agent_list): """ - :param active_sprite_list: - :type active_sprite_list: list + :param active_agent_list: + :type active_agent_list: list :return: """ + high_happiness = [] + parents = [] + for pudgi in active_agent_list: + if pudgi.happiness > .4: + high_happiness.append(pudgi.uid) + for i in range(len(high_happiness)): + if len(high_happiness) >= 2: + parents.append((high_happiness.pop(), high_happiness.pop())) + + return parents diff --git a/virtupet/data/meyers_metadata.json b/virtupet/data/meyers_metadata.json index bd53306..9b87b4e 100644 --- a/virtupet/data/meyers_metadata.json +++ b/virtupet/data/meyers_metadata.json @@ -6,6 +6,8 @@ "ESTP", "INFJ", "ISTJ", + "ESFP", + "ISFP", "INTP", "ENFP", "INTJ", diff --git a/virtupet/data/pudgies/0x11979.json b/virtupet/data/pudgies/0x11979.json new file mode 100644 index 0000000..7dd123b --- /dev/null +++ b/virtupet/data/pudgies/0x11979.json @@ -0,0 +1,84 @@ +{ + "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/0x1790b.json b/virtupet/data/pudgies/0x1790b.json new file mode 100644 index 0000000..aa1c336 --- /dev/null +++ b/virtupet/data/pudgies/0x1790b.json @@ -0,0 +1,84 @@ +{ + "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/0x249a.json b/virtupet/data/pudgies/0x249a.json new file mode 100644 index 0000000..89f2a12 --- /dev/null +++ b/virtupet/data/pudgies/0x249a.json @@ -0,0 +1,84 @@ +{ + "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 new file mode 100644 index 0000000..ff21426 --- /dev/null +++ b/virtupet/data/pudgies/0x3b44.json @@ -0,0 +1,84 @@ +{ + "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 new file mode 100644 index 0000000..d44c7f3 --- /dev/null +++ b/virtupet/data/pudgies/0x4be0.json @@ -0,0 +1,84 @@ +{ + "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 new file mode 100644 index 0000000..6c60f11 --- /dev/null +++ b/virtupet/data/pudgies/0x54d0.json @@ -0,0 +1,84 @@ +{ + "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/0x6a86.json b/virtupet/data/pudgies/0x6a86.json new file mode 100644 index 0000000..873f6b9 --- /dev/null +++ b/virtupet/data/pudgies/0x6a86.json @@ -0,0 +1,84 @@ +{ + "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/0x743d.json b/virtupet/data/pudgies/0x743d.json new file mode 100644 index 0000000..eadad96 --- /dev/null +++ b/virtupet/data/pudgies/0x743d.json @@ -0,0 +1,84 @@ +{ + "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/0x9d3b.json b/virtupet/data/pudgies/0x9d3b.json new file mode 100644 index 0000000..3784c62 --- /dev/null +++ b/virtupet/data/pudgies/0x9d3b.json @@ -0,0 +1,84 @@ +{ + "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/0xa51.json b/virtupet/data/pudgies/0xa51.json new file mode 100644 index 0000000..0e3a89b --- /dev/null +++ b/virtupet/data/pudgies/0xa51.json @@ -0,0 +1,84 @@ +{ + "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/0xc443.json b/virtupet/data/pudgies/0xc443.json new file mode 100644 index 0000000..f9acf08 --- /dev/null +++ b/virtupet/data/pudgies/0xc443.json @@ -0,0 +1,84 @@ +{ + "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/main.py b/virtupet/main.py index 1c534d9..ee5d2a3 100644 --- a/virtupet/main.py +++ b/virtupet/main.py @@ -25,11 +25,16 @@ def main(): pygame.display.set_caption(json_object["name"]) - - parents = ["0x9c08", "0x11e66"] + active_agent_list = [] + # parents = ["0x9c08", "0x11e66"] # agent = Pudgi(parents) # agent = Pudgi(None, "./data/pudgies/0x9c08.json") agent = Pudgi() + agent2 = Pudgi() + active_agent_list.append(agent) + agent.export_to_json() + active_agent_list.append(agent2) + agent2.export_to_json() env_list = [environments.EnvironmentHouse(agent)] current_env_no = 0 @@ -40,7 +45,16 @@ def main(): agent.rect.x = 340 agent.rect.y = constants.SCREEN_HEIGHT - 140 + agent2.rect.x = 100 + agent2.rect.y = constants.SCREEN_HEIGHT - 140 + high_happiness = Pudgi.select_parents(active_agent_list) + for parents in high_happiness: + pudgi = Pudgi(parents) + active_sprite_list.add(pudgi) + active_agent_list.append(pudgi) + active_sprite_list.add(agent) + active_sprite_list.add(agent2) done = False @@ -92,7 +106,7 @@ def main(): pygame.display.flip() - agent.export_to_json() + # agent.export_to_json() pygame.quit()