Package HAL.GridsAndAgents
Class SphericalAgent3D<A extends SphericalAgent3D,G extends AgentGrid3D<A>>
- java.lang.Object
-
- HAL.GridsAndAgents.AgentBase<T>
-
- HAL.GridsAndAgents.AgentBaseSpatial<T>
-
- HAL.GridsAndAgents.Agent3DBase<T>
-
- HAL.GridsAndAgents.AgentPT3D<G>
-
- HAL.GridsAndAgents.SphericalAgent3D<A,G>
-
- All Implemented Interfaces:
java.io.Serializable
public class SphericalAgent3D<A extends SphericalAgent3D,G extends AgentGrid3D<A>> extends AgentPT3D<G> implements java.io.Serializable
Spherical cow model of 3D cells- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SphericalAgent3D()
-
Method Summary
Modifier and Type Method Description void
ApplyFriction(double frictionConst)
mulitplies xVel and yVel by frictionConst.void
CapVelocity(double maxVel)
caps the xVel and yVel variables such that their norm is not greater than maxVelA
Divide(double divRadius, double[] scratchCoordArr, Rand rn)
Facilitiates modeling cell division.A
Divide(double divRadius, Rand rn)
void
ForceMove()
adds xVel and yVel property values to the x,y position of the agent.void
Init(double radius)
<T extends SphericalAgent3D>
doubleSumForces(double interactionRad, AgentGrid3D<T> otherGrid, OverlapForceResponse3D<T> OverlapFun)
similar to the SumForces function above, but it can be used with other AgentGridsdouble
SumForces(double interactionRad, OverlapForceResponse3D<A> OverlapFun)
The interactionRad argument is a double that specifies how far apart to check for other agent centers to interact with, and should be set to the maximum distance apart that two interacting agent centers can be.<T extends SphericalAgent3D>
doubleSumForces(java.util.ArrayList<T> neighbors, java.util.ArrayList<double[]> displacementInfo, OverlapForceResponse3D<T> OverlapFun)
-
Methods inherited from class HAL.GridsAndAgents.AgentPT3D
Age, Dispose, MovePT, MoveSafePT, MoveSafePT, MoveSafeSQ, MoveSafeSQ, MoveSQ, MoveSQ, Xpt, Xsq, Ypt, Ysq, Zpt, Zsq
-
Methods inherited from class HAL.GridsAndAgents.Agent3DBase
DispX, DispY, DispZ, Dist, DistSquared, MapEmptyHood, MapHood, MapHood, MapI, MapOccupiedHood, MapXpt, MapXsq, MapYpt, MapYsq, MapZpt, MapZsq
-
Methods inherited from class HAL.GridsAndAgents.AgentBaseSpatial
Isq
-
Methods inherited from class HAL.GridsAndAgents.AgentBase
BirthTick, IsAlive, SetBirthTick
-
-
-
-
Method Detail
-
Init
public void Init(double radius)
-
SumForces
public double SumForces(double interactionRad, OverlapForceResponse3D<A> OverlapFun)
The interactionRad argument is a double that specifies how far apart to check for other agent centers to interact with, and should be set to the maximum distance apart that two interacting agent centers can be. the OverlapForceResponse argument must be a function that takes in an overlap and an agent, and returns a force response. aka. (double,Agent) -> double. the double argument is the extent of the overlap. if this value is positive, then the two agents are “overlapping” by the distance specified. if the value is negative, then the two agents are separated by the distance specified. the OverlapForceResponse should return a double which indicates the force to apply to the agent as a result of the overlap. if the force is positive, it will repel the agent away from the overlap direction, if it is negative it will pull it towards that direction. SumForces alters the xVel and yVel properites of the agent by calling OverlapForceResponse using every other agent within the interactionRad.
-
SumForces
public <T extends SphericalAgent3D> double SumForces(double interactionRad, AgentGrid3D<T> otherGrid, OverlapForceResponse3D<T> OverlapFun)
similar to the SumForces function above, but it can be used with other AgentGrids
-
SumForces
public <T extends SphericalAgent3D> double SumForces(java.util.ArrayList<T> neighbors, java.util.ArrayList<double[]> displacementInfo, OverlapForceResponse3D<T> OverlapFun)
-
ApplyFriction
public void ApplyFriction(double frictionConst)
mulitplies xVel and yVel by frictionConst. if frictionConst = 1, then no friction force will be applied, if frictionConst = 0, then the cell won't move.
-
CapVelocity
public void CapVelocity(double maxVel)
caps the xVel and yVel variables such that their norm is not greater than maxVel
-
ForceMove
public void ForceMove()
adds xVel and yVel property values to the x,y position of the agent.
-
Divide
public A Divide(double divRadius, double[] scratchCoordArr, Rand rn)
Facilitiates modeling cell division. The divRadius specifies how far apart from the center of the parent agent the daughters should be separated. the scratchCoordArr will store the randomly calculated axis of division. The axis is calculated using the Rand argument (HAL's random number generator object) if no Rand argument is provided, the values currently in the scratchCoordArr will be used to determine the axis of division. The first entry of scratchCoordArr is the x component of the axis, the second entry is the y component. division is achieved by placing the newly generated daughter cell divRadius away from the parent cell using divCoordArr for the x and y components of the direction, and placing the parent divRadius away in the negative direction. Divide returns the newly created daughter cell.
-
-