Skip to content

Commit

Permalink
made birth semi-random
Browse files Browse the repository at this point in the history
  • Loading branch information
ngraham20 committed May 9, 2018
1 parent 0909725 commit c0e9fd9
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions virtupet/Pudgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,12 @@ def select_parents(active_agent_list):
if len(high_happiness) >= 2:
parent01 = high_happiness.pop()
parent02 = high_happiness.pop()
parents.append((parent01.uid, parent02.uid))
parent01.happiness = 2.0
parent01.vitality -= 4
parent02.happiness = 2.0
parent02.vitality -= 4
if random.random() <= 0.6:
parents.append((parent01.uid, parent02.uid))
parent01.happiness = 2.0
parent01.vitality -= 4
parent02.happiness = 2.0
parent02.vitality -= 4

return parents

Expand All @@ -396,8 +397,8 @@ def make_decision(self):
chance_waking = -1
chance_sleeping = -1
# check vitality for sleepiness (using fuzzy logic)
low = 2.5
high = 9
low = 1
high = 10
if vitality <= low:
chance_waking = 0
chance_sleeping = 1
Expand Down

0 comments on commit c0e9fd9

Please sign in to comment.