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

# Modules/BehaviorControl/CommonXabsl2Symbols/MathFunctions.h

Go to the documentation of this file.

    00001 /**
    00002 * @file MathFunctions.h
    00003 *
    00004 * Declaration of class MathFunctions.
    00005 *
    00006 * @author Matthias Jüngel
    00007 */
    00008
    00009 #ifndef __MathFunctions_h_
    00010 #define __MathFunctions_h_
    00011
    00012 #include "../BehaviorControl.h"
    00013 #include "Tools/Xabsl2/Xabsl2Engine/Xabsl2Engine.h"
    00014
    00015 /**
    00016 * The Xabsl2 symbols that are defined in "math-functions.xml"
    00017 *
    00018 * @author Matthias Jüngel
    00019 */
    00020 class MathFunctions : public Xabsl2FunctionProvider, public BehaviorControlInterfaces
    00021 {
    00022 public:
    00023 /*
    00024 * Constructor.
    00025 * @param interfaces The paramters of the BehaviorControl module.
    00026   */
    00027   MathFunctions(const BehaviorControlInterfaces& interfaces);
    00028
    00029   /** registers the symbols at an engine */
    00030   void registerSymbols(Xabsl2Engine& engine);
    00031
    00032     /** updates the symbols */
    00033   void update();
    00034
    00035   //!@name Input symbols
    00036   //!@{
    00037   /** calculates the decimal input function "distance-to" */
    00038   double distanceTo();
    00039
    00040   /** The parameter "distance-to.x" of the function "distance-to" */
    00041   double distanceToX;
    00042
    00043   /** The parameter "distance-to.y" of the function "distance-to" */
    00044   double distanceToY;
    00045
    00046   /** calculates the decimal input function "angle-to" */
    00047   double angleTo();
    00048
    00049   /** The parameter "angle-to.x" of the function "angle-to" */
    00050   double angleToX;
    00051
    00052   /** The parameter "angle-to.y" of the function "angle-to" */
    00053   double angleToY;
    00054
    00055   /** The parameter "normalize.angle" of the function "normalize" */
    00056   double normalizeAngle;
    00057
    00058   /** calculates the decimal input function "sgn" */
    00059   double getSgn();
    00060
    00061   /** calculates the decimal input function "min" */
    00062   double getMin();
    00063
    00064   /** calculates the decimal input function "max" */
    00065   double getMax();
    00066
    00067   /** calculates the decimal input function "abs" */
    00068   double getAbs();
    00069
    00070   /** calculates the decimal input function "random" */
    00071   double getRandom();
    00072
    00073   /** calculates the decimal input function "sin" */
    00074   double getSin();
    00075
    00076   /** calculates the decimal input function "cos" */
    00077   double getCos();
    00078
    00079   /** calculates the decimal input function "normalize" */
    00080   double getNormalize();
    00081
    00082   /** The parameter "sgn.value" of the function "sgn" */
    00083   double sgnValue;
    00084
    00085   /** The parameter "abs.value" of the function "abs" */
    00086   double absValue;
    00087
    00088   /** The parameter "min0.value" of the function "min" */
    00089   double min0Value;
    00090
    00091   /** The parameter "min1.value" of the function "min" */
    00092   double min1Value;
    00093
    00094   /** The parameter "max.value0" of the function "max" */
    00095   double max0Value;
    00096
    00097   /** The parameter "max.value1" of the function "max" */
    00098   double max1Value;
    00099
    00100   /** The parameter "*.alpha" of the function "sin" and "cos" */
    00101   double alphaValue;
    00102
    00103   /** calculates the value for the symbol "freeze.value" */
    00104   double getFrozenValue();
    00105
    00106   /** The parameter "freeze.value" of the function "freeze" */
    00107   double valueToFreeze;
    00108
    00109   /** The function returns 1 if the value is in the interval between a and b (order doesn't matter) */
    00110   double isInInterval();
    00111
    00112   double isInIntervalValue;
    00113   double isInIntervalA;
    00114   double isInIntervalB;
    00115
    00116   double saveValue();
    00117   double getValue();
    00118
    00119   double savevalue;
    00120   double saveindex;
    00121   double savedValues[255];
    00122
    00123 private:
    00124
    00125   /* A flag to release frozenValue*/
    00126   int unFreezeValue;
    00127
    00128   /* The stored frozen value*/
    00129   double frozenValue;
    00130
    00131   //!@}
    00132 };
    00133
    00134
    00135 #endif // __MathFunctions_h_
    00136