Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# Tools/PotentialFields/RandomMotionGenerator.h

Go to the documentation of this file.

    00001 /**
    00002 * @file RandomMotionGenerator.h
    00003 *
    00004 * Definition of class RandomMotionGenerator
    00005 *
    00006 * @author <a href="mailto:timlaue@informatik.uni-bremen.de">Tim Laue</a>
    00007 */
    00008
    00009 #ifndef RANDOM_MOTION_GENERATOR_H_
    00010 #define RANDOM_MOTION_GENERATOR_H_
    00011
    00012
    00013 #include "PfieldDatatypes.h"
    00014 #include "Pfield.h"
    00015
    00016
    00017 /**
    00018 * @class RandomMotionGenerator
    00019 *
    00020 * An class for generating random motion vectors
    00021 */
    00022 class RandomMotionGenerator
    00023 {
    00024 public:
    00025   /** Constructor
    00026   * @param minValue See class members
    00027   * @param maxValue See class members
    00028   * @param valueDx See class members
    00029   * @param directionDx See class members
    00030   * @param changeType See class members
    00031   * @param n See class members
    00032   */
    00033   RandomMotionGenerator(double minValue, double maxValue, double valueDx,
    00034                         double directionDx, ChangeType changeType, unsigned long n);
    00035
    00036   /** Returns a random motion vector
    00037   * @return The vector
    00038   */
    00039   PfVec getMotionVector();
    00040
    00041 private:
    00042   /** The minimum length of the random vector*/
    00043   double minValue;
    00044   /** The maximum length of the random vector*/
    00045   double maxValue;
    00046   /** The maximum difference of the length of two successively generated vector*/
    00047   double valueDx;
    00048   /** The maximum difference of the direction of two successively generated vector*/
    00049   double directionDx;
    00050   /** The unit of n*/
    00051   ChangeType changeType;
    00052   /** The number of steps to wait until a new vector is generated*/
    00053   unsigned long n;
    00054   /** The last generated vector*/
    00055   PfVec lastVec;
    00056   /** The last generated direction*/
    00057   double lastDirection;
    00058   /** The number of calls since the last vector was generated*/
    00059   unsigned long calls;
    00060   /** The point of time the last vector was generated*/
    00061   unsigned long pointOfGenerationTime;
    00062
    00063   /** Returns a direction
    00064   * @param previousDirection The previous direction in radian
    00065   * @return A direction in radian
    00066   */
    00067   double computeDirection(double previousDirection) const;
    00068
    00069   /** Returns a length
    00070   * @param previousLength The previous length
    00071   * @return A length
    00072   */
    00073   double computeVecLength(double previousLength) const;
    00074
    00075   /** Returns a random number between two numbers
    00076   * @param min The minimum value
    00077   * @param max The maximum value
    00078   * @return A random number between min and max
    00079   */
    00080   double getRandomNumberBetween(double min, double max) const;
    00081 };
    00082
    00083
    00084 #endif  //RANDOM_MOTION_GENERATOR_H_