Package topo :: Package sheets :: Module generatorsheet :: Class GeneratorSheet
[hide private]
[frames] | no frames]

Class GeneratorSheet

source code

                                  object --+            
                                           |            
base.parameterizedobject.ParameterizedObject --+        
                                               |        
                  base.simulation.EventProcessor --+    
                                                   |    
                                      object --+   |    
                                               |   |    
          base.sheetcoords.SheetCoordinateSystem --+    
                                                   |    
                                    base.sheet.Sheet --+
                                                       |
                                                      GeneratorSheet
Known Subclasses:
SequenceGeneratorSheet

Sheet for generating a series of 2D patterns.

Typically generates the patterns by choosing parameters from a random distribution, but can use any mechanism.



Nested Classes [hide private]

Inherited from base.parameterizedobject.ParameterizedObject: __metaclass__

Instance Methods [hide private]
 
__init__(self, **params)
Initialize this object as an EventProcessor, then also as a SheetCoordinateSystem with equal xdensity and ydensity.
source code
 
set_input_generator(self, new_ig, push_existing=False)
Set the input_generator, overwriting the existing one by default.
source code
 
push_input_generator(self)
Push the current input_generator onto a stack for future retrieval.
source code
 
pop_input_generator(self)
Discard the current input_generator, and retrieve the previous one from the stack.
source code
 
generate(self)
Generate the output and send it out the Activity port.
source code
 
start(self)
Called by the simulation when the EventProcessor is added to the simulation.
source code
 
input_event(self, conn, data)
Called by the simulation when an EPConnectionEvent is delivered; the EventProcessor should process the data somehow.
source code
 
override_plasticity_state(self, new_plasticity_state)
Temporarily override plasticity of medium and long term internal state.
source code
 
restore_plasticity_state(self)
Restores plasticity of medium and long term internal state after a override_plasticity_state call.
source code

Inherited from base.sheet.Sheet: activity_len, release_sheet_view, row_col_sheetcoords, sheet_cols, sheet_offset, sheet_rows, state_pop, state_push

Inherited from base.simulation.EventProcessor: process_current_time, script_repr, send_output

Inherited from base.parameterizedobject.ParameterizedObject: __getstate__, __repr__, __setstate__, __str__, as_uninitialized, debug, defaults, force_new_dynamic_value, get_param_values, get_value_generator, inspect_value, message, print_param_values, verbose, warning

Inherited from base.sheetcoords.SheetCoordinateSystem: bounds2slice, closest_cell_center, matrix2sheet, matrixidx2sheet, sheet2matrix, sheet2matrixidx, sheetcoordinates_of_matrixidx, slice2bounds

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

Class Methods [hide private]

Inherited from base.parameterizedobject.ParameterizedObject: params, print_param_defaults

Class Variables [hide private]
  src_ports = ['Activity']
list() -> new list list(sequence) -> new list initialized from sequence's items
  period = Number(default= 1, bounds= (0, None), doc= "Delay (in...
Delay (in Simulation time) between generating new input patterns.
  phase = Number(default= 0.05, doc= ...
Delay after the start of the Simulation (at time zero) before generating an input pattern.
  input_generator = <topo.base.parameterclasses.ClassSelectorPar...
Specifies a particular PatternGenerator type to use when creating patterns.
  output_fn = <topo.base.parameterclasses.ClassSelectorParameter...
Output function to apply (if apply_output_fn is true) to this Sheet's activity.
  apply_output_fn = <topo.base.parameterclasses.BooleanParameter...
Whether to apply the output_fn after computing an Activity matrix.

Inherited from base.sheet.Sheet: layout_location, nominal_bounds, nominal_density, plastic, precedence

Inherited from base.simulation.EventProcessor: dest_ports

Inherited from base.parameterizedobject.ParameterizedObject: name, print_level

Properties [hide private]

Inherited from base.sheetcoords.SheetCoordinateSystem: shape, xdensity, ydensity

Inherited from object: __class__

Method Details [hide private]

__init__(self, **params)
(Constructor)

source code 

Initialize this object as an EventProcessor, then also as a SheetCoordinateSystem with equal xdensity and ydensity.

sheet_views is a dictionary that stores SheetViews, i.e. representations of the sheet for use by analysis or plotting code.

Overrides: base.sheet.Sheet.__init__
(inherited documentation)

set_input_generator(self, new_ig, push_existing=False)

source code 

Set the input_generator, overwriting the existing one by default.

If push_existing is false, the existing input_generator is discarded permanently. Otherwise, the existing one is put onto a stack, and can later be restored by calling pop_input_generator.

pop_input_generator(self)

source code 

Discard the current input_generator, and retrieve the previous one from the stack.

Warns if no input_generator is available on the stack.

start(self)

source code 

Called by the simulation when the EventProcessor is added to the simulation.

If an EventProcessor needs to have any code run when it is added to the simulation, the code can be put into this method in the subclass.

Overrides: base.simulation.EventProcessor.start
(inherited documentation)

input_event(self, conn, data)

source code 
Called by the simulation when an EPConnectionEvent is delivered; the EventProcessor should process the data somehow.
Overrides: base.simulation.EventProcessor.input_event
(inherited documentation)

override_plasticity_state(self, new_plasticity_state)

source code 

Temporarily override plasticity of medium and long term internal state.

This function should be implemented by all subclasses so that it preserves the ability of the Sheet to compute activity, i.e. to operate over a short time scale, while preventing any lasting changes to the state (if new_plasticity_state=False).

Any operation that does not have any lasting state, such as those affecting only the current activity level, should not be affected by this call.

By default, simply saves a copy of the plastic flag to an internal stack (so that it can be restored by restore_plasticity_state()), and then sets plastic to new_plasticity_state.

Overrides: base.sheet.Sheet.override_plasticity_state
(inherited documentation)

restore_plasticity_state(self)

source code 

Restores plasticity of medium and long term internal state after a override_plasticity_state call.

This function should be implemented by all subclasses to remove the effect of the most recent override_plasticity_state call, i.e. to restore plasticity of any type that was overridden.

Overrides: base.sheet.Sheet.restore_plasticity_state
(inherited documentation)

Class Variable Details [hide private]

period

Delay (in Simulation time) between generating new input patterns.
Value:
Number(default= 1, bounds= (0, None), doc= "Delay (in Simulation time) between gen\
erating new input patterns.")

phase

Delay after the start of the Simulation (at time zero) before generating an input pattern. For a clocked, feedforward simulation, one would typically want to use a small nonzero phase and use delays less than the user-visible step size (typically 1.0), so that inputs are generated and processed before this step is complete.
Value:
Number(default= 0.05, doc= """
        Delay after the start of the Simulation (at time zero) before
        generating an input pattern.  For a clocked, feedforward simulation, 
        one would typically want to use a small nonzero phase and use delays less
        than the user-visible step size (typically 1.0), so that inputs are
        generated and processed before this step is complete.
        """)

input_generator

Specifies a particular PatternGenerator type to use when creating patterns.
Value:
ClassSelectorParameter(PatternGenerator, default= Constant(), doc= """Specifies a \
particular PatternGenerator type to use when creating patterns.""")

output_fn

Output function to apply (if apply_output_fn is true) to this Sheet's activity.
Value:
ClassSelectorParameter(OutputFn, default= IdentityOF(), doc= """
        Output function to apply (if apply_output_fn is true) to this Sheet's acti\
vity.""")

apply_output_fn

Whether to apply the output_fn after computing an Activity matrix.
Value:
BooleanParameter(default= True, doc= """
        Whether to apply the output_fn after computing an Activity matrix.""")