Evolife
Evolife has been developed to study Genetic algorithms, Natural evolution and behavioural ecology.
Public Member Functions | Public Attributes | List of all members
Evolife.Ecology.Observer.Generic_Observer Class Reference

Minimal observer. More...

Inheritance diagram for Evolife.Ecology.Observer.Generic_Observer:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, ObsName='', TimeLimit=10000)
 initializes ScenarioName, EvolifeMainDir, CurveNames, Title, Field_grid and Trajectory_grid More...
 
def DisplayPeriod (self, Per=0)
 sets or retrieves display period More...
 
def season (self, year=None)
 increments StepId More...
 
def Visible (self)
 decides whether the situation should be displayed More...
 
def Over (self)
 Checks whether time limit has been reached and has not been manually bypassed. More...
 
def setOutputDir (self, ResultDir='___Results')
 set output directory ('___Results' by default) More...
 
def recordInfo (self, Slot, Value)
 stores Value in Slot More...
 
def get_info (self, Slot, default=None, erase=False)
 returns factual information previously stored in Slot returns 'default' (which is None by default) if Slot is not found More...
 
def inform (self, Info)
 Info is sent by the simulation - Typically a single char, corresponding to a key pressed Useful to customize action. More...
 
def ResultHeader (self)
 Parameter names are stored with the date in the result file header Header is just the string "Date" by default. More...
 
def record (self, Position, Window='Field', Reset=False)
 stores current position changes into the Window's buffer ('Field' by default, could be 'Trajectories') 'Position' can also be the string "erase" More...
 
def Field_grid (self)
 returns initial drawing for 'Field' More...
 
def Trajectory_grid (self)
 returns initial drawing for 'Trajectories' More...
 
def get_data (self, Slot, Consumption=True)
 Retrieves data from Slot. More...
 
def displayed (self)
 Remembers that display occurred (to ensure that it answers once a year) More...
 
def TextErase (self)
 Erases the text buffer. More...
 
def TextDisplay (self, Str="")
 stores a string that will be displayed at appropriate time. More...
 
def curve (self, Name=None, Value=None, Color=None, Legend=None)
 creates or retrieves a curve or return curve's current value. More...
 
def legend (self)
 returns curves' legends More...
 
def CurveNames (self)
 returns curves' names More...
 
def GetPlotOrders (self)
 Returns current curves' values if observer in visible state. More...
 

Public Attributes

 TimeLimit
 
 DispPeriod
 
 StepId
 
 PreviousStep
 
 Infos
 
 Curves
 
 Field_buffer
 
 Trajectory_buffer
 

Detailed Description

Minimal observer.

Definition at line 325 of file Observer.py.

Constructor & Destructor Documentation

◆ __init__()

def Evolife.Ecology.Observer.Generic_Observer.__init__ (   self,
  ObsName = '',
  TimeLimit = 10000 
)

initializes ScenarioName, EvolifeMainDir, CurveNames, Title, Field_grid and Trajectory_grid

Reimplemented in Evolife.Ecology.Observer.Experiment_Observer, Evolife.Ecology.Observer.EvolifeObserver, and Evolife.Ecology.Observer.Observer.

Definition at line 328 of file Observer.py.

Member Function Documentation

◆ curve()

def Evolife.Ecology.Observer.Generic_Observer.curve (   self,
  Name = None,
  Value = None,
  Color = None,
  Legend = None 
)

creates or retrieves a curve or return curve's current value.

If Name is None: resets all curves.

Definition at line 486 of file Observer.py.

◆ CurveNames()

def Evolife.Ecology.Observer.Generic_Observer.CurveNames (   self)

returns curves' names

Definition at line 503 of file Observer.py.

◆ displayed()

def Evolife.Ecology.Observer.Generic_Observer.displayed (   self)

Remembers that display occurred (to ensure that it answers once a year)

Definition at line 467 of file Observer.py.

◆ DisplayPeriod()

def Evolife.Ecology.Observer.Generic_Observer.DisplayPeriod (   self,
  Per = 0 
)

sets or retrieves display period

Definition at line 347 of file Observer.py.

◆ Field_grid()

def Evolife.Ecology.Observer.Generic_Observer.Field_grid (   self)

returns initial drawing for 'Field'

Reimplemented in Evolife.Ecology.Observer.EvolifeObserver, and Evolife.Scenarii.CustomScenario.Observer.

Definition at line 440 of file Observer.py.

◆ get_data()

def Evolife.Ecology.Observer.Generic_Observer.get_data (   self,
  Slot,
  Consumption = True 
)

Retrieves data from Slot.

Erases Slot's content if Consumption is True

Reimplemented in Evolife.Ecology.Observer.Observer.

