net.sourceforge.cilib.problem.boundaryconstraint
Class DeflectionBoundaryConstraint

java.lang.Object
  extended by net.sourceforge.cilib.problem.boundaryconstraint.DeflectionBoundaryConstraint
All Implemented Interfaces:
Serializable, BoundaryConstraint, Cloneable

public class DeflectionBoundaryConstraint
extends Object
implements BoundaryConstraint

Particles that overstep the boundary get re-initialised to simulate a bouncing effect by flipping the velocity (multiplying it with -1.0).

Author:
Wiehann Matthysen
See Also:
Serialized Form

Constructor Summary
DeflectionBoundaryConstraint()
          Create a new instance.
DeflectionBoundaryConstraint(DeflectionBoundaryConstraint copy)
          Create a copy of the provided instance.
 
Method Summary
 void enforce(Entity entity)
          Enforce the defined boundary constraint on the provided Entity.
 BoundaryConstraint getClone()
          
 ControlParameter getVelocityDampingFactor()
          Get the current velocity dampening factor.
 void setVelocityDampingFactor(ControlParameter velocityDampingFactor)
          Set the control parameter to be used for the velocity damping factor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeflectionBoundaryConstraint

public DeflectionBoundaryConstraint()
Create a new instance. The velocityDampingFactor defaults to a value of -1.0.


DeflectionBoundaryConstraint

public DeflectionBoundaryConstraint(DeflectionBoundaryConstraint copy)
Create a copy of the provided instance.

Parameters:
copy - The instance to copy.
Method Detail

getClone

public BoundaryConstraint getClone()

Specified by:
getClone in interface BoundaryConstraint
Specified by:
getClone in interface Cloneable
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

enforce

public void enforce(Entity entity)
Enforce the defined boundary constraint on the provided Entity.

Specified by:
enforce in interface BoundaryConstraint
Parameters:
entity - The Entity with which the boundary is to be enforced.

getVelocityDampingFactor

public ControlParameter getVelocityDampingFactor()
Get the current velocity dampening factor.

Returns:
The ControlParameter representing the parameter.

setVelocityDampingFactor

public void setVelocityDampingFactor(ControlParameter velocityDampingFactor)
Set the control parameter to be used for the velocity damping factor.

Parameters:
velocityDampingFactor - The ControlParameter to set.


Copyright © 2009 CIRG. All Rights Reserved.