Class RandomAlgorithm

    • Field Detail

      • wheelDistance

        protected final double wheelDistance
        Distance between the agent position and the center of the virtual wheel.
      • wheelRadius

        protected final double wheelRadius
        Radius of the virtual wheel.
      • maxWheelRotation

        protected final double maxWheelRotation
        Maximal rotation of the virtual wheel.
    • Constructor Detail

      • RandomAlgorithm

        public RandomAlgorithm​(double wheelDistance,
                               double wheelRadius,
                               double maxWheelRotation,
                               FacingMotionAlgorithm facing,
                               SeekingMotionAlgorithm seeking)
        Constructor.
        Parameters:
        wheelDistance - the distance between the agent position and the center of the virtual wheel.
        wheelRadius - the radius of the virtual wheel.
        maxWheelRotation - the maximal rotation of the virtual wheel.
        facing - the facing algorithm to delegate to.
        seeking - the seeking algorithm to delegate to.
    • Method Detail

      • equals

        @Pure
        public boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • hashCode

        @Pure
        public int hashCode()
        Overrides:
        hashCode in class Object
      • calculate

        public AgentMotion calculate​(Point2D<?,​?> position,
                                     Vector2D<?,​?> orientation,
                                     double linearSpeed,
                                     double maxLinear,
                                     double angularSpeed,
                                     double maxAngular)
        Description copied from interface: RandomMotionAlgorithm
        Calculate the random motion.
        Specified by:
        calculate in interface RandomMotionAlgorithm
        Parameters:
        position - is the current position of the entity.
        orientation - is the current orientation of the entity.
        linearSpeed - is the current linear speed of the entity.
        maxLinear - is the maximal linear speed or acceleration of the entity.
        angularSpeed - is the current angular speed of the entity.
        maxAngular - is the maximal angular speed or acceleration of the entity.
        Returns:
        the agent motion.