2.5 Numerical Simulation



The numerical simulation was originally written in FORTRAN and published by R.J. MacGregor in Neural and Brain Modeling by Academic Press in New York in 1987. Dr. K.R. Subramanian, Professor of Computer Science at the University of North Carolina at Charlotte converted it to C. Later he added some data storage structures (to be described later) so the entire simulation could be executed once and recorded for future playback. In a ddition to small portions of the code in C++ some functions have been incorperated to traverse the storage structures and retrieve the data for the desired time steps.

The simulation is encapsulated into a single C++ object of type smcSim (spinal motor circuit simulation). Rather than mechanically describing the object's design, I will walk through the life of the object.

When the user selects a data file (and it is verified), any current smcSim object pointed to by smcSimMain is destroyed. The destructor makes the call to Discard_ActiveNeurons(ActiveNeurons *) which frees all of the space allocated for the recording data structure. The name of the file is then passed as the single parameter in the call new smcSim(filename). The constructor, by the same name, is invoked.

The constructor initializes the Framing variable with the values of the starting and ending time steps for the recording. These values are currently set statically but the next version, already in development, will allow for the values to be set interactively in a dialog box at the time the file is selected. The OpenFile member function then opens the data file name passed as a parameter. ReadInput member function reads the file and then the object wide member variables are initialized. Initialize_ActiveNeurons initializes the data structures to be used for the recording. Simulate is called to run the actual simulation and store the values in the data structures. Finally Framing.time_step is set to the value Framing.start_frame-1 so the first step displayed will be the first recorded step. The constructor returns and the callback function updates the time step widget with the value in Framing.start_frame. (The value is retrieved with a utility function so the variable may remain private to the object.)

The rest of the member functions of smcSim are public utility functions used to retrieve and set the values of the private member variables with the exception of smcSim::updateTimeStep(). UpdateTimeStep is the only member function to access an external variable. By design it updates the coordinate values for the meshes in treeLeaves (the global data structure that represents the Inventor scene graph) with the values in the private recording data structures of the object.

The data structure developed by Dr. Subramanian holds the results of the entire simulation and is of the following form:

Where activeNeurons is an array as long as the simulation.

Back to the Table of Contents
Next Section ->