Package HAL.GridsAndAgents
Class SphericalAgent2D<A extends SphericalAgent2D,G extends AgentGrid2D<A>>
- java.lang.Object
-
- HAL.GridsAndAgents.AgentBase<T>
-
- HAL.GridsAndAgents.AgentBaseSpatial<T>
-
- HAL.GridsAndAgents.Agent2DBase<T>
-
- HAL.GridsAndAgents.AgentPT2D<G>
-
- HAL.GridsAndAgents.SphericalAgent2D<A,G>
-
- All Implemented Interfaces:
java.io.Serializable
public class SphericalAgent2D<A extends SphericalAgent2D,G extends AgentGrid2D<A>> extends AgentPT2D<G> implements java.io.Serializable
Spherical cow model of 2D cells- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SphericalAgent2D()
-
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 maxVelvoid
DefaultInit(double radius)
a default initialization function that sets the radius based on the argument, and the x and y velocities to 0A
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.<T extends SphericalAgent2D>
doubleSumForces(double interactionRad, AgentGrid2D<T> otherGrid, OverlapForceResponse2D<T> OverlapFun)
<T extends SphericalAgent2D>
doubleSumForces(double interactionRad, AgentGrid2D<T> otherGrid, OverlapForceResponse2D<T> OverlapFun, Rand resolvePerfectOverlap)
similar to the SumForces function above, but it can be used with other AgentGridsdouble
SumForces(double interactionRad, OverlapForceResponse2D<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.double
SumForces(double interactionRad, OverlapForceResponse2D<A> OverlapFun, Rand resolvePerfectOverlap)
<T extends SphericalAgent2D>
doubleSumForces(java.util.ArrayList<T> neighbors, java.util.ArrayList<double[]> displacementInfo, OverlapForceResponse2D<T> OverlapFun)
-
Methods inherited from class HAL.GridsAndAgents.AgentPT2D
Age, Dispose, MovePT, MoveSafePT, MoveSafePT, MoveSafeSQ, MoveSafeSQ, MoveSQ, MoveSQ, Xpt, Xsq, Ypt, Ysq
-
Methods inherited from class HAL.GridsAndAgents.Agent2DBase
DispX, DispY, Dist, DistSquared, MapEmptyHood, MapHood, MapHood, MapI, MapOccupiedHood, MapXpt, MapXsq, MapYpt, MapYsq
-
Methods inherited from class HAL.GridsAndAgents.AgentBaseSpatial
Isq
-
Methods inherited from class HAL.GridsAndAgents.AgentBase
BirthTick, IsAlive, SetBirthTick
-
-
-
-
Method Detail
-
DefaultInit
public void DefaultInit(double radius)
a default initialization function that sets the radius based on the argument, and the x and y velocities to 0
-
SumForces
public double SumForces(double interactionRad, OverlapForceResponse2D<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 double SumForces(double interactionRad, OverlapForceResponse2D<A> OverlapFun, Rand resolvePerfectOverlap)
-
SumForces
public <T extends SphericalAgent2D> double SumForces(java.util.ArrayList<T> neighbors, java.util.ArrayList<double[]> displacementInfo, OverlapForceResponse2D<T> OverlapFun)
-
SumForces
public <T extends SphericalAgent2D> double SumForces(double interactionRad, AgentGrid2D<T> otherGrid, OverlapForceResponse2D<T> OverlapFun)
-
SumForces
public <T extends SphericalAgent2D> double SumForces(double interactionRad, AgentGrid2D<T> otherGrid, OverlapForceResponse2D<T> OverlapFun, Rand resolvePerfectOverlap)
similar to the SumForces function above, but it can be used with other AgentGrids
-
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.
-
-