Machine Problem 4, due Apr 4

Part of the homework for CS:2820, Fall 2015
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

Write a Java program, in file NeuronNetwork.java that can read the description of a neuron network from a file called f (presuming that this file exists) when you type the following command to run your program:

[HawkID@serv15 project]$ java NeuronNetwork f

When your program is run, it should either:

here is an example description (an extended version of the format used for MP3). This simple neuron network contains a clock that ticks periodically until a second neuron (responsible for counting the ticks) turns off the clock, causing activity in the network to terminate.

neuron CLOCK 10.0 11.0
synapse TICK CLOCK CLOCK 1.0 11.0

neuron COUNT 10.0 0.0
synapse - CLOCK COUNT 0.5 7.0
synapse - COUNT TICK  0.4 -0.6

Syntactically, there are two types of synapse, unnamed synapses and named ones. Synapse TICK above is a named synapse connecting neuron CLOCK back to itself. Unnamed synapses have a single dash in the name field. Neuron and synapse names be non-numeric, and each name may be defined only once.

Any synapse that is named may be the target of a secondary synapse. The synapse COUNT TICK above is a secondary synapse that connects neuron COUNT to (primary) synapse TICK. Logically (but not necessarily in your simulation), primary and secondary synapses are two distinct subclasses of synapse.

As before, the first number in the description of a neuron is its threshold, while the second number is its voltage at time zero.

As before, the first number in the description of a synapse is the delay, the second number is the strength. Delays may not be negative. Strengths are of either sign.

The simulation should implement the following model:

(This model leaves out a huge number of features of real neurons, but those features only add complexity to the details of events, they don't alter the structure of the simulation program. For example: In real life, the strength of a synapse is reduced each time it fires, and then the strength rebounds asymptotically towards its resting strength as the synapse recovers from firing. Another detail that could differ from neuron to neuron is the time constant of the delay.)

The output should show one line of text for each synapse that fires giving the time, the synapse name (actual name, if it has one, as well as source-destination), and the voltage of the destination neuron before and after the firing.

In addition, the output should show one line whenver a neuron fires, giving the time, the name of that neuron and saying that it fired.

An appropriate output from the simulation of the above model would begin something like the following and continue for several more time units before terminating:

0.0 neuron CLOCK
0.5 synapse - CLOCK COUNT 0.0 7.0
1.0 synapse TICK CLOCK CLOCK 0.0 11.0
1.0 neuron CLOCK

Grading criteria will be as usual: No credit will be given to programs that do not represent a substantial attempt at meeting the requirements of this assignment. Your program must:

Note that the requirements for header comments in the file header are absolute. Your name must appear in the form that it appears on your ID card. The TAs will not waste their time doing detective work to attempt to figure out who submitted what code.

Submission: Your solution should consist of a single file, with one public method, main. (Later, we will chop the file into smaller more managable pieces, as it grows.)

To submit your solution, make sure it is in a file called NeuronNetwork.java (this requires that the main method be in a class called NeuronNetwork. This must be in the current directory. Then, follow the following dialogue with the Linux shell (what you type is given in boldface):

[HawkID@serv16 ~/project]$ submit NeuronNetwork.java
Course (22C:016 would be c_016): CS2820
Possible submit directories for /group/submit/CS2820 are:

The dialogue continues as in MP1, except that the submit directory for this assignment will be named mp4 instead of mp1