Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

SimulationManager Class Reference

#include <SimulationManager.h>

List of all members.

Signals

void simulationStartTimeChanged (unsigned int newSimStartTime)

Public Member Functions

void clearSimulationError ()
bool destroySimulation ()
void fireNeuron (unsigned int neuronGrpID, unsigned int neuronID)
bool getCleanUpError ()
QString getCleanUpErrorMsg ()
QString getInitErrorMsg ()
QString getSimulationErrorMsg ()
bool getViewWeightsSaved ()
bool getWeightsLoaded ()
bool getWeightsSaved ()
StartSimRes initialiseSimulation (QString archiveName, map< unsigned int, unsigned int > patternInputMap, map< unsigned int, unsigned int > deviceInOutMap, map< unsigned int, double >deviceFiringModeMap, map< const char *, unsigned int > paramMap)
void injectNoise (unsigned int neuronGrpID, int amount)
bool isRunning ()
bool loadWeights ()
void monitorNeuronGroup (unsigned int neuronGrpID, bool monitorType)
bool saveViewWeights ()
bool saveWeights ()
void setFrameRate (int fr)
bool setGlobalParameters ()
void setGraphicsLoading (bool gl)
void setMaxNeurDataLoadTime_sec (int mNeurData)
void setNetworkMonitors (map< unsigned int, NetworkMonitor * > nwMonitorMap)
void setNeuronMonitors (map< unsigned int, MonitorDataPlotter * > *neurMonMap)
bool setNeuronParameters ()
bool setNoiseParameters ()
void setSynapseMonitors (map< unsigned int *, MonitorDataPlotter *, synapseKeyCompare > *synMonMap)
bool setSynapseParameters ()
void setUpdateMode (bool, bool)
bool simulationError ()
 SimulationManager (DBInterface *networkDBInterface, DBInterface *archiveDBInterface, DBInterface *patternDBInterface, DBInterface *deviceDBInterface, QWidget *simulationWidget)
bool startNeuronMonitoring (unsigned int neuronGrpID, unsigned int neuronID, bool restart)
bool startRecording ()
bool startSimulation ()
bool startSynapseMonitoring (unsigned int neuronGrpID, unsigned int fromNeuronID, unsigned int toNeuronID, bool restart)
bool stepSimulation ()
void stopMonitoringNeuronGroup (unsigned int neuronGrpID, bool monitorType)
bool stopNeuronMonitoring (unsigned int neuronGrpID, unsigned int neuronID)
bool stopRecording ()
bool stopSimulation ()
bool stopSynapseMonitoring (unsigned int neurGrpID, unsigned int fromNeurID, unsigned int toNeurID)
 ~SimulationManager ()

Static Public Member Functions

static bool isInitialised ()

Protected Member Functions

void run ()

Private Member Functions

bool checkNeuronGroupTasks ()
void cleanUpErrorMsgReceived (int senderTID)
void cleanUpSimulation ()
bool createTempVirtualConnections ()
bool deleteTempVirtualConnections ()
void initErrorMsgReceived (int senderTID)
StartSimRes loadNeuronData (map< unsigned int, unsigned int > patternInputMap, map< unsigned int, unsigned int > deviceInOutMap, map< unsigned int, double >deviceFiringModeMap, map< const char *, unsigned int > paramMap, QProgressDialog *progressDialog)
SimulationManager operator= (const SimulationManager &)
bool sendMessage (int taskId, int msgtag, double[], int arrayLength)
bool sendMessage (int taskID, int msgtag, unsigned int msgData1, unsigned int msgData2)
bool sendMessage (int taskID, int msgtag, int msgData)
bool sendMessage (int taskID, int msgtag, unsigned int *, int arrayLength)
bool sendMessage (int taskID, int msgtag)
bool sendMessage_unsigned (int taskID, int msgtag, unsigned int msgData)
void showErrorMessage (const char *msg)
void showErrorMessage (int senderTID)
void showInformationMessage ()
 SimulationManager (const SimulationManager &)
bool spawnArchiveTask (const QString &archiveName, map< const char *, unsigned int >)
bool spawnNeuronGroupTasks ()
bool startPvm ()
void unpackMonitorNeuronData ()
void unpackMonitorNeuronInfo ()
void unpackMonitorSynapseData ()
void unpackMonitorSynapseInfo ()
void updateViewWeightsSavedState (int taskID)
void updateWeightsLoadedState (int taskID)
void updateWeightsSavedState (int taskID)

Private Attributes

