Table Of Contents

Previous topic

aggregationcaller.py

Next topic

geotablecaller.py

This Page

caller.py

>>> from minimock import Mock

class Caller(object):

Super class of all model and table caller classes

Attributes:

  • _type: caller type as string
  • _model: model / table instance
  • _params: parameter instance
  • _sim: simulator instance
  • _depth: current task depth as integer

def __init__(self, callertype):

Initialize caller:

>>> from simo.simulation.caller.caller import Caller
>>> caller = Caller('test-type')
>>> caller._sim = Mock('Simulator')
>>> caller._type
'test-type'

def execute(self, model, params, sim, depth):

Placeholder for subclass implementations.

def add_error(self, errorstr):

Log error message:

>>> errorstr = "test error message"
>>> caller.add_error(errorstr, None, None) 
Called Simulator.add_error('test-type caller: test error message', None,
                           None)

def add_warning(self, warnstr):

Log error message:

>>> warnstr = "test warning message"
>>> caller.add_warning(warnstr, None, None)
Called Simulator.add_warning(
    'test-type caller: test warning message',
    None,
    None)