Package bw :: Package poseidon :: Module neurons
[frames] | no frames]

Module neurons

This module defines the main Neuron classes and basic metadata operations.

Classes
  N
This is the superclass which represents all neurons.
  M
This class represents Memes.
  L
This class represents Links between Neurons.
Functions
 
make_xmap(is_link, is_deleted, *args)
Initialize an xmap object.
 
read_xmap(s)
Validate the bit-field by checking the MSB and LSB.
 
is_link(s)
Returns: True if the 2nd bit is set i.e.
 
is_deleted(s)
Returns: True if the 3rd bit is set i.e.

Imports: uuid, time, operator, UUID, StringType, UnicodeType, ListType, pickle


Function Details

make_xmap(is_link, is_deleted, *args)

 

Initialize an xmap object. This is a 32-bit integer used as a bit-field The MSB is reserved and is always 0. The LSB is reserved and is always 1. Bit 2 is set if the neuron is a link. Bit 3 is set if the neuron is deleted.

read_xmap(s)

 

Validate the bit-field by checking the MSB and LSB.

Returns:
A list of 30 True/False values corresponding to the bits.

is_link(s)

 
Returns:
True if the 2nd bit is set i.e. it is a link.

is_deleted(s)

 
Returns:
True if the 3rd bit is set i.e. it is deleted.