DBInterface * archiveDBInterface
int archiveTaskID
BusyDialogbusyDialog
bool cleanUpError
QString cleanUpErrorMsg
DBInterface * deviceDBInterface
bool graphicsLoading
QString initErrorMsg
int maxNeurDataLoadTime_sec
DBInterface * networkDBInterface
map< int, NetworkMonitor * > networkMonitorMap
map< unsigned int, int > neuronGrpTaskMap
vector< int > neuronGrpTaskVector
map< unsigned int, MonitorDataPlotter * > * neuronMonitorMap
DBInterface * patternDBInterface
bool simError
QString simulationErrorMsg
bool simulationRunning
QWidget * simulationWidget
SpikeStreamApplicationspikeStrApp
map< unsigned int *, MonitorDataPlotter *,
synapseKeyCompare > * 
synapseMonitorMap
bool synapseWeightsLoaded
int thisTaskID
bool viewWeightsSaved
map< int, bool > viewWeightsSavedAcknowledgementMap
map< int, bool > weightsLoadedAcknowledgementMap
bool weightsSaved
map< int, bool > weightsSavedAcknowledgementMap

Static Private Attributes

static bool stop


Detailed Description

Initiates and controls the simulation using PVM.

Definition at line 56 of file SimulationManager.h.


Constructor & Destructor Documentation

SimulationManager::SimulationManager DBInterface *  netDBInter,
DBInterface *  archDBInter,
DBInterface *  pattDBInter,
DBInterface *  devDBInter,
QWidget *  simWidg
 

Constructor

Definition at line 52 of file SimulationManager.cpp.

References archiveDBInterface, busyDialog, deviceDBInterface, graphicsLoading, maxNeurDataLoadTime_sec, networkDBInterface, patternDBInterface, simulationRunning, simulationWidget, spikeStrApp, SpikeStreamMainWindow::spikeStreamApplication, and stop.

SimulationManager::~SimulationManager  ) 
 

Destructor Simulation should have been stopped by SpikeStremMainWindow before any deleting is done. Otherwise the networkDBInterface becomes unavailable for resetting the database.

Definition at line 86 of file SimulationManager.cpp.

SimulationManager::SimulationManager const SimulationManager  )  [private]
 

Declare copy constructor private so it cannot be used inadvertently.


Member Function Documentation

bool SimulationManager::checkNeuronGroupTasks  )  [private]
 

When all tasks have been spawned this method check that each task has entered its task id in the Neuron Group table.

Definition at line 824 of file SimulationManager.cpp.

References networkDBInterface, and neuronGrpTaskMap.

Referenced by initialiseSimulation().

void SimulationManager::cleanUpErrorMsgReceived int  senderTID  )  [private]
 

Unpacks an error message received during clean up, writes it to cerr and stores it for simulation widget to display.

Definition at line 858 of file SimulationManager.cpp.

References cleanUpError, and cleanUpErrorMsg.

Referenced by cleanUpSimulation().

void SimulationManager::cleanUpSimulation  )  [private]
 

Cleans up the simulation after it has exited from the run method.

Definition at line 884 of file SimulationManager.cpp.

References archiveTaskID, busyDialog, cleanUpError, cleanUpErrorMsg, cleanUpErrorMsgReceived(), deleteTempVirtualConnections(), networkDBInterface, neuronGrpTaskMap, neuronGrpTaskVector, sendMessage(), and showInformationMessage().

Referenced by initialiseSimulation(), and run().

void SimulationManager::clearSimulationError  ) 
 

Clears the record of a simulation error and resets the error message.

Definition at line 98 of file SimulationManager.cpp.

References simError, and simulationErrorMsg.

Referenced by SimulationWidget::checkSimManagerForErrors().

bool SimulationManager::createTempVirtualConnections  )  [private]
 

Looks through connection group table and creates a virtual connection in the opposite direction to every connection that is not reciprocal. This makes sure that all of the simulation groups send and receive a message at each simulation time step and thus keep in step.

Definition at line 1113 of file SimulationManager.cpp.

References deleteTempVirtualConnections(), and networkDBInterface.

Referenced by initialiseSimulation().

bool SimulationManager::deleteTempVirtualConnections  )  [private]
 

Deletes all the temporary virtual connections from the connection table.

Definition at line 1179 of file SimulationManager.cpp.

References networkDBInterface.

Referenced by cleanUpSimulation(), and createTempVirtualConnections().

bool SimulationManager::destroySimulation  ) 
 

Stops the simulation.

Definition at line 105 of file SimulationManager.cpp.

References busyDialog, BusyDialog::showDialog(), simulationRunning, and stop.

Referenced by SimulationWidget::initialiseButtonToggled(), and SpikeStreamMainWindow::~SpikeStreamMainWindow().

void SimulationManager::fireNeuron unsigned int  neuronGrpID,
unsigned int  neuronID
 

Fires a specified neuron by sending a message to the appropriate task.

Definition at line 120 of file SimulationManager.cpp.

References neuronGrpTaskMap, and sendMessage().

Referenced by SimulationWidget::fireNeuronButtonPressed().

bool SimulationManager::getCleanUpError  ) 
 

Returns whether there was an error generated during clean up of the simulation.

Definition at line 129 of file SimulationManager.cpp.

References cleanUpError.

Referenced by SimulationWidget::initialiseButtonToggled().

QString SimulationManager::getCleanUpErrorMsg  ) 
 

Returns a description of errors generated during clean up of the simulation.

Definition at line 135 of file SimulationManager.cpp.

References cleanUpErrorMsg.

