package model; /** *

Title:DOG_Cell.java

*

Description: The DOG Model of a Center-Surround Receptive Field

*

Copyright: Copyright (c) 2009

*

Company: Hanover College

* @author John H. Krantz, Ph.D. * @version 0.5 */ //import java.awt.*; //import javax.swing.*; // Model Imports import model.compute.NormalEq; public class DOG_Cell { // cell parameters private double sdE = 2; // Std. deviation of Excitatory area private double sdI = 6; // Std. Deviation of Inhibitory area private double eFactor = 1; // factor to change the // balance of excitation to inhibition in a center-surround // cell. if 1, e=i in a full field stimulation so no output // if > 1 there there will be some excitation in a full // field stimulation. // a column of cells private int cellDim = (int)(sdI*3); private double [][] cell = new double[cellDim][cellDim]; // computational objects private NormalEq excit = new NormalEq(); private NormalEq inhib = new NormalEq(); public DOG_Cell() { setupCell(); } public DOG_Cell(double sd_E, double sd_I){ sdE = (sd_E > 0 ? sd_E : sdE); sdI = (sd_I > 0 & sd_I != sdE ? sd_E : sdI); setupCell(); } // set methods /** * Set the width of the bar of the simple cell * @param double w width of bar in standard deviation */ public void setCellParameters(double sd_E, double sd_I){ sdE = (sd_E > 0 ? sd_E : sdE); sdI = (sd_I > 0 & sd_I != sd_E ? sd_I : sdI); setupCell(); } /** * Set the relative balance of excitation to inhibition. * If eVal = 1, then excitation and inhibition are balanced * in fill-field stimulation, 0 output. If eVal > 1, * there there will be excitation in the full-field * stimulation. * @param double eVal the relative weight of excitation. */ public void setExcitFactor(double eVal){ eFactor = (eVal >= 1.0 ? eVal : eFactor); } public void setupCell(){ cellDim = (int)sdI; if (sdE > sdI) cellDim = (int)sdE; cell = new double[3*cellDim+1][3*cellDim+1]; double ctr = cellDim+cellDim/2+1.0; excit.setCtr(ctr,ctr); inhib.setCtr(ctr,ctr); excit.setStdDev(sdE); inhib.setStdDev(sdI); for (double x = 0; x < cell.length; x ++){ for (double y = 0; y < cell[0].length; y ++){ // the sdI/sdE weighting takes care of the // different sizes of the two distributions cell[(int)x][(int)y] = eFactor*(sdI/sdE)* excit.getNormal2D(x,y)-inhib.getNormal2D(x,y); } } } // get methods public double [][] getCell() { return cell; } public double getExcitWidth() { return sdE; } public double getInhibWidth() { return sdI; } public double getExcitFactor() { return eFactor; } }