#include <PotentialFunctions.h>
Inheritance diagram for PotentialfieldFunction:
Public Member Functions | |
virtual double | computeValue (double x, bool smooth=true) |
Computes the value of the function for a given x including range checking and smoothing. | |
virtual double | computeDerivativeValue (double x, bool smooth=false) |
Computes the value of the derivative of the function for a given x including range checking and smoothing. | |
virtual PotentialfieldFunction * | clone ()=0 |
Clones a function object. | |
double | getRange () |
Returns the range of the function. | |
void | setParameters (double atZero, double range) |
Sets the two main parameters, recomputes smoothing parameters. | |
void | setSmoothingParameters (double smoothingAtObject, double smoothingAtBorder, double gradientAtObject, double gradientAtBorder) |
Sets parameters for smoothing at the end of the function's interval Both values have a range from 0.0 to 1.0. | |
Protected Member Functions | |
double | computeSmoothedValue (double x1, double fx1, double dx1, double x2, double fx2, double dx2, double x) |
Generates a smooth curve between two points and computes function value of a given x. | |
virtual double | f (double x) const |
Computes the value of the function for a given x. | |
virtual double | d (double x) const |
Computes the value of the derivative of the function for a given x. | |
virtual double | dd (double x) const |
Computes the value of the second derivative of the function for a given x. | |
virtual void | init () |
Computes the values of a and b. | |
void | getStandardParameters (PotentialfieldFunction *other) |
Sets standard parameters from other function. | |
Protected Attributes | |
double | smoothingAtObjectPosition |
Last position of smoothing near object. | |
double | smoothingAtBorderPosition |
First position of smoothing near the end of the range. | |
double | gradientAtObject |
The gradient at the object (used together with smoothing). | |
double | gradientAtBorder |
The gradient at (range,0) (used together with smoothing). | |
double | smoothingAtObjectPercentage |
Smoothing near object [0.0, .., 1.0]. | |
double | smoothingAtBorderPercentage |
Smoothing near the end of the range [0.0, .., 1.0]. | |
double | atZero |
The value of f(0). | |
double | range |
f(range) = 0 | |
double | a |
Internal variable for faster computation set by init(). | |
double | b |
Internal variable for faster computation set by init(). |
Definition at line 38 of file PotentialFunctions.h.
|
Computes the value of the function for a given x including range checking and smoothing.
Reimplemented in SocialFunction, and NoFunction. Definition at line 15 of file PotentialFunctions.cpp. References atZero, computeSmoothedValue(), d(), f(), gradientAtBorder, gradientAtObject, range, smoothingAtBorderPosition, and smoothingAtObjectPosition. Referenced by computeChargeForPointfield(), computeChargeForSectorfield(), computeChargeForShapefield(), and computeGradientForSectorfield(). |
Here is the call graph for this function:
|
Computes the value of the derivative of the function for a given x including range checking and smoothing.
Reimplemented in SocialFunction, and NoFunction. Definition at line 39 of file PotentialFunctions.cpp. References atZero, computeSmoothedValue(), d(), dd(), range, smoothingAtBorderPosition, and smoothingAtObjectPosition. Referenced by computeGradientForPointfield(), computeGradientForSectorfield(), and computeGradientForShapefield(). |
Here is the call graph for this function:
|
Clones a function object.
Implemented in LinearFunction, ParabolicFunction, AsymptoticFunction, SocialFunction, and NoFunction. Referenced by Object::setField(), and Object::setFunction(). |
|
Returns the range of the function.
Definition at line 65 of file PotentialFunctions.h. References range. Referenced by computeChargeForSectorfield(), and computeGradientForSectorfield(). |
|
Sets the two main parameters, recomputes smoothing parameters.
Definition at line 72 of file PotentialFunctions.h. References init(), smoothingAtBorderPercentage, smoothingAtBorderPosition, smoothingAtObjectPercentage, and smoothingAtObjectPosition. Referenced by computeChargeForSectorfield(), and computeGradientForSectorfield(). |
Here is the call graph for this function:
|
Sets parameters for smoothing at the end of the function's interval Both values have a range from 0.0 to 1.0.
Definition at line 88 of file PotentialFunctions.h. References range, smoothingAtBorderPercentage, smoothingAtBorderPosition, smoothingAtObjectPercentage, and smoothingAtObjectPosition. Referenced by Parser::parseFunction(), and Parser::parseObject(). |
|
Generates a smooth curve between two points and computes function value of a given x.
Definition at line 64 of file PotentialFunctions.cpp. Referenced by computeDerivativeValue(), and computeValue(). |
|
Computes the value of the function for a given x.
Reimplemented in LinearFunction, ParabolicFunction, and AsymptoticFunction. Definition at line 142 of file PotentialFunctions.h. Referenced by computeValue(). |
|
Computes the value of the derivative of the function for a given x.
Reimplemented in LinearFunction, ParabolicFunction, and AsymptoticFunction. Definition at line 149 of file PotentialFunctions.h. Referenced by computeDerivativeValue(), and computeValue(). |
|
Computes the value of the second derivative of the function for a given x.
Reimplemented in LinearFunction, ParabolicFunction, and AsymptoticFunction. Definition at line 156 of file PotentialFunctions.h. Referenced by computeDerivativeValue(). |
|
Computes the values of a and b.
Reimplemented in LinearFunction, ParabolicFunction, and AsymptoticFunction. Definition at line 160 of file PotentialFunctions.h. Referenced by setParameters(). |
|
Sets standard parameters from other function.
Definition at line 165 of file PotentialFunctions.h. References gradientAtBorder, gradientAtObject, smoothingAtBorderPercentage, smoothingAtBorderPosition, smoothingAtObjectPercentage, and smoothingAtObjectPosition. Referenced by SocialFunction::clone(), AsymptoticFunction::clone(), ParabolicFunction::clone(), and LinearFunction::clone(). |
|
Last position of smoothing near object.
Definition at line 103 of file PotentialFunctions.h. Referenced by computeDerivativeValue(), computeValue(), getStandardParameters(), setParameters(), and setSmoothingParameters(). |
|
First position of smoothing near the end of the range.
Definition at line 105 of file PotentialFunctions.h. Referenced by computeDerivativeValue(), computeValue(), getStandardParameters(), setParameters(), and setSmoothingParameters(). |
|
The gradient at the object (used together with smoothing).
Definition at line 107 of file PotentialFunctions.h. Referenced by computeValue(), and getStandardParameters(). |
|
The gradient at (range,0) (used together with smoothing).
Definition at line 109 of file PotentialFunctions.h. Referenced by computeValue(), and getStandardParameters(). |
|
Smoothing near object [0.0, .., 1.0].
Definition at line 111 of file PotentialFunctions.h. Referenced by getStandardParameters(), setParameters(), and setSmoothingParameters(). |
|
Smoothing near the end of the range [0.0, .., 1.0].
Definition at line 113 of file PotentialFunctions.h. Referenced by getStandardParameters(), setParameters(), and setSmoothingParameters(). |
|
The value of f(0).
Definition at line 115 of file PotentialFunctions.h. Referenced by computeDerivativeValue(), and computeValue(). |
|
f(range) = 0
Definition at line 117 of file PotentialFunctions.h. Referenced by computeDerivativeValue(), computeValue(), getRange(), and setSmoothingParameters(). |
|
Internal variable for faster computation set by init().
Definition at line 119 of file PotentialFunctions.h. |
|
Internal variable for faster computation set by init().
Definition at line 121 of file PotentialFunctions.h. |