Package cells :: Module cell :: Class LazyCell
[hide private]
[frames] | no frames]

Class LazyCell
source code

object --+        
         |        
      Cell --+    
             |    
      RuleCell --+
                 |
                LazyCell
Known Subclasses:
AlwaysLazyCell, UntilAskedLazyCell

A RuleCell which does not update upon propogation. When it has get() run, it updates as other Cells do.

Instance Methods [hide private]
  __init__(self, owner, name=None, rule=lambda s, p: None, unchanged_if=None)
Initializes a LazyCell object, which may not be set and whose value is determined by a rule.

Inherited from RuleCell: set

Inherited from Cell: add_called_by, add_calls, called_by_list, calls_list, changed, getvalue, propogate, propogation_list, remove_called_bys, remove_cb, reset_calls, run, updatecell

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__


Class Variables [hide private]

Inherited from object: __class__


Instance Variables [hide private]

Inherited from Cell: called_by, calls, synapse_space


Method Details [hide private]

__init__(self, owner, name=None, rule=lambda s, p: None, unchanged_if=None)
(Constructor)

source code 
Initializes a LazyCell object, which may not be set and whose value is determined by a rule.
Parameters:
  • name - This cell's name. When using a Cell with Models, this parameter is assigned automatically.
  • rule - Define a rule which backs this cell. You must only define one of rule or value. Lacking celltype, this creates a RuleCell. This must be passed a callable with the signature f(self, prev) -> value, where self is the model instance the cell is in and prev is the cell's out-of-date value.
  • unchanged_if - Sets a function to determine if a cell's value has changed. The signature for the passed function is f(old, new) -> bool.
Returns:
None

Raises:
  • RuleCellSetError - If value is passed as a parameter
Overrides: RuleCell.__init__