public class EEXIST
extends java.lang.Object
A series of methods and fields for simulating the behavior of an EEXIST system
Modifier and Type | Field and Description |
---|---|
static int |
Absolute
chemical values specify absolute coordinates
|
static int |
DST
index used to specify destination chemical
|
static int |
Relative
chemical values specify relative coordinates
|
static int |
SRC
index used to specify source chemical
|
Constructor and Description |
---|
EEXIST()
constructor with no arguments uses minX=0, maxX=40, dx=0.0625
|
EEXIST(double minX,
double maxX,
double dx)
main class for EEXIST system
|
Modifier and Type | Method and Description |
---|---|
void |
clearAllTubes()
zero-out all tubes.
|
double[][] |
getAllBiass()
read all bias levels
|
double[][] |
getAllTubes()
read all chemical levels
|
double |
getDx()
read (fixed) spatial increment (dx)
|
double |
getKarma()
returns the current karma of each transfer
|
double |
getMaxX()
read (fixed) maximum X value (tube n)
|
double |
getMinX()
read (fixed) minimum X value (tube 0)
|
int |
getTimeStep()
How many simulated time steps have passed since the last reset
|
double |
getTube(double x,
int SD)
read the amount of SRC or DST chemical in a tube
|
void |
loadIndividual(Individual indiv)
load an individual into the system
|
void |
localPaint()
Draw into buffered image, then display in main display window
Also update graphFrame (detail display)
|
int |
numTubes()
Return number of tubes
|
void |
proportionalFlow(boolean state)
Control whether flow rate is based on current chemical level
|
void |
releaseDisplay()
de-associate a display from an EEXIST.
|
void |
resetTimeStep()
Reset the internal timeclock to t=0
|
void |
saveDisplay(Display d)
associate a display with this EEXIST.
|
void |
setAllBiass(double[][] bias)
load all bias values from 2D array
|
void |
setAllDiameters(double[] diameters)
set all tube diameters from an array of values
|
void |
setAllTubes(double[][] mem)
load all SRC/DST values from 2-D array
|
void |
setBias(double xLoc,
int sd,
double biasVal)
set SRC/DST deltas (added to chemical levels to choose src/dst addresses)
|
void |
setBias(int tube,
int sd,
double biasVal)
set bias value for a given tube (integer index)
|
void |
setDiameter(double xLoc,
double diameter)
set diameter of a tube biasd on its spatial coordinates
|
void |
setDiameter(int tube,
double diameter)
set diameter of a single tube
|
void |
setDt(double dt)
Set timestep for simulation (default=0.05)
|
void |
setKarma(double karma)
Set karma (interlinking of cause and effect) of transfers.
|
void |
setTransferMode(int mode)
Set the mode for chemical transfers.
|
void |
setTube(double x,
int SD,
double value)
set a tube's contents
|
void |
setTube(int tube,
int SD,
double value)
set a tube's contents
|
void |
step(int steps)
advance the simulation a number of steps
|
public static int SRC
public static int DST
public static final int Absolute
public static final int Relative
public EEXIST()
public EEXIST(double minX, double maxX, double dx)
minX
- smallest bin numbermaxX
- largest bin numberdx
- spatial incrementpublic void proportionalFlow(boolean state)
state
- - set true to make flow rate proportional to current chemical levelpublic void setDt(double dt)
dt
- specifies the timesteppublic void setKarma(double karma)
karma
- is the spatial extent of the transfer's karmapublic double getKarma()
public void setAllDiameters(double[] diameters)
diameters
- array of tube diameters [0,binMax]public void setDiameter(int tube, double diameter)
tube
- integer tube number [0,binMax]diameter
- diameter to setpublic void setDiameter(double xLoc, double diameter)
xLoc
- X location of the tubediameter
- diameter to setpublic void setBias(int tube, int sd, double biasVal)
tube
- index of tube to setsd
- EEXIST.SRC or EEXIST.DSTbiasVal
- delta (default 0)public void setBias(double xLoc, int sd, double biasVal)
xLoc
- spatial location of tubesd
- EEXIST.SRC or SSXIST.DSTbiasVal
- delta (default 0)public void setAllBiass(double[][] bias)
bias
- 2-D array of bias values: [x][SRC/DST]public void setTransferMode(int mode)
mode
- specifies the type of transfers that take place. Options are:
EEXIST.Absolute - values are treated as absolute spatial coordinates
EEXIST.Relative - values are treated as displacements from the current location (+/-) This should be changed sometime to allow for negative displacements.
public void resetTimeStep()
public int getTimeStep()
public double getMinX()
public double getMaxX()
public double getDx()
public void saveDisplay(Display d)
d
- Display object to link to this EEXISTpublic void releaseDisplay()
public int numTubes()
public void loadIndividual(Individual indiv)
indiv
- the individual to load. indiv's contents will completely
replace the contents of the EEXIST system's tubespublic void setTube(int tube, int SD, double value)
tube
- tube's number (integer index)SD
- EEXIST.SRC or EEXIST.DSTvalue
- total amount of SRC or DST chemical to store in tubepublic void setTube(double x, int SD, double value)
x
- tube's x coordinateSD
- EEXIST.SRC or EEXIST.DSTvalue
- total amount of SRC or DST chemical to store in tubepublic void setAllTubes(double[][] mem)
mem
- array of values. [x][SRC/DST]public double getTube(double x, int SD)
x
- tube's x coordinateSD
- EEXIST.SRC or EEXIST.DSTpublic double[][] getAllTubes()
public double[][] getAllBiass()
public void clearAllTubes()
public void step(int steps)
steps
- number of timesteps (dt each)public void localPaint()