# Methods common to all layers

Layers correspond to identifiable states in a cognitive model, often consisting of sets of homogeneous units.

## description

    some_layer description

The description of `some_layer` will have the additional elements: `Representation` names the associated representation; `Width` indicates the width of that representation used to format the layer; `Current time` indicates the time currently associated with the layer; `Incoming connections` lists that attached connections with sub-elements indicating

    the attached input channel as `port`;

`Ports` list all input channels.

## attach

    some_layer attach src_conn port

Establish `src_conn` as an incoming connection on port `port` (name) of `some_layer`.

    some_layer attach src_conn

As above, except the default port (net_input) is used.

## detach

    some_layer detach src_conn

Detach `src_conn` as connection to `some_layer` on any port.

## connections

    some_layer connections

List connections to `some_layer`.

## lesion

    some_layer lesion

Insert a `lesion_transfer` into the layer_transfer slot of `some_layer` without destroying the existing transfer facet (which now becomes the responsiblity of the lesion_transfer facet to manage; this is used in the unlesion method).

## unlesion

    some_layer unlesion

If `some_layer` has a `lesion_transfer` facet, replace this with the original layer_transfer facet, and destroy the `lesion_transfer` facet.

## represent

    some_layer represent rep

Set the representaion of `some_layer` to be `rep`.

## state

    some_layer state time_step

Return the state of `some_layer` at the (integer) `time_step` index in the array of states. Note time_step is the rank time, not the time (see `time_summary`).

    some_layer state

Return the pattern_reference that (continually) refers to the current state pattern.

## output

    some_layer output time_step

Return the state of `some_layer` at the (integer) `time_step` index in the array of outputs. Note time_step is the rank time, not the time (see `time_summary`).

    some_layer output

Return the pattern_reference that (continually) refers to the current output pattern.

## input

    some_layer input time_step port

Return the input to the `port` channel (number) of `some_layer` at the (integer) `time_step` index in the array of inputs. Note time_step is the rank time, not the time (see `time_summary`).

    some_layer output time_step

As above, but the default input (0; net_input) is used.

    some_layer output

As above, but the current time is used.

## input_ref

    some_layer input_ref port

Return the updating pattern_reference to the current input to `some_layer` on port number `port`.

## set_lag

    some_conn set_lag nsteps

Set the amount of time between input and output of `some_conn` to be `nsteps`. lag is the time differential between input and state/output, such that the output at time `t` can be generated with only the input up to and including the time `t-lag`.

## get_labels

    some_conn get_labels

List the dimensions of the representation associated with `some_conn`.

## rep

    some_conn rep

Return a representation_reference to the representation of `some_conn`.

## time

    some_conn time

Return a strength_pattern whose first and only element is the time at the layer.

## time_summary

    some_conn time_summary

Print a human-readable description of the association between integer indices in the input/state/output arrays and the floating point times.

## default_observer

    some_conn default_observer

Return a dflog_nobserver owned by the layer with default settings to observe the state of `some_conn`.

## default_input_observer

    some_conn default_input_observer port

Return a dflog_nobserver owned by the input_port with default settings to observe the input channel port number `port` of `some_conn`.

    some_conn default_input_observer

As above, but port number is 0 (net_input).