tyssue.behaviors package

Submodules

tyssue.behaviors.event_manager module

Event management module

class tyssue.behaviors.event_manager.EventManager(element=None, logfile=None)[source]

Bases: object

Behavior management class based on two deques, the current and next one.

Creates an events class

Parameters
  • element (str) – element on which the events occur, e.g face or cell, optional

  • logfile (str, default None) – if logfile is not None, will create a logging handler for this file where each event will be logged

append(behavior, **kwargs)[source]

Add an event to the manager’s next deque

behavior is a function whose signature is ..code :

behavior(sheet, manager, **kwargs)

this function itself might populate the managers next deque

Parameters
  • behavior (function) –

  • kwargs (dict defaults to {}) – keywords arguments to the behavior function if “face_id” is in the kwargs dictionnary, the face with this id is used.

execute(eptm)[source]

Executes the events present in the self.current deque.

extend(events)[source]

Add a list of events to the next deque

Parameters

events (list of tuples (behavior, [elem_id, args, kwargs])) – the three last elements don’t need to be passed

update()[source]

Replaces self.current by self.next and clears self.next.

tyssue.behaviors.event_manager.wait(eptm, manager, **kwargs)[source]

Does nothing for a number of steps n_steps

Module contents

Behavior and event management module