etomica.nbr
Class CriterionSimple

java.lang.Object
  extended by etomica.nbr.CriterionSimple
All Implemented Interfaces:
AtomLeafAgentManager.AgentSource, NeighborCriterion, Serializable

public class CriterionSimple
extends Object
implements NeighborCriterion, AtomLeafAgentManager.AgentSource, Serializable

Simple neighbor criterion based on distance moved by a leaf atom since the last update.

See Also:
Serialized Form

Field Summary
protected  AtomLeafAgentManager agentManager
           
protected  IBoundary boundary
           
protected  BoxAgentManager boxAgentManager
           
protected  double displacementLimit2
           
protected  IVectorMutable dr
           
protected  double interactionRange
           
protected  double neighborRadius2
           
protected  double r2
           
protected  double r2MaxSafe
           
protected  double safetyFactor
           
protected  ISpace space
           
 
Constructor Summary
CriterionSimple(ISimulation sim, ISpace _space, double interactionRange, double neighborRadius)
           
 
Method Summary
 boolean accept(IAtomList pair)
           
 Class getAgentClass()
          Returns the Class of the agent.
 double getInteractionRange()
           
 Dimension getInteractionRangeDimension()
           
 double getNeighborRange()
           
 Dimension getNeighborRangeDimension()
           
 double getSafetyFactor()
           
 Object makeAgent(IAtom atom)
          Returns an agent for the given Atom.
 boolean needUpdate(IAtom atom)
          Indicates whether the neighbor list for the given atom should be updated, according to this criterion.
 void releaseAgent(Object agent, IAtom atom)
          This informs the agent source that the agent is going away and that the agent source should disconnect the agent from other elements
 void reset(IAtom atom)
          Indicates to criterion that given atom's neighbor list has just been updated, and that properties (e.g., record of atom's position) used by needUpdate and unsafe() methods should be reset.
 void setBox(IBox box)
          Specifies the box where the criterion is being applied.
 void setInteractionRange(double newInteractionRange)
           
 void setNeighborRange(double r)
           
 void setSafetyFactor(double f)
           
 boolean unsafe()
          Indicates whether the atom has changed (e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

space

protected final ISpace space

interactionRange

protected double interactionRange

displacementLimit2

protected double displacementLimit2

neighborRadius2

protected double neighborRadius2

dr

protected final IVectorMutable dr

boundary

protected IBoundary boundary

safetyFactor

protected double safetyFactor

r2

protected double r2

r2MaxSafe

protected double r2MaxSafe

agentManager

protected AtomLeafAgentManager agentManager

boxAgentManager

protected final BoxAgentManager boxAgentManager
Constructor Detail

CriterionSimple

public CriterionSimple(ISimulation sim,
                       ISpace _space,
                       double interactionRange,
                       double neighborRadius)
Method Detail

setSafetyFactor

public void setSafetyFactor(double f)

getSafetyFactor

public double getSafetyFactor()

setNeighborRange

public void setNeighborRange(double r)

getNeighborRange

public double getNeighborRange()

getNeighborRangeDimension

public Dimension getNeighborRangeDimension()

setInteractionRange

public void setInteractionRange(double newInteractionRange)

getInteractionRange

public double getInteractionRange()

getInteractionRangeDimension

public Dimension getInteractionRangeDimension()

needUpdate

public boolean needUpdate(IAtom atom)
Description copied from interface: NeighborCriterion
Indicates whether the neighbor list for the given atom should be updated, according to this criterion.

Specified by:
needUpdate in interface NeighborCriterion
Returns:
true if the atom's list should be updated.

setBox

public void setBox(IBox box)
Description copied from interface: NeighborCriterion
Specifies the box where the criterion is being applied. Sometimes needed if the criterion depends on features of the box, such as the boundary.

Specified by:
setBox in interface NeighborCriterion

unsafe

public boolean unsafe()
Description copied from interface: NeighborCriterion
Indicates whether the atom has changed (e.g. moved) by an amount that might have caused its neighbor list to be invalid. If this method returns true, a neighbor list failure may have introduced errors in the calculation.

Specified by:
unsafe in interface NeighborCriterion

accept

public boolean accept(IAtomList pair)
Specified by:
accept in interface NeighborCriterion

reset

public void reset(IAtom atom)
Description copied from interface: NeighborCriterion
Indicates to criterion that given atom's neighbor list has just been updated, and that properties (e.g., record of atom's position) used by needUpdate and unsafe() methods should be reset.

Specified by:
reset in interface NeighborCriterion

getAgentClass

public Class getAgentClass()
Description copied from interface: AtomLeafAgentManager.AgentSource
Returns the Class of the agent. This is used to create an array of the appropriate Class.

Specified by:
getAgentClass in interface AtomLeafAgentManager.AgentSource

makeAgent

public Object makeAgent(IAtom atom)
Description copied from interface: AtomLeafAgentManager.AgentSource
Returns an agent for the given Atom.

Specified by:
makeAgent in interface AtomLeafAgentManager.AgentSource

releaseAgent

public void releaseAgent(Object agent,
                         IAtom atom)
Description copied from interface: AtomLeafAgentManager.AgentSource
This informs the agent source that the agent is going away and that the agent source should disconnect the agent from other elements

Specified by:
releaseAgent in interface AtomLeafAgentManager.AgentSource