Referenced by SimulationWidget::initialiseButtonToggled().

QString SimulationManager::getInitErrorMsg  ) 
 

Returns error messages generated during initialisation of the simulation.

Definition at line 141 of file SimulationManager.cpp.

References initErrorMsg.

Referenced by SimulationWidget::initialiseButtonToggled().

QString SimulationManager::getSimulationErrorMsg  ) 
 

Returns errors generated during the simulation run.

Definition at line 147 of file SimulationManager.cpp.

References simulationErrorMsg.

Referenced by SimulationWidget::checkSimManagerForErrors().

bool SimulationManager::getViewWeightsSaved  ) 
 

Returns true if the view weights have been saved.

Definition at line 153 of file SimulationManager.cpp.

References viewWeightsSaved.

Referenced by SimulationWidget::checkViewWeightsSaved().

bool SimulationManager::getWeightsLoaded  ) 
 

Returns true if the loading of weights is complete.

Definition at line 159 of file SimulationManager.cpp.

References synapseWeightsLoaded.

Referenced by SimulationWidget::checkWeightsLoadState().

bool SimulationManager::getWeightsSaved  ) 
 

Returns true if the weights have all been saved.

Definition at line 165 of file SimulationManager.cpp.

References weightsSaved.

Referenced by SimulationWidget::checkWeightsSaveState().

void SimulationManager::initErrorMsgReceived int  senderTID  )  [private]
 

Diplays and records error messages received during initialisation of the simulation.

Definition at line 1204 of file SimulationManager.cpp.

References initErrorMsg.

Referenced by loadNeuronData(), spawnArchiveTask(), and spawnNeuronGroupTasks().

StartSimRes SimulationManager::initialiseSimulation QString  archiveName,
map< unsigned int, unsigned int >  patternInputMap,
map< unsigned int, unsigned int >  deviceInOutMap,
map< unsigned int, double >  deviceFiringModeMap,
map< const char *, unsigned int >  parameterMap
 

Initialises the simulation

Definition at line 171 of file SimulationManager.cpp.

References archiveTaskID, StartSimRes::canceled, checkNeuronGroupTasks(), cleanUpSimulation(), createTempVirtualConnections(), initErrorMsg, loadNeuronData(), neuronGrpTaskMap, neuronGrpTaskVector, simError, simulationErrorMsg, simulationWidget, spawnArchiveTask(), spawnNeuronGroupTasks(), spikeStrApp, StartSimRes::started, startPvm(), stop, thisTaskID, and weightsSaved.

Referenced by SimulationWidget::initialiseButtonToggled().

void SimulationManager::injectNoise unsigned int  neuronGrpID,
int  amount
 

Injects an amount of noise into a neuron group.

Definition at line 312 of file SimulationManager.cpp.

References neuronGrpTaskMap, and sendMessage().

Referenced by SimulationWidget::injectNoiseButtonPressed().

bool SimulationManager::isInitialised  )  [static]
 

Static method used by other classes to query whether the simulation is initialised or not.

Definition at line 320 of file SimulationManager.cpp.

References stop.

Referenced by SpikeStreamMainWindow::clearDatabases(), SpikeStreamMainWindow::closeEvent(), LoadArchiveDialog::deleteAllButtonPressed(), SpikeStreamMainWindow::importConnectionMatrix(), SimulationWidget::initialiseButtonToggled(), LoadArchiveDialog::LoadArchiveDialog(), SpikeStreamMainWindow::loadDatabases(), monitorNeuronGroup(), setFrameRate(), setGlobalParameters(), setNeuronParameters(), setNoiseParameters(), setSynapseParameters(), stopMonitoringNeuronGroup(), and SpikeStreamMainWindow::~SpikeStreamMainWindow().

bool SimulationManager::isRunning  ) 
 

Returns true if the simulation is running.

Definition at line 328 of file SimulationManager.cpp.

References simulationRunning.

Referenced by SimulationWidget::simStopButtonPressed().

StartSimRes SimulationManager::loadNeuronData map< unsigned int, unsigned int >  patternInputMap,
map< unsigned int, unsigned int >  deviceInOutMap,
map< unsigned int, double >  deviceFiringModeMap,
map< const char *, unsigned int >  parameterMap,
QProgressDialog *  progressDialog
[private]
 

Instructs tasks to load up their data.

Definition at line 1233 of file SimulationManager.cpp.

References StartSimRes::canceled, initErrorMsg, initErrorMsgReceived(), maxNeurDataLoadTime_sec, neuronGrpTaskMap, neuronGrpTaskVector, sendMessage(), showInformationMessage(), spikeStrApp, and StartSimRes::started.

Referenced by initialiseSimulation().

bool SimulationManager::loadWeights  ) 
 

Instructs the tasks running neuron groups to reload their weights from the database. This task sends the reload weights instructions and then the run method is used to receive the confirmation messages, which set synapseWeightsSaved to true when they have all been received.

Definition at line 336 of file SimulationManager.cpp.

References neuronGrpTaskMap, sendMessage(), synapseWeightsLoaded, and weightsLoadedAcknowledgementMap.