Definition at line 450 of file Observer.py.

◆ get_info()

def Evolife.Ecology.Observer.Generic_Observer.get_info (   self,
  Slot,
  default = None,
  erase = False 
)

returns factual information previously stored in Slot returns 'default' (which is None by default) if Slot is not found

Reimplemented in Evolife.Ecology.Observer.Experiment_Observer, and Evolife.Ecology.Observer.EvolifeObserver.

Definition at line 396 of file Observer.py.

◆ GetPlotOrders()

def Evolife.Ecology.Observer.Generic_Observer.GetPlotOrders (   self)

Returns current curves' values if observer in visible state.

Reimplemented in Evolife.Ecology.Observer.EvolifeObserver.

Definition at line 508 of file Observer.py.

◆ inform()

def Evolife.Ecology.Observer.Generic_Observer.inform (   self,
  Info 
)

Info is sent by the simulation - Typically a single char, corresponding to a key pressed Useful to customize action.

Definition at line 414 of file Observer.py.

◆ legend()

def Evolife.Ecology.Observer.Generic_Observer.legend (   self)

returns curves' legends

Definition at line 498 of file Observer.py.

◆ Over()

def Evolife.Ecology.Observer.Generic_Observer.Over (   self)

Checks whether time limit has been reached and has not been manually bypassed.

Definition at line 369 of file Observer.py.

◆ record()

def Evolife.Ecology.Observer.Generic_Observer.record (   self,
  Position,
  Window = 'Field',
  Reset = False 
)

stores current position changes into the Window's buffer ('Field' by default, could be 'Trajectories') 'Position' can also be the string "erase"

Definition at line 427 of file Observer.py.

◆ recordInfo()

def Evolife.Ecology.Observer.Generic_Observer.recordInfo (   self,
  Slot,
  Value 
)

stores Value in Slot

Definition at line 390 of file Observer.py.

◆ ResultHeader()

def Evolife.Ecology.Observer.Generic_Observer.ResultHeader (   self)

Parameter names are stored with the date in the result file header Header is just the string "Date" by default.

Reimplemented in Evolife.Ecology.Observer.Experiment_Observer.

Definition at line 421 of file Observer.py.

◆ season()

def Evolife.Ecology.Observer.Generic_Observer.season (   self,
  year = None 
)

increments StepId

Definition at line 353 of file Observer.py.

◆ setOutputDir()

def Evolife.Ecology.Observer.Generic_Observer.setOutputDir (   self,
  ResultDir = '___Results' 
)

set output directory ('___Results' by default)

Definition at line 380 of file Observer.py.

◆ TextDisplay()

def Evolife.Ecology.Observer.Generic_Observer.TextDisplay (   self,
  Str = "" 
)

stores a string that will be displayed at appropriate time.

Text is currently printed on the console (to be changed)

Reimplemented in Evolife.Ecology.Observer.EvolifeObserver.

Definition at line 477 of file Observer.py.

◆ TextErase()

def Evolife.Ecology.Observer.Generic_Observer.TextErase (   self)

Erases the text buffer.

Definition at line 472 of file Observer.py.

◆ Trajectory_grid()

def Evolife.Ecology.Observer.Generic_Observer.Trajectory_grid (   self)

returns initial drawing for 'Trajectories'

Reimplemented in Evolife.Ecology.Observer.EvolifeObserver.

Definition at line 445 of file Observer.py.

◆ Visible()

def Evolife.Ecology.Observer.Generic_Observer.Visible (   self)

decides whether the situation should be displayed

Definition at line 360 of file Observer.py.

Member Data Documentation

◆ Curves

Evolife.Ecology.Observer.Generic_Observer.Curves

Definition at line 343 of file Observer.py.

◆ DispPeriod

Evolife.Ecology.Observer.Generic_Observer.DispPeriod

Definition at line 332 of file Observer.py.

◆ Field_buffer

Evolife.Ecology.Observer.Generic_Observer.Field_buffer

Definition at line 344 of file Observer.py.

◆ Infos

Evolife.Ecology.Observer.Generic_Observer.Infos

Definition at line 335 of file Observer.py.

◆ PreviousStep

Evolife.Ecology.Observer.Generic_Observer.PreviousStep

Definition at line 334 of file Observer.py.

◆ StepId

Evolife.Ecology.Observer.Generic_Observer.StepId

Definition at line 333 of file Observer.py.

◆ TimeLimit

Evolife.Ecology.Observer.Generic_Observer.TimeLimit

Definition at line 331 of file Observer.py.

◆ Trajectory_buffer

Evolife.Ecology.Observer.Generic_Observer.Trajectory_buffer

Definition at line 345 of file Observer.py.


The documentation for this class was generated from the following file: