→ summary
******************************************************************************************
Module Evolife.Social.Alliances:
===============================
EVOLIFE: Module Alliances:
Individuals inherit this class
which determines who is friend with whom
******************************************************************************************
**************************************************************************************
Class club:
==========
class club: list of individuals associated with their performance.
The performance is used to decide who gets acquainted with whom.
**************************************************************************************
----------------------------------------------------------------------------------
Method club.__init__:
====================
initializes club as an empty list of couples (individual,performance)
----------------------------------------------------------------------------------
Arguments:
. sizeMax
----------------------------------------------------------------------------------
Method club.reset
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method club.names:
=================
returns members’ names (first elements of couples stored in members)
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method club.performances:
========================
returns members’ performances (second elements of couples stored in members)
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method club.present:
===================
returns True if the couple MemberPerf belongs to the club
----------------------------------------------------------------------------------
Arguments:
. MemberPerf
----------------------------------------------------------------------------------
Method club.ordered:
===================
returns a list of members names (possibly ordered by decreasing performance)
----------------------------------------------------------------------------------
Arguments:
. ordered
----------------------------------------------------------------------------------
Method club.rank:
================
returns the rank of Member in the list of decreasing performances
----------------------------------------------------------------------------------
Arguments:
. Member
----------------------------------------------------------------------------------
Method club.performance:
=======================
returns the performance of Member
----------------------------------------------------------------------------------
Arguments:
. Member
----------------------------------------------------------------------------------
Method club.size:
================
size of the club
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method club.minimal:
===================
returns the minimal performance among members
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method club.maximal:
===================
returns the maximal performance among members
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method club.best:
================
returns the member with the best performance
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method club.worst:
=================
returns the member with the worst performance
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method club.accepts:
===================
Checks whether an individual with ‘performance’ can be accepted into the club
Always true if club is not full.
Returns admission rank.
----------------------------------------------------------------------------------
Arguments:
. performance
. conservative
----------------------------------------------------------------------------------
Method club.enters:
==================
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
----------------------------------------------------------------------------------
Arguments:
. newMember
. performance
. conservative
----------------------------------------------------------------------------------
Method club.exits:
=================
a member goes out from the club
----------------------------------------------------------------------------------
Arguments:
. oldMember
----------------------------------------------------------------------------------
Method club.weakening:
=====================
all performances are reduced (represents temporal erosion)
----------------------------------------------------------------------------------
Arguments:
. Factor
**************************************************************************************
Class Friend:
============
class Friend: defines an individual’s acqaintances
**************************************************************************************
----------------------------------------------------------------------------------
Method Friend.__init__:
======================
Defines Friend as a club
----------------------------------------------------------------------------------
Arguments:
. MaxFriends
----------------------------------------------------------------------------------
Method Friend.accepts:
=====================
Checks whether an individual with ‘performance’ can be accepted as a friend.
Returns admission rank
----------------------------------------------------------------------------------
Arguments:
. F_perf
----------------------------------------------------------------------------------
Method Friend.affiliable:
========================
Checks whether affiliation is possible
----------------------------------------------------------------------------------
Arguments:
. F_perf
. conservative
----------------------------------------------------------------------------------
Method Friend.follow:
====================
the individual wants to be F’s disciple due to F’s performance
----------------------------------------------------------------------------------
Arguments:
. F
. F_perf
. conservative
. Quit
----------------------------------------------------------------------------------
Method Friend.follows:
=====================
checks whether Friend belongs to actual friends
----------------------------------------------------------------------------------
Arguments:
. Friend
----------------------------------------------------------------------------------
Method Friend.quit_:
===================
the individual no longer follows its friend
----------------------------------------------------------------------------------
Arguments:
. Friend
----------------------------------------------------------------------------------
Method Friend.best_friend
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Friend.Max
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Friend.Friends:
=====================
returns a list of friend names (possibly ordered by decreasing performance)
----------------------------------------------------------------------------------
Arguments:
. ordered
----------------------------------------------------------------------------------
Method Friend.names:
===================
returns the list of friends’ names
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Friend.rank:
==================
returns the rank of Friend in the list of decreasing performances
----------------------------------------------------------------------------------
Arguments:
. Friend
----------------------------------------------------------------------------------
Method Friend.nbFriends:
=======================
Number of friends
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Friend.size:
==================
Number of friends
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Friend.sizeMax
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Friend.lessening_friendship:
==================================
all performances are reduced (represents temporal erosion)
----------------------------------------------------------------------------------
Arguments:
. Factor
----------------------------------------------------------------------------------
Method Friend.checkNetwork:
==========================
updates links by forgetting friends that are gone
----------------------------------------------------------------------------------
Arguments:
. membershipFunction
----------------------------------------------------------------------------------
Method Friend.detach:
====================
The individual quits all its friends
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Friend.acquaintable:
==========================
Checks that self and Partner would accept each other as friend, based on their performance
----------------------------------------------------------------------------------
Arguments:
. Offer
. Partner
. PartnerOffer
----------------------------------------------------------------------------------
Method Friend.get_friend:
========================
Checks mutual acceptance and then establishes friendship
----------------------------------------------------------------------------------
Arguments:
. Offer
. Partner
. PartnerOffer
----------------------------------------------------------------------------------
Method Friend.acquainted:
========================
same as get_friend/3 with no performance
----------------------------------------------------------------------------------
Arguments:
. Partner
----------------------------------------------------------------------------------
Method Friend.end_friendship:
============================
Partners remove each other from their address book
----------------------------------------------------------------------------------
Arguments:
. Partner
----------------------------------------------------------------------------------
Method Friend.forgetAll:
=======================
The individual quits its friends
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Friend.social_signature:
==============================
returns the ordered list of friends
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Friend.signature:
=======================
same as social_signature
----------------------------------------------------------------------------------
**************************************************************************************
Class Follower: inherits from Evolife.Social.Alliances.Friend
==============
Augmented version of Friends for asymmetrical links - replaces ‘Alliances’.
‘Follower’ in addition knows about who is following self
**************************************************************************************
----------------------------------------------------------------------------------
Method Follower.__init__:
========================
calls the Friend constructor for followees.
creates another Friend object for followers
----------------------------------------------------------------------------------
Arguments:
. MaxGurus
. MaxFollowers
----------------------------------------------------------------------------------
Method Follower.F_affiliable:
============================
Checks whether affiliation is possible
by checking acceptance both in friends and in followers
----------------------------------------------------------------------------------
Arguments:
. perf
. Guru
. G_perf
. conservative
----------------------------------------------------------------------------------
Method Follower.F_follow:
========================
the individual wants to be G’s disciple because of some of G’s performance
G may evaluate the individual’s performance too
----------------------------------------------------------------------------------
Arguments:
. perf
. G
. G_perf
. conservative
----------------------------------------------------------------------------------
Method Follower.G_quit_:
=======================
the individual no longer follows its guru
----------------------------------------------------------------------------------
Arguments:
. Guru
----------------------------------------------------------------------------------
Method Follower.F_quit_:
=======================
the individual does not want its disciple any longer
----------------------------------------------------------------------------------
Arguments:
. Follower
----------------------------------------------------------------------------------
Method Follower.get_friend:
==========================
Checks mutual acceptance and then establishes friendship
----------------------------------------------------------------------------------
Arguments:
. Offer
. Partner
. PartnerOffer
----------------------------------------------------------------------------------
Method Follower.end_friendship:
==============================
Partners remove each other from their address book
----------------------------------------------------------------------------------
Arguments:
. Partner
----------------------------------------------------------------------------------
Method Follower.nbFollowers
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Follower.follower_rank:
=============================
Returns Friend’s rank among self’s followers
----------------------------------------------------------------------------------
Arguments:
. Friend
----------------------------------------------------------------------------------
Method Follower.forgetAll:
=========================
calls ‘detach’ for self’s followers and then for self.
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Follower.detach:
======================
The individual quits its guru and quits its followers
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Method Follower.consistency:
===========================
checks social links consistency (self belongs to the followers of its followees)
----------------------------------------------------------------------------------
Back to Evolife