Documentation ¶
Index ¶
- Constants
- func Act(brain *Brain)
- type Brain
- func (b *Brain) AddNeuron(neuron *Neuron)
- func (b *Brain) DeleteNeuron(guid string)
- func (b *Brain) GetNeuron(ID string) *Neuron
- func (b *Brain) GetNeuronIfLoaded(ID string) *Neuron
- func (b *Brain) GetStorageFolder(baseFolder string) string
- func (b *Brain) LoadAllLinkupNeurons()
- func (b *Brain) LoadLinkupNeurons(linkupName string)
- func (b *Brain) LoadNeuron(neuronName string) (*Neuron, error)
- func (b *Brain) LoadedSize() int
- func (b *Brain) QueueForCharging(neuron *Neuron)
- func (b *Brain) QueueForFiring(neuron *Neuron)
- func (b *Brain) StoreBrain() error
- func (b *Brain) StoreNeuron(neuron *Neuron) error
- func (b *Brain) UnQueueFromCharging() *Neuron
- func (b *Brain) UnQueueFromFiring() *Neuron
- type Entity
- type Linkup
- type LinkupConsole
- type Neuron
Constants ¶
const FiringLimit = 7777
const ResidualCharge = -111
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Brain ¶
type Brain struct { BrainName string `json:"brain_name"` // Unique name to be used for the brain StoragePath string `json:"storage_path"` // The folder the data needs to be put in Linkups map[string]Linkup `json:"linkups"` // The set of Linkups for this brain // contains filtered or unexported fields }
Brain contains all information that relates to the brain as a whole.
func (*Brain) DeleteNeuron ¶
func (*Brain) GetNeuron ¶
GetNeuron returns a reference to a Neuron if it is In the loaded map, or a nil reference otherwise.
func (*Brain) GetNeuronIfLoaded ¶
GetNeuronIfLoaded returns a reference to a Neuron if it is In the loaded map, or a nil reference otherwise.
func (*Brain) GetStorageFolder ¶
func (*Brain) LoadAllLinkupNeurons ¶
func (b *Brain) LoadAllLinkupNeurons()
func (*Brain) LoadLinkupNeurons ¶
func (*Brain) LoadedSize ¶
LoadedSize returns the size of the map containing the Neurons loaded In memory.
func (*Brain) QueueForCharging ¶
func (*Brain) QueueForFiring ¶
func (*Brain) StoreBrain ¶
func (*Brain) StoreNeuron ¶
func (*Brain) UnQueueFromCharging ¶
func (*Brain) UnQueueFromFiring ¶
type Entity ¶
type Linkup ¶
type Linkup struct { Name string `json:"linkupname"` // Unique ID Nerves []string `json:"nerve_ids"` // The pre-assigned set of Neurons Dirty bool `json:"dirty"` // is the Linkup not synced to disk? // contains filtered or unexported fields }
Linkup contains all information that relates to a single Linkup to an input/output device.
type LinkupConsole ¶
type LinkupConsole struct {
Linkup // the connected Linkup module
}
Linkup contains all information that relates to a single Linkup to an input/output device.
func NewLinkupConsole ¶
func NewLinkupConsole(brain *Brain, name string) LinkupConsole
NewLinkupConsole returns a new Linkup properly initialized
func (*LinkupConsole) StartLinkup ¶
func (c *LinkupConsole) StartLinkup()
type Neuron ¶
type Neuron struct { Name string `json:"brain_name"` // Unique ID In map[string]int `json:"in"` // IDs of incoming Neurons Out map[string]int `json:"out"` // IDs of outgoing Neurons Charge int `json:"charge"` // the charge level Dirty bool `json:"dirty"` // is the neuron not synced to disk? }
Neuron contains all information that relates to a single neuron In the brain.
func (*Neuron) Accumulate ¶
func (*Neuron) AddNeuronIn ¶
AddNeuronIn adds a neuron to the