2""" @brief Customized scenario.
4 Use this if you REALLY need to re-implement the
8 classes. Otherwise, create a scenation named S_xxx.py
9 as shown
in the many examples contained
in this directory.
14#============================================================================#
15# EVOLIFE http://evolife.telecom-paris.fr Jean-Louis Dessalles
26sys.path.append(
'../..')
36 """ Implement a scenario here, by instantiating Default_Scenario.
37 See documentation in Default_Scenario.py to see how.
44 return [(
'gene1',16),(
'gene2',4)]
47 return [(
'blue',
'gene1',
'First gene'), (
'green4',
'gene2',
'Second gene')]
51 """ Observer stores display instructions and makes statistics
52 See Evolife/Apps/GraphicExample.py for examples
55 """ initial draw: here a blue line
57 return [(0, 0,
'blue', 1, 100, 100,
'blue', 1), (100, 100, 1, 0)]
60 """ class Individual_: defines what an individual consists of
62 def __init__(self, Scenario=None, ID=None, Newborn=False, maxQuality=100):
63 Individual.EvolifeIndividual.__init__(self, Scenario=Scenario, ID=ID, Newborn=Newborn)
64 self.
Quality = (100.0 * int(ID)) / maxQuality
70 """ Calls local class when creating individuals
77 """ Calls local class when creating group
86 if self.
Scenario[
'EraseNetwork']: agent.forgetAll()
91if __name__ ==
"__main__":
95 if Gbl[
'BatchMode'] == 0: print(__doc__)
101 if 'F' in Capabilities: Views.append((
'Field', 500, 350))
102 if 'T' in Capabilities: Views.append((
'Trajectories', 500, 350))
103 Obs.recordInfo(
'DefaultViews', Views)
104 Evolife_Window.Start(SimulationStep=Pop.one_year, Obs=Obs, Capabilities=Capabilities,
105 Options=[(
'Background',
'green11')])
109__author__ =
'Dessalles'
class Group: list of individuals that interact and reproduce.
def free_ID(self, Prefix=None)
returns an available ID
Evolife-aware observer based on the use of a scenario.
Population + reproduction + call to Scenario life_game.
Calls local class when creating individuals.
def createIndividual(self, ID=None, Newborn=True)
calls the 'EvolifeIndividual' class calls 'Scenario.new_agent'
class Individual_: defines what an individual consists of
def __init__(self, Scenario=None, ID=None, Newborn=False, maxQuality=100)
Observer stores display instructions and makes statistics See Evolife/Apps/GraphicExample....
Calls local class when creating group.
def season_initialization(self)
def createGroup(self, ID=0, Size=0)
This version of 'createGroup' calls the 'EvolifeGroup' class instead of the 'Group' class.
Implement a scenario here, by instantiating Default_Scenario.
def genemap(self)
Defines the name of genes and their position on the DNA.
def display_(self)
Defines what is to be displayed.
All functions defined here can be overloaded in specific scenarii (see module doc)
def __init__(self, Name='Default scenario', CfgFile='')
Loads parameters, sets gene map and calls local initialization.
Groups are lists of Individuals.
Gets data from various modules and stores them for display and statistics.
A population is a set of semi-permeable groups.
Determines how individuals acquire their score, either by themselves or through interactions.