Referenced by SimulationWidget::reloadWeightsButtonPressed().

void SimulationManager::monitorNeuronGroup unsigned int  neuronGrpID,
bool  monitorNeurons
 

Instructs the simulation manager to start monitoring a neuron group. This involves sending a message to the appropriate task. When the spike lists are received they are automatically passed to the appropriate network monitor.

Definition at line 362 of file SimulationManager.cpp.

References graphicsLoading, isInitialised(), neuronGrpTaskMap, and sendMessage().

Referenced by MonitorWindow::setMonitorType(), and MonitorWindow::windowVisibilityChanged().

SimulationManager SimulationManager::operator= const SimulationManager  )  [private]
 

Declare assignment private so it cannot be used inadvertently.

void SimulationManager::run  )  [protected]
 

Main run method.

Definition at line 712 of file SimulationManager.cpp.

References cleanUpSimulation(), networkMonitorMap, showErrorMessage(), showInformationMessage(), stop, thisTaskID, unpackMonitorNeuronData(), unpackMonitorNeuronInfo(), unpackMonitorSynapseData(), unpackMonitorSynapseInfo(), updateViewWeightsSavedState(), updateWeightsLoadedState(), and updateWeightsSavedState().

bool SimulationManager::saveViewWeights  ) 
 

Instructs the tasks to save a tempory copy of their weights to the database so that they can be easily viewed. This could also be done by requesting the weights from a neuron group, which would save database space, but would be more messy to implement

Definition at line 418 of file SimulationManager.cpp.

References neuronGrpTaskMap, sendMessage(), viewWeightsSaved, and viewWeightsSavedAcknowledgementMap.

Referenced by SimulationWidget::viewWeightsButtonPressed().

bool SimulationManager::saveWeights  ) 
 

Instructs the tasks running neuron groups to write their weights to the database. This task sends the save weights instructions and then the run method is used to receive the confirmation methods which set synapseWeightsSaved to true when they have all been received.

Definition at line 443 of file SimulationManager.cpp.

References neuronGrpTaskMap, sendMessage(), weightsSaved, and weightsSavedAcknowledgementMap.

Referenced by SimulationWidget::saveWeightsButtonPressed().

bool SimulationManager::sendMessage int  taskID,
int  msgtag,
double  doubleArray[],
int  arrayLength
[private]
 

Sends a message with an array of doubles .

Definition at line 1494 of file SimulationManager.cpp.

bool SimulationManager::sendMessage int  taskID,
int  msgtag,
unsigned int  msgData1,
unsigned int  msgData2
[private]
 

Sends a message containing two integers.

Definition at line 1430 of file SimulationManager.cpp.

bool SimulationManager::sendMessage int  taskID,
int  msgtag,
int  msgData
[private]
 

Sends a message containing a single integer.

Definition at line 1378 of file SimulationManager.cpp.

bool SimulationManager::sendMessage int  taskID,
int  msgtag,
unsigned int *  uIntArray,
int  arrayLength
[private]
 

Sends a message with an array of unsigned integers.

Definition at line 1461 of file SimulationManager.cpp.

bool SimulationManager::sendMessage int  taskID,
int  msgtag
[private]
 

Sends a message that does not contain data.

Definition at line 1362 of file SimulationManager.cpp.

Referenced by cleanUpSimulation(), fireNeuron(), injectNoise(), loadNeuronData(), loadWeights(), monitorNeuronGroup(), saveViewWeights(), saveWeights(), setFrameRate(), setGlobalParameters(), setNeuronParameters(), setNoiseParameters(), setSynapseParameters(), setUpdateMode(), startRecording(), startSimulation(), startSynapseMonitoring(), stepSimulation(), stopMonitoringNeuronGroup(), stopRecording(), stopSimulation(), and stopSynapseMonitoring().

bool SimulationManager::sendMessage_unsigned int  taskID,
int  msgtag,
unsigned int  msgData
[private]
 

Sends a message containing a single unsigned integer.

Definition at line 1404 of file SimulationManager.cpp.

Referenced by startNeuronMonitoring(), and stopNeuronMonitoring().

void SimulationManager::setFrameRate int  fr  ) 
 

Controls whether the simulation runs at less than its maximum speed This is done by instructing the tasks to sleep for the appropriate duration every time step.

Definition at line 468 of file SimulationManager.cpp.

References isInitialised(), neuronGrpTaskMap, sendMessage(), and showErrorMessage().

Referenced by SimulationWidget::frameRateComboChanged().

bool SimulationManager::setGlobalParameters  ) 
 

Sends a message to each task instructing it to load the global parameters.

Definition at line 488 of file SimulationManager.cpp.

References isInitialised(), neuronGrpTaskMap, and sendMessage().

Referenced by GlobalParametersDialog::applyButtonPressed(), and GlobalParametersDialog::okButtonPressed().

void SimulationManager::setGraphicsLoading bool  gl  ) 
 

Called at the end of initialisation to instruct this class that all graphics loading is complete.

