Evolife documentation

     summary     

    

******************************************************************************************
Module Evolife.Ecology.Group:        
============================
EVOLIFE: Module Group:
        Reproduction, selection and behavioural games
        take place within the group
******************************************************************************************


    **************************************************************************************
    Class Group:        
    ===========
    A group is mainly a list of individuals
    **************************************************************************************

        ----------------------------------------------------------------------------------
        Method Group.__init__        
        ----------------------------------------------------------------------------------
        Arguments:
            . Scenario
            . ID
            . Size


        ----------------------------------------------------------------------------------
        Method Group.free_ID:        
        ====================
        returns an available ID
        ----------------------------------------------------------------------------------
        Arguments:
            . Prefix


        ----------------------------------------------------------------------------------
        Method Group.createIndividual:        
        =============================
        Calls the ‘Individual’ class
        ----------------------------------------------------------------------------------
        Arguments:
            . ID
            . Newborn


        ----------------------------------------------------------------------------------
        Method Group.whoIs:        
        ==================
        Returns the Numberth individual
        ----------------------------------------------------------------------------------
        Arguments:
            . Number


        ----------------------------------------------------------------------------------
        Method Group.isMember        
        ----------------------------------------------------------------------------------
        Arguments:
            . indiv


        ----------------------------------------------------------------------------------
        Method Group.update_:        
        ====================
        updates various facts about the group
        ----------------------------------------------------------------------------------
        Arguments:
            . flagRanking
            . display


        ----------------------------------------------------------------------------------
        Method Group.statistics:        
        =======================
        Updates various statistics about the group.
            Calls ‘observation’ for each member
        ----------------------------------------------------------------------------------


        ----------------------------------------------------------------------------------
        Method Group.positions:        
        ======================
        lists agents’ locations
        ----------------------------------------------------------------------------------


        ----------------------------------------------------------------------------------
        Method Group.season:        
        ===================
        This function is called at the beginning of each year
        ----------------------------------------------------------------------------------
        Arguments:
            . year


        ----------------------------------------------------------------------------------
        Method Group.kill:        
        =================
        suppress one specified individual of the group
        ----------------------------------------------------------------------------------
        Arguments:
            . memberNbr


        ----------------------------------------------------------------------------------
        Method Group.remove_:        
        ====================
        tells a member it should die and then removes it from the group
        ----------------------------------------------------------------------------------
        Arguments:
            . memberNbr


        ----------------------------------------------------------------------------------
        Method Group.remove_member:        
        ==========================
        calls ‘remove_’ with indiv’s index in the group
        ----------------------------------------------------------------------------------
        Arguments:
            . indiv


        ----------------------------------------------------------------------------------
        Method Group.extract:        
        ====================
        synonymous to ‘remove_member’
        ----------------------------------------------------------------------------------
        Arguments:
            . indiv


        ----------------------------------------------------------------------------------
        Method Group.receive:        
        ====================
        insert a new member in the group
        ----------------------------------------------------------------------------------
        Arguments:
            . newcomer


    **************************************************************************************
    Class EvolifeGroup:        inherits from Evolife.Ecology.Group.Group
    ==================
    class Group: list of individuals that interact and reproduce
    **************************************************************************************

        ----------------------------------------------------------------------------------
        Method EvolifeGroup.createIndividual:        
        ====================================
        calls the ‘EvolifeIndividual’ class
            calls ‘Scenario.new_agent’
        ----------------------------------------------------------------------------------
        Arguments:
            . Newborn


        ----------------------------------------------------------------------------------
        Method EvolifeGroup.uploadDNA:        
        =============================
        loads given DNAs into individuals
        ----------------------------------------------------------------------------------
        Arguments:
            . Start


        ----------------------------------------------------------------------------------
        Method EvolifeGroup.update_:        
        ===========================
        updates various facts about the group + positions
        ----------------------------------------------------------------------------------
        Arguments:
            . flagRanking
            . display


        ----------------------------------------------------------------------------------
        Method EvolifeGroup.reproduction:        
        ================================
        reproduction within the group
            creates individuals from couples returned by ‘Scenario.couples’
            by calling ‘hybrid’ on the parents’ genome
            and then by mutating the individual and inserting into the group
        ----------------------------------------------------------------------------------


        ----------------------------------------------------------------------------------
        Method EvolifeGroup.season:        
        ==========================
        This function is called at the beginning of each year
            It calls Scenario.season
        ----------------------------------------------------------------------------------
        Arguments:
            . year


        ----------------------------------------------------------------------------------
        Method EvolifeGroup.kill:        
        ========================
        kills or weakens one specified individual of the group
        ----------------------------------------------------------------------------------
        Arguments:
            . memberNbr


        ----------------------------------------------------------------------------------
        Method EvolifeGroup.remove_:        
        ===========================
        calls Group.remove_ and also Scenario.remove_agent
        ----------------------------------------------------------------------------------
        Arguments:
            . memberNbr


        ----------------------------------------------------------------------------------
        Method EvolifeGroup.life_game:        
        =============================
        Calls Scenario.life_game
        ----------------------------------------------------------------------------------


        ----------------------------------------------------------------------------------
        Method EvolifeGroup.get_average:        
        ===============================
        computes an average individual in the group
        ----------------------------------------------------------------------------------


        ----------------------------------------------------------------------------------
        Method EvolifeGroup.get_best:        
        ============================
        returns the phenotype of the best or representative individual
        ----------------------------------------------------------------------------------


    

    

    Back to Evolife