Class SphericalAgent3D<A extends SphericalAgent3D,​G extends AgentGrid3D<A>>

  • All Implemented Interfaces:

    public class SphericalAgent3D<A extends SphericalAgent3D,​G extends AgentGrid3D<A>>
    extends AgentPT3D<G>
    Spherical cow model of 3D cells
    See Also:
    Serialized Form
    • Field Detail

      • radius

        public double radius
      • xVel

        public double xVel
      • yVel

        public double yVel
      • zVel

        public double zVel
    • Constructor Detail

      • SphericalAgent3D

        public SphericalAgent3D()
    • 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​(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.
      • Divide

        public A Divide​(double divRadius,
                        Rand rn)