Definition at line 505 of file SimulationManager.cpp.

References graphicsLoading.

Referenced by SimulationWidget::initialiseButtonToggled().

void SimulationManager::setMaxNeurDataLoadTime_sec int  mNeurDataLoadTime  ) 
 

Sets the maximum time that the simulation manager will wait for tasks to load their data.

Definition at line 512 of file SimulationManager.cpp.

References maxNeurDataLoadTime_sec.

Referenced by SpikeStreamMainWindow::SpikeStreamMainWindow().

void SimulationManager::setNetworkMonitors map< unsigned int, NetworkMonitor * >  nwMonMap  ) 
 

Passes a reference to the monitor area to enable the simulation manager to send spike messages to the network monitor for display. The incoming map references the network monitors by neuron group id, but need to store them by task id so that messages can be directly routed to them.

Definition at line 522 of file SimulationManager.cpp.

References networkMonitorMap, and neuronGrpTaskMap.

Referenced by MonitorArea::connectToManager().

void SimulationManager::setNeuronMonitors map< unsigned int, MonitorDataPlotter * > *  neurMonMap  ) 
 

Passes a reference to the neuron monitor map to enable the simulation manager to pass data to the neuron monitors. Only pass a reference because the contents of the map are changed each time the simulation starts.

Definition at line 533 of file SimulationManager.cpp.

References neuronMonitorMap.

Referenced by SimulationWidget::SimulationWidget().

bool SimulationManager::setNeuronParameters  ) 
 

Send message to each task instructing it to load its parameters.

Definition at line 539 of file SimulationManager.cpp.

References isInitialised(), neuronGrpTaskMap, and sendMessage().

Referenced by NeuronParametersDialog::applyButtonPressed(), and NeuronParametersDialog::okButtonPressed().

bool SimulationManager::setNoiseParameters  ) 
 

Instructs each task to load its noise parameters from the database.

Definition at line 554 of file SimulationManager.cpp.

References isInitialised(), neuronGrpTaskMap, and sendMessage().

Referenced by NoiseParametersDialog::applyButtonPressed(), and NoiseParametersDialog::okButtonPressed().

void SimulationManager::setSynapseMonitors map< unsigned int *, MonitorDataPlotter *, synapseKeyCompare > *  synMonMap  ) 
 

Passes a reference to the neuron monitor map to enable the simulation manager to pass data to the neuron monitors. Only pass a reference because the contents of the map are changed each time the simulation starts.

Definition at line 571 of file SimulationManager.cpp.

References synapseMonitorMap.

Referenced by SimulationWidget::SimulationWidget().

bool SimulationManager::setSynapseParameters  ) 
 

Sends a message to each task instructing it to load its synapse parameters.

Definition at line 577 of file SimulationManager.cpp.

References isInitialised(), neuronGrpTaskMap, and sendMessage().

Referenced by SynapseParametersDialog::applyButtonPressed(), and SynapseParametersDialog::okButtonPressed().

void SimulationManager::setUpdateMode bool  updateNeurons,
bool  updateSynapses
 

Sets the update mode for the simulation. Most efficient is event-driven, but may want to update the neuron or synapse classes every time step to simulate spontaneous behaviour.

Definition at line 594 of file SimulationManager.cpp.

References neuronGrpTaskMap, sendMessage(), and showErrorMessage().

Referenced by SimulationWidget::simModeComboChanged().

void SimulationManager::showErrorMessage const char *  msg  )  [private]
 

Called from within this class when an error has been generated. Only the first error message is recorded to prevent a large number of duplicates.

Definition at line 1555 of file SimulationManager.cpp.

References simError, and simulationErrorMsg.

void SimulationManager::showErrorMessage int  senderTID  )  [private]
 

Unpacks an error message, writes it to cerr and records that an error message has been received. Only the first error message is recorded to prevent a large number of duplicates.

Definition at line 1522 of file SimulationManager.cpp.

References simError, and simulationErrorMsg.

Referenced by run(), setFrameRate(), setUpdateMode(), unpackMonitorNeuronData(), unpackMonitorNeuronInfo(), unpackMonitorSynapseData(), and unpackMonitorSynapseInfo().

void SimulationManager::showInformationMessage  )  [private]
 

Unpacks an information message and writes it to system out.

Definition at line 1572 of file SimulationManager.cpp.

Referenced by cleanUpSimulation(), loadNeuronData(), and run().

bool SimulationManager::simulationError  ) 
 

Returns true if there has been an error in the simulation.

Definition at line 615 of file SimulationManager.cpp.

References simError.

Referenced by SimulationWidget::checkSimManagerForErrors(), SimulationWidget::checkViewWeightsSaved(), SimulationWidget::checkWeightsLoadState(), and SimulationWidget::checkWeightsSaveState().

void SimulationManager::simulationStartTimeChanged unsigned int  newSimStartTime  )  [signal]
 

Referenced by spawnArchiveTask().

bool SimulationManager::spawnArchiveTask const QString &  archiveName,
map< const char *, unsigned int >  parameterMap
[private]
 

