Crate feagi_structures

Crate feagi_structures 

Source
Expand description

The core crate for FEAGI. Defines the most common data structures used throughout

§FEAGI Data Structures

This crate is essentially the root crate that all other crates for FEAGI depends on. It defines the core data structures and functions used by all FEAGI libraries and applications.

There are several main concepts to be aware of:

§Genomic Structures

There are various Genomic structures / identifiers to be aware of

§Cortical Type

CorticalType is a nested enum that differentiates between different types of cortical areas. The possible types are:

  • Memory: Cortical areas to store memories from learning
  • Custom: In between Cortical Areas that handle the bulk of processing / thinking in a FEAGI model
  • Core: Universal Cortical areas that are found in all genomes. This has a sub Enum CoreCorticalType to define these different cortical types
  • Sensor: Defines some sensory input to FEAGI to allow it to sense the world, and uses sub enum SensorCorticalType to differentiate the sensor type
  • Motor: Defines some motor output of FEAGI to allow world interactions, and uses sub enum MotorCorticalType to differentiate what type of motor it is

Of note, the types of Sensors and Motors possible are defined by the Template Files, which are compiled via Rust Macros into the various SensorCorticalTypes and MotorCorticalTypes.

Effectively, this enum system allows defining a class of cortical area.

§Cortical ID

Cortical IDs are identifiers for a specific cortical area within a genome, essentially unique IDs per area. Functionally, they are defined as 6 ASCII bytes that follow various patterns depending on the type of area they represent. As a user you just need to be aware that there isd a unique ID per genome, but otherwise the system is largely automatic in the background.

§Descriptors

There are certain types of numbers to be aware of as well.

§Cortical Groups

Since you can have multiple cortical areas of the same sensor / motor cortical type, the Cortical Group is an u8 number defining which specific instance of a given cortical type is being referenced.

§Cortical Channels

A single cortical sensor / motor cortical area can be divided into multiple channels, to represent multiple inputs / outputs of a given type of data.

§Neuron Voxels

As seen in Brain Visualizer, a neuron (or a grouping of neurons) can be visualized as a 3D voxel. This state can be stored and communicated via NeuronVoxelXYZP structures, which define the XYZ coordinate of the neuron relative to the cortical area 0,0,0 root, and the P potential float, which in the case of sensors / motors, is often a float between -1 and 1.

Voxels may be grouped into arrays for a single cortical area in a NeuronVoxelXYZPArray structure, and multiple of these arrays for multiple cortical areas are mapped by their corresponding Cortical ID in a CorticalMappedXYZPNeuronVoxel structure, which acts as a dictionary.

§Templates

The sensor and motor template files are essentially tables used by macros to generate code corresponding to various types of sensors (from infrared sensors, proximity, camera, etc) and motors (servos, actuators, etc).

Modules§

common_macros
genomic
Genomic types and identifiers for FEAGI.
neuron_voxels
shared_enums

Macros§

define_index
Creates a strongly-typed index wrapper around an integer type.
define_nonzero_count
Creates a non-zero count type with validation.
define_xy_coordinates
Creates a 2D coordinate type with x,y fields.
define_xy_dimensions
Creates a 2D dimension type with width,height fields and validation.
define_xyz_coordinates
Creates a 3D coordinate type with x,y,z fields.
define_xyz_dimension_range
Creates a 3D dimension range type for spatial bounds checking.
define_xyz_dimensions
Creates a 3D dimension type with width,height,depth fields and validation.
define_xyz_mapping
Creates bidirectional conversions between two XYZ dimension types.
motor_cortical_units
sensor_cortical_units

Structs§

FeagiJSON
A wrapper around serde_json::Value for handling JSON data in FEAGI.
FeagiSignal
FeagiSignalIndex
A unique identifier for a subscription to a FeagiSignal

Enums§

FeagiDataError
Common error type for FEAGI data operations.