Evolife
Evolife has been developed to study Genetic algorithms, Natural evolution and behavioural ecology.
|
class club: list of individuals associated with their performance. More...
Public Member Functions | |
def | __init__ (self, sizeMax=0) |
initializes club as an empty list of couples (individual,performance) More... | |
def | reset (self) |
def | names (self) |
returns members' names (first elements of couples stored in members) More... | |
def | performances (self) |
returns members' performances (second elements of couples stored in members) More... | |
def | present (self, MemberPerf) |
returns True if the couple MemberPerf belongs to the club More... | |
def | ordered (self, ordered=True) |
returns a list of members names (possibly ordered by decreasing performance) More... | |
def | rank (self, Member) |
returns the rank of Member in the list of decreasing performances More... | |
def | performance (self, Member) |
returns the performance of Member More... | |
def | size (self) |
size of the club More... | |
def | minimal (self) |
returns the minimal performance among members More... | |
def | maximal (self) |
returns the maximal performance among members More... | |
def | best (self) |
returns the member with the best performance More... | |
def | worst (self) |
returns the member with the worst performance More... | |
def | accepts (self, performance, conservative=True) |
Checks whether an individual with 'performance' can be accepted into the club Always true if club is not full. More... | |
def | enters (self, newMember, performance, conservative=True) |
If newMember is accepted based on its performance, it enters the club. More... | |
def | exits (self, oldMember) |
a member goes out from the club More... | |
def | weakening (self, Factor=0.9) |
all performances are reduced (represents temporal erosion) More... | |
def | __iter__ (self) |
def | __len__ (self) |
Public Attributes | |
sizeMax | |
class club: list of individuals associated with their performance.
The performance is used to decide who gets acquainted with whom.
Definition at line 26 of file Alliances.py.
def Evolife.Social.Alliances.club.__init__ | ( | self, | |
sizeMax = 0 |
|||
) |
initializes club as an empty list of couples (individual,performance)
Definition at line 31 of file Alliances.py.
def Evolife.Social.Alliances.club.__iter__ | ( | self | ) |
Definition at line 158 of file Alliances.py.
def Evolife.Social.Alliances.club.__len__ | ( | self | ) |
Definition at line 160 of file Alliances.py.
def Evolife.Social.Alliances.club.accepts | ( | self, | |
performance, | |||
conservative = True |
|||
) |
Checks whether an individual with 'performance' can be accepted into the club Always true if club is not full.
Returns admission rank.
Definition at line 109 of file Alliances.py.
def Evolife.Social.Alliances.club.best | ( | self | ) |
returns the member with the best performance
Definition at line 95 of file Alliances.py.
def Evolife.Social.Alliances.club.enters | ( | self, | |
newMember, | |||
performance, | |||
conservative = True |
|||
) |
If newMember is accepted based on its performance, it enters the club.
If too many members in the club, the worst one is ejected and returned
Definition at line 124 of file Alliances.py.
def Evolife.Social.Alliances.club.exits | ( | self, | |
oldMember | |||
) |
a member goes out from the club
Definition at line 140 of file Alliances.py.
def Evolife.Social.Alliances.club.maximal | ( | self | ) |
returns the maximal performance among members
Definition at line 89 of file Alliances.py.
def Evolife.Social.Alliances.club.minimal | ( | self | ) |
returns the minimal performance among members
Definition at line 83 of file Alliances.py.
def Evolife.Social.Alliances.club.names | ( | self | ) |
returns members' names (first elements of couples stored in members)
Definition at line 44 of file Alliances.py.
def Evolife.Social.Alliances.club.ordered | ( | self, | |
ordered = True |
|||
) |
returns a list of members names (possibly ordered by decreasing performance)
Definition at line 59 of file Alliances.py.
def Evolife.Social.Alliances.club.performance | ( | self, | |
Member | |||
) |
returns the performance of Member
Definition at line 72 of file Alliances.py.
def Evolife.Social.Alliances.club.performances | ( | self | ) |
returns members' performances (second elements of couples stored in members)
Definition at line 49 of file Alliances.py.
def Evolife.Social.Alliances.club.present | ( | self, | |
MemberPerf | |||
) |
returns True if the couple MemberPerf belongs to the club
Definition at line 54 of file Alliances.py.
def Evolife.Social.Alliances.club.rank | ( | self, | |
Member | |||
) |
returns the rank of Member in the list of decreasing performances
Definition at line 66 of file Alliances.py.
def Evolife.Social.Alliances.club.reset | ( | self | ) |
Definition at line 39 of file Alliances.py.
def Evolife.Social.Alliances.club.size | ( | self | ) |
size of the club
Definition at line 78 of file Alliances.py.
def Evolife.Social.Alliances.club.weakening | ( | self, | |
Factor = 0.9 |
|||
) |
all performances are reduced (represents temporal erosion)
Definition at line 151 of file Alliances.py.
def Evolife.Social.Alliances.club.worst | ( | self | ) |
returns the member with the worst performance
Definition at line 103 of file Alliances.py.
Evolife.Social.Alliances.club.sizeMax |
Definition at line 34 of file Alliances.py.