Spawns the archive task with the information it needs.

Definition at line 1591 of file SimulationManager.cpp.

References archiveDBInterface, archiveTaskID, initErrorMsgReceived(), networkDBInterface, and simulationStartTimeChanged().

Referenced by initialiseSimulation().

bool SimulationManager::spawnNeuronGroupTasks  )  [private]
 

Spawn task to simulate neuron group. Pass database information to tasks in the form of arguments, rather than managing separate config files. Each spawned task writes its task id to the database, which acts as a check that they have all successfully established database communication.

Definition at line 1733 of file SimulationManager.cpp.

References deviceDBInterface, initErrorMsgReceived(), networkDBInterface, neuronGrpTaskMap, neuronGrpTaskVector, and patternDBInterface.

Referenced by initialiseSimulation().

bool SimulationManager::startNeuronMonitoring unsigned int  neuronGrpID,
unsigned int  neuronID,
bool  restart
 

Sends a message to a neuron group requesting an XML file containing information about the variables that are to be monitored in the neuron. Different neuron implementations have different variables, so need to get this information each time.

Definition at line 376 of file SimulationManager.cpp.

References neuronGrpTaskMap, and sendMessage_unsigned().

Referenced by SimulationWidget::monitorNeuronButtonPressed().

bool SimulationManager::startPvm  )  [private]
 

Starts pvm daemon if it is not already running.

Definition at line 1867 of file SimulationManager.cpp.

References thisTaskID.

Referenced by initialiseSimulation().

bool SimulationManager::startRecording  ) 
 

Sends a message to the archiver instructing it to start recording.

Definition at line 621 of file SimulationManager.cpp.

References archiveTaskID, and sendMessage().

Referenced by SimulationWidget::recordButtonToggled().

bool SimulationManager::startSimulation  ) 
 

Sends a message to all tasks instructing them to start sending spike messages.

Definition at line 630 of file SimulationManager.cpp.

References neuronGrpTaskMap, sendMessage(), simulationRunning, and weightsSaved.

Referenced by SimulationWidget::simStartButtonToggled().

bool SimulationManager::startSynapseMonitoring unsigned int  neuronGrpID,
unsigned int  fromNeuronID,
unsigned int  toNeuronID,
bool  restart
 

Sends a message to a neuron group requesting an XML file containing information about the variables that are to be monitored in the neuron. Different neuron implementations have different variables, so need to get this information each time.

Definition at line 390 of file SimulationManager.cpp.

References neuronGrpTaskMap, and sendMessage().

Referenced by SimulationWidget::monitorSynapseButtonPressed().

bool SimulationManager::stepSimulation  ) 
 

Sends messages instructing simulation to advance one step and then stop.

Definition at line 650 of file SimulationManager.cpp.

References neuronGrpTaskMap, sendMessage(), simulationRunning, and weightsSaved.

Referenced by SimulationWidget::simStepButtonPressed().

void SimulationManager::stopMonitoringNeuronGroup unsigned int  neuronGrpID,
bool  monitorNeurons
 

Stops monitoring a neuron group.

Definition at line 669 of file SimulationManager.cpp.

References graphicsLoading, isInitialised(), neuronGrpTaskMap, and sendMessage().

Referenced by MonitorWindow::setMonitorType(), and MonitorWindow::windowVisibilityChanged().

bool SimulationManager::stopNeuronMonitoring unsigned int  neuronGrpID,
unsigned int  neuronID
 

Sends a message to a neuron group instructing it to stop sending neuron data messages.

Definition at line 402 of file SimulationManager.cpp.

References neuronGrpTaskMap, and sendMessage_unsigned().

bool SimulationManager::stopRecording  ) 
 

Sends a message to the archiver instructing it to stop recording spike patterns.

Definition at line 681 of file SimulationManager.cpp.

References archiveTaskID, and sendMessage().

Referenced by SimulationWidget::initialiseButtonToggled(), and SimulationWidget::recordButtonToggled().

bool SimulationManager::stopSimulation  ) 
 

Sends a message to all tasks instructing them to stop sending spike messages.

Definition at line 690 of file SimulationManager.cpp.

References neuronGrpTaskMap, sendMessage(), and simulationRunning.

Referenced by SimulationWidget::simStopButtonPressed().

bool SimulationManager::stopSynapseMonitoring unsigned int  neuronGrpID,
unsigned int  fromNeuronID,
unsigned int  toNeuronID
 

Sends a message to a neuron group instructing it to stop sending neuron data messages.

Definition at line 409 of file SimulationManager.cpp.

References neuronGrpTaskMap, and sendMessage().

void SimulationManager::unpackMonitorNeuronData  )  [private]
 

Unpacks monitoring data sent from a neuron class.

Definition at line 1902 of file SimulationManager.cpp.

References neuronMonitorMap, and showErrorMessage().

Referenced by run().

void SimulationManager::unpackMonitorNeuronInfo  )  [private]
 

Unpacks XML structured information about monitoring data sent from a neuron class.

