JACK 5.4 Application Interface

aos.jack.sim.run
Class Monitor

java.lang.Object
  extended byaos.jack.sim.run.Monitor

public class Monitor
extends java.lang.Object

This base class is used to control repeated iterations of the same simulation scenario within the same JACK Sim process and infrastructure. A derived class is usually created and initialised indirectly via a scenario definition file using the MonitorInit structure. Some of the contained methods should be overridden in the derived class in order to run your own code at the approprate times. Other methods are provided to return information regarding the control of scenario iterations.


Constructor Summary
Monitor()
           
 
Method Summary
 int getIterations()
          Returns the number of iterations that are scheduled to run.
 long getRandomSeed()
          This can be used to return the current seed.
 int getRunNumber()
          Returns the number of the current scenario iteration.
 void initRandomSeed(long val)
          This is automatically called when the Monitor object is created via the scenario definition file.
 boolean isForcedQuit()
          Used inside JACK Sim to check whether early termination has been requested.
 void notifyNextRun()
          Automatically called by JACK Sim after a scenario iteration finishes.
 void runAfter()
          Automatically called by JACK Sim after a scenario iteration finishes.
 void runBefore()
          Automatically called by JACK Sim before a scenario iteration begins.
 void runFirst()
          Automatically called by JACK Sim before the first scenario iteration begins.
 void runLast()
          Automatically called by JACK Sim after the last scenario iteration ends.
 void setForcedQuit(boolean val)
          This is called by Loader.stopCurrentRun() with a true value to set a flag that will cause the current scenario iteration to terminate prematurely.
 void setIterations(int num)
          Automatically called when the Monitor object is created via the scenario definition file.
 void setRunNumber(int num)
          Automatically called by JACK Sim to record the number of the next iteration when it is about to begin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Monitor

public Monitor()
Method Detail

initRandomSeed

public void initRandomSeed(long val)
This is automatically called when the Monitor object is created via the scenario definition file. Override this to call a customised method for initialising a sequence of random numbers.


getRandomSeed

public long getRandomSeed()
This can be used to return the current seed.


setIterations

public void setIterations(int num)
Automatically called when the Monitor object is created via the scenario definition file.


setRunNumber

public void setRunNumber(int num)
Automatically called by JACK Sim to record the number of the next iteration when it is about to begin.


getIterations

public int getIterations()
Returns the number of iterations that are scheduled to run.


getRunNumber

public int getRunNumber()
Returns the number of the current scenario iteration.


runFirst

public void runFirst()
Automatically called by JACK Sim before the first scenario iteration begins.


runLast

public void runLast()
Automatically called by JACK Sim after the last scenario iteration ends.


runBefore

public void runBefore()
Automatically called by JACK Sim before a scenario iteration begins. It simply prints an informative message to stderr and can be overriden.


runAfter

public void runAfter()
Automatically called by JACK Sim after a scenario iteration finishes. It simply prints an informative message to stderr and can be overriden.


notifyNextRun

public void notifyNextRun()
Automatically called by JACK Sim after a scenario iteration finishes. It updates the iteration number and then calls notifyAll() so that the monitor can be waited on for each iteration to finish.


setForcedQuit

public void setForcedQuit(boolean val)
This is called by Loader.stopCurrentRun() with a true value to set a flag that will cause the current scenario iteration to terminate prematurely. This is automatically called with a false value at the start of each scenario iteration.


isForcedQuit

public boolean isForcedQuit()
Used inside JACK Sim to check whether early termination has been requested.


JACK 5.4 Application Interface

Copyright (C) 1999-2008, Agent Oriented Software Pty. Ltd.

US Government Restricted Rights
The JACK Modules and relevant Software Material have been developed entirely at private expense and are accordingly provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of DFARS 252.227-7013 or subparagraph (c)(1) and (2) of the Commercial Computer Software Restricted Rights and 48 CFR 52.2270-19, as applicable.


Agent Oriented Software Pty. Ltd.     http://www.aosgrp.com
PO Box 639, Carlton South, Victoria 3053, Australia
Phone: +61 3 9349 5055, Fax: +61 3 9349 5088