nns
Class NNS

java.lang.Object
  extended by java.lang.Thread
      extended by biocell.BioThread
          extended by nns.NNS
All Implemented Interfaces:
BioDeviceListener, java.lang.Runnable, MNSListener, BioSensorListener

public class NNS
extends BioThread
implements BioSensorListener, MNSListener

Author:
Martin Lukac This is the main class of a single robot Sensory system This part acts in a similar wway to the Spine - Cerebellum portion of the CNS. This is also the bifurcation of the information where the sensor stimulus will be either directly executed and/or sent in parallel to the brain system. Theoretically tese two operations should be always executed in parallel but in that case the inhibition of of prospective reflexes by the brain might be difficult to achieve. Thus using switches and variablles one can indicates to the NNS where the given signal should go.

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
NNS(BioSensorListener listener)
          Default Constructor this assusres now a order of different devices.
 
Method Summary
 void addListener(BioSensorListener listener)
           
 void addnnsModule(BioSensor sensor)
           
 void addnnsModule(MNSListener actuator)
           
 void bioEvent(BioDeviceEvent bdE)
           
 void energyConsumed(EnergyPrimitive ep)
           
 java.util.Vector getListener()
           
 int[] getMotState()
           
 BioSensor getSensor(java.lang.String key)
           
 java.util.Vector getSensors()
           
 boolean isEnabled()
           
static void main(java.lang.String[] args)
           
 void process(MNSEvent mnEvent)
          loads a CNSEvent into a listener
 void run()
          Methods to control and communicate with the robot - only upward stream
 void sensorCRLPercieved(BioSensorEvent event)
           
 void sensorPercieved(BioSensorEvent evt)
           
 void setEnabled(boolean enabled)
           
 void setListener(BioSensorListener listener)
           
 void setMotState(int[] motstates)
           
 void setSensors(java.util.Vector nnsModules)
           
 void test()
           
 
Methods inherited from class biocell.BioThread
getCurrentmood, getMoodParam, getstate, setMood, stepEnergy
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NNS

public NNS(BioSensorListener listener)
Default Constructor this assusres now a order of different devices. This has to be imporved in order to allow a bigger freedom of commands

Method Detail

process

public void process(MNSEvent mnEvent)
Description copied from interface: MNSListener
loads a CNSEvent into a listener

Specified by:
process in interface MNSListener

sensorCRLPercieved

public void sensorCRLPercieved(BioSensorEvent event)
Specified by:
sensorCRLPercieved in interface BioSensorListener
Parameters:
event - - must be overriden to allow CRL parsed commands

sensorPercieved

public void sensorPercieved(BioSensorEvent evt)
Specified by:
sensorPercieved in interface BioSensorListener
Parameters:
evt - - must be overriden to provide command access

getMotState

public int[] getMotState()
Returns:
the array of states of the motor system of the robot

setMotState

public void setMotState(int[] motstates)

addnnsModule

public void addnnsModule(BioSensor sensor)
Parameters:
sensor -

addnnsModule

public void addnnsModule(MNSListener actuator)
Parameters:
actuator -

getListener

public java.util.Vector getListener()
Returns:
Returns the listener.

setListener

public void setListener(BioSensorListener listener)
Parameters:
listener - The listener to set.

addListener

public void addListener(BioSensorListener listener)
Parameters:
listener - The listener to set.

getSensors

public java.util.Vector getSensors()
Returns:
Returns the sensors.

getSensor

public BioSensor getSensor(java.lang.String key)
Returns:
Returns the sensors.

setSensors

public void setSensors(java.util.Vector nnsModules)
Parameters:
sensors - The sensors to set.

run

public void run()
Methods to control and communicate with the robot - only upward stream

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

test

public void test()

main

public static void main(java.lang.String[] args)

isEnabled

public boolean isEnabled()
Returns:
Returns the enabled.

setEnabled

public void setEnabled(boolean enabled)
Parameters:
enabled - The enabled to set.

bioEvent

public void bioEvent(BioDeviceEvent bdE)
Specified by:
bioEvent in interface BioDeviceListener

energyConsumed

public void energyConsumed(EnergyPrimitive ep)