This is the core of the brain.
Public Fields
-
int flag
- Simulation parameters parsed from the input file to control the simulation behavior
-
double TotalTime
- total time to run the program - seconds - input from user
-
int CycleCount
- Ticks to run.
-
int TimeStep
- Current timestep of the DoThink loop
-
int ReportTime
- Time to do Rich's status reports?
-
int StartTime
- Actual time in seconds when the program started the main loop - not used
-
int nCells
- Number of neurons on this node
-
Cell** Cells
- List of pointers referencing all Cells on this node
-
double* CellPosition[3]
- Cell Coordinates.
-
int nStimulus
- Number of stimulus objects currently defined
-
Stimulus* StimList
- Linked list of Stimulus objects
-
int nReports
- Number of report objects currently defined
-
Report* RptList
- Linked List of Reports objects
-
int nSynapseDef
- Number of Synapse Definitions
-
SynapseDef** SynapseDefs
- List of pointers to Synapse Definitions
-
bool SaveFlag
- If set to true, the state of all brain objects should be written to a file at end of timestep
-
bool ResetFlag
- If set to true, the state of all brain objects should be read and reset based on file
-
double SaveTime
- Automatically save brain state to file when it reaches this time
-
char* SaveFile
- Name of file to save to when automatically saving
-
int HostPort
- port for automatically connecting reports/stims/and the brain
-
int Port
- port for receiving outside commands
-
char* HostName
- hostname where this Brain will recv commands from
-
int sd
- socket descriptor opened if taking runtime commands
-
FILE* input
- FILE Pointer to use instead of sd
-
char* pendingCommands
- Pointer to hold pending commands meant for later timesteps
-
int pendingLength
- length of pendingCommands
-
MPI_Comm commandComm
- Communicator for distributing runtime commands
-
MPI_Group commandGroup
- Group for distributing runtime commands
Public Methods
-
void Save(char* )
- Save the current state of the brain to a file.
-
void LoadArrays( char* filename )
- Restore data that was kept in the arrays structure.
-
void Load(char* filename, char* nothing )
- Load a brain and its last state from a file.
-
int CommandCheck()
- Checks for any runtime commands and distributes them among all nodes.
-
int CommandParse( char* commandBuffer )
- Takes the command buffer and breaks it up into individual words (separated by spaces and/or tabs) and calls CommandExec on individual commands (seperated by semi-colon).
-
int CommandExec( vector<char* > &result )
- When a command is parsed, this function determines which other function to call that will perform the required action.
-
int CommandHebbian( vector<char*> &result )
- Changes the Hebbian learning mode of the specified Synapse Format SetHebbian <syanpse type> < NONE | BOTH | +HEBBIAN | -HEBBIAN >
-
int CommandExit( vector<char*> &result )
- User has requested the simulator to terminate.
-
int CommandStim( vector<char*> &result )
- User wants to add another start/end pair to an existing stimulus.
-
int CommandReport( vector<char*> &result )
- User wants to add another start/end pair to an existing report.
-
int CommandSave( vector<char*> &result )
- Port Command to instruct brain state to be written at current timestep.
-
FILE* setupPort()
- If this brain is to receive dynamic commands, the port based communication needs to be setup before the doThink loop gets underway.
Documentation
This is the core of the brain. It contains lists of the objects, such as
Cells, that the brain contains (which in turn may contain other lists of
their internal components). The code is basically a loop that runs
through the Stimulus, Cell, and Report lists every timestep, and calls
them to do whatever they do.
- int flag
- Simulation parameters parsed from the input file to control the simulation behavior
- double TotalTime
- total time to run the program - seconds - input from user
- int CycleCount
- Ticks to run. Note: TimeStep values must be int, since negative values are used as flags
- int TimeStep
- Current timestep of the DoThink loop
- int ReportTime
- Time to do Rich's status reports?
- int StartTime
- Actual time in seconds when the program started the main loop - not used
- int nCells
- Number of neurons on this node
- Cell** Cells
- List of pointers referencing all Cells on this node
- double* CellPosition[3]
- Cell Coordinates. Only used if synaptic distances turned on. Can be freed to save memory
- int nStimulus
- Number of stimulus objects currently defined
- Stimulus* StimList
- Linked list of Stimulus objects
- int nReports
- Number of report objects currently defined
- Report* RptList
- Linked List of Reports objects
- int nSynapseDef
- Number of Synapse Definitions
- SynapseDef** SynapseDefs
- List of pointers to Synapse Definitions
- bool SaveFlag
- If set to true, the state of all brain objects should be written to a file at end of timestep
- bool ResetFlag
- If set to true, the state of all brain objects should be read and reset based on file
- double SaveTime
- Automatically save brain state to file when it reaches this time
- char* SaveFile
- Name of file to save to when automatically saving
- int HostPort
- port for automatically connecting reports/stims/and the brain
- int Port
- port for receiving outside commands
- char* HostName
- hostname where this Brain will recv commands from
- int sd
- socket descriptor opened if taking runtime commands
- FILE* input
- FILE Pointer to use instead of sd
- char* pendingCommands
- Pointer to hold pending commands meant for later timesteps
- int pendingLength
- length of pendingCommands
- MPI_Comm commandComm
- Communicator for distributing runtime commands
- MPI_Group commandGroup
- Group for distributing runtime commands
- void Save(char* )
-
Save the current state of the brain to a file. Recursively saves data
from each subobject of the brain - cells, compartments, channels, etc.
does not save reports or stimulus; these will be defined new when the
brain is loaded.
- void LoadArrays( char* filename )
-
Restore data that was kept in the arrays structure. This should be done
first and separately, so that the data can be ready and available for
the rest of loading that will be done later.
- Parameters:
- filename - name of save file containing all ncs data
- void Load(char* filename, char* nothing )
-
Load a brain and its last state from a file. Recursively creates and loads data
into substructures - cells, compartments, channels, etc.
- Parameters:
- filename - name of save file containing all ncs data
nothing - character pointer to be used as a place holder, will eventually be removed when it is no longer needed
- int CommandCheck()
-
Checks for any runtime commands and distributes them among all nodes.
- Returns:
- integer to indicate result of command receipt and any subsequent execution
- int CommandParse( char* commandBuffer )
-
Takes the command buffer and breaks it up into individual words
(separated by spaces and/or tabs) and calls CommandExec on individual
commands (seperated by semi-colon). If commands meant for different
timesteps are read in at the same time, they will be separated by newlines.
- Parameters:
- commandBuffer - charater string containing the received command
- Returns:
- result code of the last executed command
- int CommandExec( vector<char* > &result )
-
When a command is parsed, this function determines which other
function to call that will perform the required action.
- Parameters:
- commandBuffer - charater string containing the received command
- Returns:
- result code of the executed command
- int CommandHebbian( vector<char*> &result )
-
Changes the Hebbian learning mode of the specified Synapse
Format
SetHebbian <syanpse type> < NONE | BOTH | +HEBBIAN | -HEBBIAN >
- Parameters:
- result - all words parsed from command buffer. Should contain information
to locate synapse and the new mode it should be set.
- Returns:
- 0 on success, -1 on failure
- int CommandExit( vector<char*> &result )
-
User has requested the simulator to terminate. All reports will be flushed and
closed and ncs will break out of the DoThink loop so that it can shut down properly. Hopefully.
- Parameters:
- result - all words parsed from command buffer. Not needed in this function, but passed for consistency
- Returns:
- integer value 15 to notify the DoThink loop it should call break.
- int CommandStim( vector<char*> &result )
-
User wants to add another start/end pair to an existing stimulus.
format:
APPENDSTIM [-flags] <stim type> <TStart> [TStop]
flags are optional, but must all be included as the second item. If no flags
are needed, then the stim type can go immediatly after the command. Currently
implemented flags include:
a : Automatic Time Stop. If this flag is specified, then the TStop argument
should not be sent because the stimulus will be made to last 2.5 milliseconds.
t : Timesteps will be sent. Instead of taking TStart (and TStop, if applicable ) and
multiplying by FSV, the values sent are used directly.
s : Seconds will be sent (default). After receiving TStart (and TStop, if applicable )
they will be multiplied by FSV to calculate the appropriate TimeStep.
Multiple stim types can be affected if desired by following the final parameter with
white space (i.e. space or tab) then another set of parameters.
ex. APPENDSTIM -a Stim1 3.4 Stim2 3.4
ex. APPENDSTIM -t Stim1 34000 35000 Stim2 34000 37000
- Parameters:
- result - all words parsed from command buffer. Should contain flags, name of
stimuli and start/end time pairs (in seconds by default)
- Returns:
- 0 on success, -1 on failure
- int CommandReport( vector<char*> &result )
-
User wants to add another start/end pair to an existing report.
format:
APPENDREPORT [-flags] <report type> <TStart> [TStop]
flags are optional, but must all be included as the second item. If no flags
are needed, then the stim type can go immediatly after the command. Currently
implemented flags include:
a : Automatic Time Stop. If this flag is specified, then the TStop argument
should not be sent because the report will be made to last 2.5 milliseconds.
t : Timesteps will be sent. Instead of taking TStart (and TStop, if applicable ) and
multiplying by FSV, the values sent are used directly.
s : Seconds will be sent (default). After receiving TStart (and TStop, if applicable )
they will be multiplied by FSV to calculate the appropriate TimeStep.
- Parameters:
- result - all words parsed from command buffer. Should contain flags, name of
report and start/end time pairs (in seconds)
- Returns:
- 0 on success, -1 on failure
- int CommandSave( vector<char*> &result )
-
Port Command to instruct brain state to be written at current timestep.
Format:
SAVE [filename]
filename is optional as long as a save file was given in the input file already.
When a filename is confirmed to exist, either in the command or from
the input file, the Save function is called.
- Parameters:
- result - all words parsed from command buffer. Should contain just "SAVE" and a filename if applicable
@result 0 on success, -1 on failure (i.e. no valid filename found)
- FILE* setupPort()
-
If this brain is to receive dynamic commands, the port based
communication needs to be setup before the doThink loop gets underway.
This function will setup that communication for either a specify host/port
or use a server's auto port capabilities if Port is -1.
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.