etomica.action
Class AtomActionRandomizeVelocity

java.lang.Object
  extended by etomica.action.AtomActionRandomizeVelocity
All Implemented Interfaces:
AtomAction, Serializable

public class AtomActionRandomizeVelocity
extends Object
implements AtomAction, Serializable

Action that sets the velocity vector of a given atom to a randomly chosen value sampled from a Boltzmann distribution.

See Also:
Serialized Form

Field Summary
protected  IRandom random
           
 
Constructor Summary
AtomActionRandomizeVelocity(double temperature, IRandom random)
          Constructs class to assign velocities according to the given temperature.
 
Method Summary
 void actionPerformed(IAtom a)
          Assigns velocity to atom with components selected from a Maxwell-Boltzmann distribution with temperature most recently set for the action.
 double getTemperature()
           
 void setTemperature(double temperature)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

random

protected final IRandom random
Constructor Detail

AtomActionRandomizeVelocity

public AtomActionRandomizeVelocity(double temperature,
                                   IRandom random)
Constructs class to assign velocities according to the given temperature. May be subsequently changed with setTemperature method.

Method Detail

actionPerformed

public void actionPerformed(IAtom a)
Assigns velocity to atom with components selected from a Maxwell-Boltzmann distribution with temperature most recently set for the action. If atom mass is infinite, assigns a zero velocity.

Specified by:
actionPerformed in interface AtomAction

getTemperature

public double getTemperature()
Returns:
Returns the Boltzmann-distribution temperature used to sample the new velocity. Default value is that from Default class.

setTemperature

public void setTemperature(double temperature)
Parameters:
temperature - The temperature to set.