// tjhNeuron.java /** Implements an artificial neuron for a cell. The neuron controls how the cell will respond to the environment around it. This neuron model does not include internal state. */ public class tjhNeuron extends Object { //---------------------------------------------------------------------- // static constants //---------------------------------------------------------------------- /** The neuron has a fixed number of inputs */ public static final int N_INPUTS=4; //---------------------------------------------------------------------- // data //---------------------------------------------------------------------- /** The matrix controls how the inputs are transformed into the output. The output is the dot product of the input vector and the matrix */ protected int matrix[]; // each entry is -1, 0 or 1 //---------------------------------------------------------------------- // methods //---------------------------------------------------------------------- /** default constructor */ public tjhNeuron() { matrix = new int[N_INPUTS]; // initialize the matrix to zeros (no response, braindead) //for(int i=0;i1) output=1; else if(output<-1) output=-1; return output; } /** copies the specified neuron into this one */ public void Copy(tjhNeuron other) { for(int i=0;i