|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--neuroidnet.ntr.Network
Container for all Areas that hold Neuroids.
Classes extending this one should describe the network architecture and topology.
Various utility functions to be used from the BeanShell environment are
defined here. Implements Serializable so that instances of this class
(representing the run-time object of the network) can be stored and retrieved as
snapshots.
Area,
Neuroid,
Serialized Form| Field Summary | |
protected Vector |
areas
All Areas contained in Network. |
protected ConceptArea |
conceptArea
Redundant pointer to instance of the ConceptArea (it is also in areas) |
double |
deltaT
Increment of time for algorithms. |
(package private) boolean |
isConcurrent
Flag to mean multi thread usage. |
static NumberFormat |
numberFormat
For formatting real values |
protected Peripheral |
peripheral
Peripheral control device |
(package private) Simulation |
simulateAreas
Lock variable and thread controller for event dispatching to remote (or local) areas. |
(package private) Task |
stepArea
Defines what do to every step given Area object. |
(package private) Set |
watchList
|
| Constructor Summary | |
Network(double deltaT,
boolean isConcurrent)
Creates a new Network instance. |
|
| Method Summary | |
void |
addArea(Area area)
Adds an area to the network. |
void |
addWatch(Neuroid neuroid)
Sets the watch flag of the neuroid and includes in the list of watched entities. |
void |
addWatchAll(Set neuroidNames)
addWatchs all neuroids with names given in argument. |
void |
advanceTime(double msecs)
Simulate network for given duration starting from current state. |
protected abstract void |
build()
Describes the architecture of the network. |
void |
finale()
To be called after everthing else is done. |
Area |
getArea(String name)
Returns the Area object given the name. |
ConceptArea |
getConceptArea()
Get the value of conceptArea. |
Neuroid |
getNeuroid(Area area,
int neuroidId)
Returns the Neuroid object, given the area and id. |
Neuroid |
getNeuroid(NeuroidName neuroidName)
|
Neuroid |
getNeuroid(String areaName,
int neuroidId)
Returns the Neuroid object, given the area and id. |
Peripheral |
getPeripheral()
Get the value of peripheral. |
String |
getProperties()
Return detailed info about network components. |
String |
getStatus()
Adds time from conceptArea. |
Set |
getWatchList()
Get the value of watchList. |
void |
init()
Does nothing. |
private void |
readObject(ObjectInputStream in)
Method called when a serialized object is loaded. |
void |
run()
Build the network (USED TO: and run the simulation.) Calls build(). |
void |
setConceptArea(ConceptArea v)
Set the value of conceptArea. |
(package private) void |
setNumberFormatting()
Number formatting for text numberFormat |
void |
setPeripheral(Peripheral v)
Set the value of peripheral. |
void |
setWatchList(Set v)
Set the value of watchList. |
protected void |
simulation()
Deprecated. See advanceTime |
void |
step()
Updates the state of the Network. |
void |
stop()
Delegates the termination request to areas. |
String |
toString()
Return brief info about the network. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected final Vector areas
Areas contained in Network.
Areaprotected Peripheral peripheral
protected ConceptArea conceptArea
areas)
areas,
ConceptAreapublic double deltaT
public static NumberFormat numberFormat
Task stepArea
Task object that will run Area.step()
for all areas contained.
AreaIntvolatile Simulation simulateAreas
boolean isConcurrent
Set watchList
| Constructor Detail |
public Network(double deltaT,
boolean isConcurrent)
Network instance.
deltaT - a double value, time increments for each simulation step.isConcurrent - a boolean value, indicating if the network
should be simulated in distributed fashion.build(),
simulation()| Method Detail |
public ConceptArea getConceptArea()
public void setConceptArea(ConceptArea v)
v - Value to assign to conceptArea.public Peripheral getPeripheral()
public void setPeripheral(Peripheral v)
v - Value to assign to peripheral.public void addArea(Area area)
area - an Area valuepublic Set getWatchList()
public void setWatchList(Set v)
v - Value to assign to watchList.
public Area getArea(String name)
throws NameNotFoundException
Area object given the name.
Access method for observing network state.
getArea in interface DebuggerInterfacename - a String value
Area value
NameNotFoundException
public Neuroid getNeuroid(Area area,
int neuroidId)
Neuroid object, given the area and id.
Access method for observing network state.
getNeuroid in interface DebuggerInterfacearea - Area in which the neuroid resides.neuroidId - The id of neuroid in given area.
Neuroid valueNeuroid.id,
Area,
getNeuroid(String,int)
public Neuroid getNeuroid(String areaName,
int neuroidId)
throws NameNotFoundException
Neuroid object, given the area and id.
Access method for observing network state.
getNeuroid in interface DebuggerInterfaceareaName - Name of the Area in which the neuroid resides.neuroidId - The id of neuroid in given area.
Neuroid value
NameNotFoundExceptionNeuroid.id,
Area,
getNeuroid(Area,int)
public Neuroid getNeuroid(NeuroidName neuroidName)
throws NameNotFoundException
NameNotFoundExceptionpublic void addWatch(Neuroid neuroid)
addWatch in interface DebuggerInterfaceneuroid - a Neuroid value
public void addWatchAll(Set neuroidNames)
throws NameNotFoundException
addWatchs all neuroids with names given in argument.
addWatchAll in interface DebuggerInterfaceneuroidNames - a Set value
NameNotFoundExceptionaddWatch(Neuroid)public void init()
init in interface Simulationpublic void step()
Network.
Updates all Areas contained within.
TODO: Should be called from a thread with certain frequency.
TODO: parallel version should not have this.
step in interface SimulationAreapublic void stop()
stop in interface Simulationprotected abstract void build()
protected void simulation()
advanceTime(double)public String toString()
network.
toString in interface ExpressivetoString in class ObjectString valuepublic String getStatus()
conceptArea.
getStatus in interface ExpressiveString valueExpressive.toString()public String getProperties()
getProperties in interface ExpressiveString valueExpressive.getStatus()public void advanceTime(double msecs)
msecs - a double value to simulate this networkvoid setNumberFormatting()
numberFormat,
Network(double, boolean),
readObject(java.io.ObjectInputStream)public void run()
build(). Initializes network for parallel or
single-threaded execution.
TODO: Change this to build?
build(),
simulation()public void finale()
private void readObject(ObjectInputStream in)
throws IOException,
ClassNotFoundException
static numberFormat
object via a call to setNumberFormatting().
in - a java.io.ObjectInputStream value
IOException - if an error occurs
ClassNotFoundException - if an error occurs
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||