etomica.action.activity
Class ActivityIntegrate

java.lang.Object
  extended by etomica.action.Activity
      extended by etomica.action.activity.ActivityIntegrate
All Implemented Interfaces:
IAction, Serializable

public class ActivityIntegrate
extends Activity

Activity that repeatedly invokes an Integrator's doStep method.

See Also:
Serialized Form

Field Summary
protected  long maxSteps
           
protected  long stepCount
           
 
Fields inherited from class etomica.action.Activity
haltRequested, isActive, pauseRequested
 
Constructor Summary
ActivityIntegrate(IIntegrator integrator)
          Constructs activity to generate configurations with the given integrator (which is final).
ActivityIntegrate(IIntegrator integrator, int sleepPeriod, boolean ignoreOverlap)
           
 
Method Summary
 long getCurrentStep()
           
 IIntegrator getIntegrator()
           
 long getMaxSteps()
          Accessor method for the number of doStep calls to be performed by this integrator after it is started.
 int getSleepPeriod()
          Amount of time that thread is kept in sleep state after each doStep done on integrator.
protected  void run()
          Main loop for conduct of integration.
 void setMaxSteps(long maxSteps)
          Mutator method for the number of doStep steps to be performed by this integrator after it is started.
 void setSleepPeriod(int sleepPeriod)
          Sets amount of time that thread is kept in sleep state after each doStep done on integrator.
 
Methods inherited from class etomica.action.Activity
actionPerformed, doContinue, doWait, halt, isActive, isPaused, pause, unPause
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxSteps

protected long maxSteps

stepCount

protected long stepCount
Constructor Detail

ActivityIntegrate

public ActivityIntegrate(IIntegrator integrator)
Constructs activity to generate configurations with the given integrator (which is final). Defaults include interval = 1, doSleep given by Default class, and sleepPeriod = 10.


ActivityIntegrate

public ActivityIntegrate(IIntegrator integrator,
                         int sleepPeriod,
                         boolean ignoreOverlap)
Method Detail

run

protected void run()
Main loop for conduct of integration. Repeatedly calls doStep() method, while checking for halt/pause/reset requests, firing regular interval events, and entering a brief sleep state if so indicated by doSleep flag. Integration loop continues until number of steps equals maxSteps field. This method should not be called directly, but instead is called by the instance's actionPerformed method.

Specified by:
run in class Activity

getSleepPeriod

public int getSleepPeriod()
Amount of time that thread is kept in sleep state after each doStep done on integrator. If doSleep is false, this no sleep is performed and this parameter has no effect.

Returns:
sleep period, in milliseconds.

setSleepPeriod

public void setSleepPeriod(int sleepPeriod)
Sets amount of time that thread is kept in sleep state after each doStep done on integrator. Default value is 0.


getMaxSteps

public long getMaxSteps()
Accessor method for the number of doStep calls to be performed by this integrator after it is started.


setMaxSteps

public void setMaxSteps(long maxSteps)
Mutator method for the number of doStep steps to be performed by this integrator after it is started. Can be changed while activity is running; if set to a value less than number of steps already executed, integration will end.


getCurrentStep

public long getCurrentStep()

getIntegrator

public IIntegrator getIntegrator()
Returns:
Returns the integrator.