Evolife documentation

     summary     

    

******************************************************************************************
Module Evolife.Social.SocialSimulation:        
======================================
A basic framework to run social simulations
******************************************************************************************


    --------------------------------------------------------------------------------------
    Function Start:        
    ==============
    Launches the simulation
    --------------------------------------------------------------------------------------
    Arguments:
        . Params
        . PopClass
        . ObsClass
        . DumpFeatures
        . Windows


    **************************************************************************************
    Class Global:        inherits from Evolife.Scenarii.Parameters.Parameters
    ============
    Global elements, mainly parameters
    **************************************************************************************

        ----------------------------------------------------------------------------------
        Method Global.__init__        
        ----------------------------------------------------------------------------------
        Arguments:
            . ConfigFile


        ----------------------------------------------------------------------------------
        Method Global.Dump_:        
        ===================
        Saves parameter values, then agents’ investment in signalling, then agents’ distance to best friend
        ----------------------------------------------------------------------------------
        Arguments:
            . PopDump
            . ResultFileName
            . DumpFeatures
            . ExpeID
            . Verbose


    **************************************************************************************
    Class Social_Observer:        inherits from Evolife.Ecology.Observer.Experiment_Observer
    =====================
    Stores some global observation and display variables
    **************************************************************************************

        ----------------------------------------------------------------------------------
        Method Social_Observer.__init__:        
        ===============================
        Experiment_Observer constructor
            + declaration of an average social distance curve
            + initialization of social links
        ----------------------------------------------------------------------------------
        Arguments:
            . Parameters


        ----------------------------------------------------------------------------------
        Method Social_Observer.get_data:        
        ===============================
        Experiment_Observer’s get_data + slot ‘Network’ that contains social links
        ----------------------------------------------------------------------------------
        Arguments:
            . Slot
            . Consumption


        ----------------------------------------------------------------------------------
        Method Social_Observer.hot_phase:        
        ================================
        The hot phase is a limited amount of time, controlled by the ‘LearnHorizon’ parameter,
            during which learning is faster.
        ----------------------------------------------------------------------------------


    **************************************************************************************
    Class Social_Individual:        inherits from Evolife.Social.Alliances.Follower, Evolife.Ecology.Learner.Learner
    =======================
    A social individual has friends and can learn
    **************************************************************************************

        ----------------------------------------------------------------------------------
        Method Social_Individual.__init__:        
        =================================
        Initalizes social links and learning parameters
        ----------------------------------------------------------------------------------
        Arguments:
            . IdNb
            . features
            . maxQuality
            . parameters
            . SocialSymmetry


        ----------------------------------------------------------------------------------
        Method Social_Individual.Reset:        
        ==============================
        called by Learner at initialization and when born again
            Resets social links and learning experience
        ----------------------------------------------------------------------------------
        Arguments:
            . Newborn


        ----------------------------------------------------------------------------------
        Method Social_Individual.reinit:        
        ===============================
        called at the beginning of each year
            sets Points to zero and possibly erases social links (based on parameter ‘EraseNetwork')
        ----------------------------------------------------------------------------------


        ----------------------------------------------------------------------------------
        Method Social_Individual.update:        
        ===============================
        updates values for display
        ----------------------------------------------------------------------------------
        Arguments:
            . infancy


        ----------------------------------------------------------------------------------
        Method Social_Individual.Interact:        
        =================================
        to be overloaded
        ----------------------------------------------------------------------------------
        Arguments:
            . Partner


        ----------------------------------------------------------------------------------
        Method Social_Individual.assessment:        
        ===================================
        Social benefit from having friends - called by Learning
            (to be overloaded)
        ----------------------------------------------------------------------------------


    **************************************************************************************
    Class Social_Population:        
    =======================
    defines a population of interacting agents
    **************************************************************************************

        ----------------------------------------------------------------------------------
        Method Social_Population.__init__:        
        =================================
        creates a population of social individuals
        ----------------------------------------------------------------------------------
        Arguments:
            . parameters
            . NbAgents
            . Observer
            . IndividualClass
            . features


        ----------------------------------------------------------------------------------
        Method Social_Population.positions:        
        ==================================
        returns the list of agents’ locations
        ----------------------------------------------------------------------------------


        ----------------------------------------------------------------------------------
        Method Social_Population.neighbours:        
        ===================================
        Returns agents of neighbouring qualitied
        ----------------------------------------------------------------------------------
        Arguments:
            . Agent


        ----------------------------------------------------------------------------------
        Method Social_Population.SignalAvg:        
        ==================================
        average signal in the population
        ----------------------------------------------------------------------------------


        ----------------------------------------------------------------------------------
        Method Social_Population.FeatureAvg:        
        ===================================
        average value of Feature’s value
        ----------------------------------------------------------------------------------
        Arguments:
            . Feature


        ----------------------------------------------------------------------------------
        Method Social_Population.FriendDistance:        
        =======================================
        average distance between friends
        ----------------------------------------------------------------------------------


        ----------------------------------------------------------------------------------
        Method Social_Population.display:        
        ================================
        Updates agents positions and social links for display.
            Updates average feature values for curves
        ----------------------------------------------------------------------------------


        ----------------------------------------------------------------------------------
        Method Social_Population.season_initialization:        
        ==============================================
        tells agents to reinitialize each year
        ----------------------------------------------------------------------------------


        ----------------------------------------------------------------------------------
        Method Social_Population.interactions:        
        =====================================
        interactions occur within a group
        ----------------------------------------------------------------------------------
        Arguments:
            . group
            . NbInteractions


        ----------------------------------------------------------------------------------
        Method Social_Population.learning:        
        =================================
        called at each ‘run’, several times per year
        ----------------------------------------------------------------------------------


        ----------------------------------------------------------------------------------
        Method Social_Population.One_Run:        
        ================================
        This procedure is repeatedly called by the simulation thread.
            It increments the year through season().
            Then for each run (there are NbRunPerYear runs each year),
            interactions take place within groups
        ----------------------------------------------------------------------------------


    

    

    Back to Evolife