Skip to content

Commit

Permalink
added parent creation function
Browse files Browse the repository at this point in the history
  • Loading branch information
Kcunningham20 committed Apr 20, 2018
1 parent 23229d1 commit aade609
Show file tree
Hide file tree
Showing 15 changed files with 958 additions and 7 deletions.
2 changes: 1 addition & 1 deletion virtupet/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 14 additions & 3 deletions virtupet/Pudgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions virtupet/data/meyers_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"ESTP",
"INFJ",
"ISTJ",
"ESFP",
"ISFP",
"INTP",
"ENFP",
"INTJ",
Expand Down
84 changes: 84 additions & 0 deletions virtupet/data/pudgies/0x11979.json
Original file line number Diff line number Diff line change
@@ -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": []
}
84 changes: 84 additions & 0 deletions virtupet/data/pudgies/0x1790b.json
Original file line number Diff line number Diff line change
@@ -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": []
}
84 changes: 84 additions & 0 deletions virtupet/data/pudgies/0x249a.json
Original file line number Diff line number Diff line change
@@ -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": []
}
84 changes: 84 additions & 0 deletions virtupet/data/pudgies/0x3b44.json
Original file line number Diff line number Diff line change
@@ -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": []
}
Loading

0 comments on commit aade609

Please sign in to comment.