Definition at line 1955 of file SimulationManager.cpp.

References neuronMonitorMap, and showErrorMessage().

Referenced by run().

void SimulationManager::unpackMonitorSynapseData  )  [private]
 

Unpacks monitoring data sent from a synapse class.

Definition at line 1995 of file SimulationManager.cpp.

References showErrorMessage(), and synapseMonitorMap.

Referenced by run().

void SimulationManager::unpackMonitorSynapseInfo  )  [private]
 

Unpacks XML structured information about monitoring data sent from a synapse class.

Definition at line 2062 of file SimulationManager.cpp.

References showErrorMessage(), and synapseMonitorMap.

Referenced by run().

void SimulationManager::updateViewWeightsSavedState int  taskID  )  [private]
 

Records a message from a task to indicate that its view weights have been saved.

Definition at line 2113 of file SimulationManager.cpp.

References viewWeightsSaved, and viewWeightsSavedAcknowledgementMap.

Referenced by run().

void SimulationManager::updateWeightsLoadedState int  taskID  )  [private]
 

Records a message from a task to indicate that its weights have been loaded.

Definition at line 2121 of file SimulationManager.cpp.

References synapseWeightsLoaded, and weightsLoadedAcknowledgementMap.

Referenced by run().

void SimulationManager::updateWeightsSavedState int  taskID  )  [private]
 

Records a message from a task to indicate that its weights have been saved.

Definition at line 2129 of file SimulationManager.cpp.

References weightsSaved, and weightsSavedAcknowledgementMap.

Referenced by run().


Member Data Documentation

DBInterface* SimulationManager::archiveDBInterface [private]
 

Definition at line 120 of file SimulationManager.h.

Referenced by SimulationManager(), and spawnArchiveTask().

int SimulationManager::archiveTaskID [private]
 

Task id of archive.

Definition at line 131 of file SimulationManager.h.

Referenced by cleanUpSimulation(), initialiseSimulation(), spawnArchiveTask(), startRecording(), and stopRecording().

BusyDialog* SimulationManager::busyDialog [private]
 

Dialog shown to indicate a process taking place whose duration is not known.

Definition at line 185 of file SimulationManager.h.

Referenced by cleanUpSimulation(), destroySimulation(), and SimulationManager().

bool SimulationManager::cleanUpError [private]
 

Records whether an error was generated during the cleaning up of a simulation.

Definition at line 148 of file SimulationManager.h.

Referenced by cleanUpErrorMsgReceived(), cleanUpSimulation(), and getCleanUpError().

QString SimulationManager::cleanUpErrorMsg [private]
 

Error messages generated during simulation clean up.

Definition at line 151 of file SimulationManager.h.

Referenced by cleanUpErrorMsgReceived(), cleanUpSimulation(), and getCleanUpErrorMsg().

DBInterface* SimulationManager::deviceDBInterface [private]
 

Definition at line 122 of file SimulationManager.h.

Referenced by SimulationManager(), and spawnNeuronGroupTasks().

bool SimulationManager::graphicsLoading [private]
 

Records when the graphics is loading to avoid sending stray messages.

Definition at line 189 of file SimulationManager.h.

Referenced by monitorNeuronGroup(), setGraphicsLoading(), SimulationManager(), and stopMonitoringNeuronGroup().

QString SimulationManager::initErrorMsg [private]
 

Error messages generated during simulation initialisation.

Definition at line 154 of file SimulationManager.h.

Referenced by getInitErrorMsg(), initErrorMsgReceived(), initialiseSimulation(), and loadNeuronData().

int SimulationManager::maxNeurDataLoadTime_sec [private]
 

The amount of time the simulation manager will wait for tasks to load their neuron data This variable is set in the config file.

Definition at line 199 of file SimulationManager.h.

Referenced by loadNeuronData(), setMaxNeurDataLoadTime_sec(), and SimulationManager().

DBInterface* SimulationManager::networkDBInterface [private]
 

Definition at line 119 of file SimulationManager.h.

Referenced by checkNeuronGroupTasks(), cleanUpSimulation(), createTempVirtualConnections(), deleteTempVirtualConnections(), SimulationManager(), spawnArchiveTask(), and spawnNeuronGroupTasks().

map<int, NetworkMonitor*> SimulationManager::networkMonitorMap [private]
 

Links tasks to network monitors that are running in this process The key is the taskID.

Definition at line 139 of file SimulationManager.h.

Referenced by run(), and setNetworkMonitors().

map<unsigned int, int> SimulationManager::neuronGrpTaskMap [private]
 

Records which task is processing which neuron group The key is the neuron group ID, the data is the task ID.

Definition at line 135 of file SimulationManager.h.

