|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
cgl.narada.topology.viewer.Simulation
public class Simulation
This class helps simulating the actual system where node addresses would come from some port.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
boolean |
addOrDelete
|
List |
nodeArray
|
Random |
numberGenerator1
|
Random |
numberGenerator2
|
static String |
ssl
|
static String |
tcp
|
static String |
udp
|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
Simulation(NodeManagement nm,
Screen sc)
Only constructor that makes use of common NodeManagement
and Screen objects (by TopologyViewer) |
|
| Method Summary | |
|---|---|
void |
addLink()
Randomly selects nodes (some logic is applied so that nodes in same super-super cluster are selected, to show high clustering) and insert a single link of one of the available types |
void |
addNode()
Generates a random node address and invokes NodeManagement's method to add the nodes. |
void |
deleteLink()
Deletes a existing link, for simplicity in this simulation all the existing links between pair are deleted. |
void |
deleteNode()
From the stored local array of nodes, select one of the nodes for deletion and invokes NodeManagement's method. |
String |
getNode()
Gets a node address from existing node array. |
void |
manageLinks()
Depending upon the random number, either adds a link or deletes a link in the system. |
void |
manageNodes()
Depending upon the random number, either adds a node or deletes a node in the system. |
void |
run()
Overrides run() of the Thread class. |
| 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 |
| Field Detail |
|---|
public static String tcp
public static String udp
public static String ssl
public List nodeArray
public Random numberGenerator1
public Random numberGenerator2
public boolean addOrDelete
| Constructor Detail |
|---|
public Simulation(NodeManagement nm,
Screen sc)
NodeManagement
and Screen objects (by TopologyViewer)
| Method Detail |
|---|
public void run()
Thread class.
run in interface Runnablerun in class Threadpublic void manageNodes()
public void manageLinks()
public void addNode()
public void deleteNode()
public void addLink()
public void deleteLink()
public String getNode()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||