net.eduvax.grant.simul
Class TestA

java.lang.Object
  extended by net.eduvax.grant.simul.Test
      extended by net.eduvax.grant.simul.TestA
All Implemented Interfaces:
java.lang.Runnable, NodeClient, NodeFactory

public class TestA
extends Test
implements NodeFactory, NodeClient

1st test suite : local nodes and jobs got from standard input.


Field Summary
static int DELAY_HIGH
          high delay for "low nodes".
static int DELAY_LOW
          best nodes.
static int DELAY_MEDIUM
          medium nodes.
static int L1COUNT
          level 1 node count.
static int L2COUNT
          level 2 node count.
private  int load
          load.
private  int nodeLoadCost
          node load cost.
private  java.util.Hashtable nodes
          all nodes.
private  int nodeType
          node type.
private  Node root
          root node.
private  java.util.Vector terminalNodes
          terminal nodes.
 
Fields inherited from class net.eduvax.grant.simul.Test
input
 
Constructor Summary
TestA()
           
 
Method Summary
 Node createNode(java.lang.String name)
          create a node according type number defined for this test.
 void execReport(ExecReport report)
          trace tasklet execution.
private  Node getBestNode()
          get the lowest loaded terminal node.
 void init()
          init test.
 void routeReport(ExecRequest request)
          trace tasklet scheduling.
 void run()
          Test A implementation : reads input stream, 2 number per line. 1st is test tasklet delay, 2nd is pause before next tasklet launch.
 void setArgs(java.util.Collection c)
          set test arguments.
protected  void trace(java.lang.String msg)
          trace a message.
 void traceNodes()
          trace all nodes state.
 
Methods inherited from class net.eduvax.grant.simul.Test
main
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

L1COUNT

public static final int L1COUNT
level 1 node count.

See Also:
Constant Field Values

L2COUNT

public static final int L2COUNT
level 2 node count.

See Also:
Constant Field Values

DELAY_HIGH

public static final int DELAY_HIGH
high delay for "low nodes".

See Also:
Constant Field Values

DELAY_MEDIUM

public static final int DELAY_MEDIUM
medium nodes.

See Also:
Constant Field Values

DELAY_LOW

public static final int DELAY_LOW
best nodes.

See Also:
Constant Field Values

nodes

private java.util.Hashtable nodes
all nodes.


terminalNodes

private java.util.Vector terminalNodes
terminal nodes.


root

private Node root
root node.


load

private int load
load.


nodeType

private int nodeType
node type.


nodeLoadCost

private int nodeLoadCost
node load cost.

Constructor Detail

TestA

public TestA()
Method Detail

init

public void init()
init test. create nodes.

Overrides:
init in class Test

traceNodes

public void traceNodes()
trace all nodes state.


setArgs

public void setArgs(java.util.Collection c)
set test arguments. Should have only one : node type number.

Overrides:
setArgs in class Test
Parameters:
c - test arguments

createNode

public Node createNode(java.lang.String name)
create a node according type number defined for this test. All created nodes for one test are same type, one of following :

Specified by:
createNode in interface NodeFactory
Parameters:
name - new node's name.
Returns:
new node.

run

public void run()
Test A implementation : reads input stream, 2 number per line. 1st is test tasklet delay, 2nd is pause before next tasklet launch.

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

routeReport

public void routeReport(ExecRequest request)
trace tasklet scheduling.

Parameters:
request - scheduled request.

execReport

public void execReport(ExecReport report)
trace tasklet execution.

Specified by:
execReport in interface NodeClient
Parameters:
report - task completion report

getBestNode

private Node getBestNode()
get the lowest loaded terminal node.


trace

protected void trace(java.lang.String msg)
trace a message.

Parameters:
msg - message to trace.