Referenced by checkNeuronGroupTasks(), cleanUpSimulation(), fireNeuron(), initialiseSimulation(), injectNoise(), loadNeuronData(), loadWeights(), monitorNeuronGroup(), saveViewWeights(), saveWeights(), setFrameRate(), setGlobalParameters(), setNetworkMonitors(), setNeuronParameters(), setNoiseParameters(), setSynapseParameters(), setUpdateMode(), spawnNeuronGroupTasks(), startNeuronMonitoring(), startSimulation(), startSynapseMonitoring(), stepSimulation(), stopMonitoringNeuronGroup(), stopNeuronMonitoring(), stopSimulation(), and stopSynapseMonitoring().

vector<int> SimulationManager::neuronGrpTaskVector [private]
 

Complete list of all the tasks that are processing neuron groups.

Definition at line 142 of file SimulationManager.h.

Referenced by cleanUpSimulation(), initialiseSimulation(), loadNeuronData(), and spawnNeuronGroupTasks().

map<unsigned int, MonitorDataPlotter*>* SimulationManager::neuronMonitorMap [private]
 

Pointer to the map holding the neuron monitors.

Definition at line 192 of file SimulationManager.h.

Referenced by setNeuronMonitors(), unpackMonitorNeuronData(), and unpackMonitorNeuronInfo().

DBInterface* SimulationManager::patternDBInterface [private]
 

Definition at line 121 of file SimulationManager.h.

Referenced by SimulationManager(), and spawnNeuronGroupTasks().

bool SimulationManager::simError [private]
 

Records whether there have been errors during the running of the simulation.

Definition at line 157 of file SimulationManager.h.

Referenced by clearSimulationError(), initialiseSimulation(), showErrorMessage(), and simulationError().

QString SimulationManager::simulationErrorMsg [private]
 

Stores error messages generated during a simulation run.

Definition at line 160 of file SimulationManager.h.

Referenced by clearSimulationError(), getSimulationErrorMsg(), initialiseSimulation(), and showErrorMessage().

bool SimulationManager::simulationRunning [private]
 

Records whether the simulation manager is in its run loop.

Definition at line 163 of file SimulationManager.h.

Referenced by destroySimulation(), isRunning(), SimulationManager(), startSimulation(), stepSimulation(), and stopSimulation().

QWidget* SimulationManager::simulationWidget [private]
 

Reference to SimulationWidget stored as QWidget to avoid include problems.

Definition at line 125 of file SimulationManager.h.

Referenced by initialiseSimulation(), and SimulationManager().

SpikeStreamApplication* SimulationManager::spikeStrApp [private]
 

Short version of the reference to the main QApplication.

Definition at line 128 of file SimulationManager.h.

Referenced by initialiseSimulation(), loadNeuronData(), and SimulationManager().

bool SimulationManager::stop [static, private]
 

Used to control run loop. Made static so that isInitialised() can be static.

Definition at line 145 of file SimulationManager.h.

Referenced by destroySimulation(), initialiseSimulation(), isInitialised(), run(), and SimulationManager().

map<unsigned int*, MonitorDataPlotter*, synapseKeyCompare>* SimulationManager::synapseMonitorMap [private]
 

Pointer to the map holding the synapse monitors.

Definition at line 195 of file SimulationManager.h.

Referenced by setSynapseMonitors(), unpackMonitorSynapseData(), and unpackMonitorSynapseInfo().

bool SimulationManager::synapseWeightsLoaded [private]
 

Used to keep track of whether weights have been reloaded or not.

Definition at line 179 of file SimulationManager.h.

Referenced by getWeightsLoaded(), loadWeights(), and updateWeightsLoadedState().

int SimulationManager::thisTaskID [private]
 

The task id of the SpikeStream Application.

Definition at line 116 of file SimulationManager.h.

Referenced by initialiseSimulation(), run(), and startPvm().

bool SimulationManager::viewWeightsSaved [private]
 

Used to keep track of whether weights have been saved to TempWeight for viewing.

Definition at line 173 of file SimulationManager.h.

Referenced by getViewWeightsSaved(), saveViewWeights(), and updateViewWeightsSavedState().

map<int, bool> SimulationManager::viewWeightsSavedAcknowledgementMap [private]
 

Used to record confirmtion messages about view weights being saved.

Definition at line 176 of file SimulationManager.h.

Referenced by saveViewWeights(), and updateViewWeightsSavedState().

map<int, bool> SimulationManager::weightsLoadedAcknowledgementMap [private]
 

Used to record confirmtion messages about weights being reloaded.

Definition at line 182 of file SimulationManager.h.

Referenced by loadWeights(), and updateWeightsLoadedState().

bool SimulationManager::weightsSaved [private]
 

Used to keep track of whether weights have been saved or not.

Definition at line 166 of file SimulationManager.h.

Referenced by getWeightsSaved(), initialiseSimulation(), saveWeights(), startSimulation(), stepSimulation(), and updateWeightsSavedState().

map<int, bool> SimulationManager::weightsSavedAcknowledgementMap [private]
 

Used to record confirmtion messages about weights being saved.

Definition at line 169 of file SimulationManager.h.

Referenced by saveWeights(), and updateWeightsSavedState().


The documentation for this class was generated from the following files:
Generated on Mon Sep 3 22:29:05 2007 for SpikeStream Application by  doxygen 1.4.4