|
WebCab Optimization v2.6 (J2EE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
The UniDimensionalSolver Enterprise JavaBean offers methods for finding the location of the extremum (i.e. minimum or maximum) of a function of one real variable. That is, we offer procedures for finding the extremum of a function defined over a one dimensional real space (i.e. the real line) with or without upper and lower bounds.
Each of the procedures provided within this Enterprise JavaBean proceeds by first being passed the object function of the optimization problem for which the location of the extremum is to be found. We then call one of the optimization procedures giving various parameters used to define procedure specific information such as the tolerance used and in the case of constrained optimization the constraints which must be satisfied. In most instances we are also required to provide an initial point from where the given optimization procedure will start it iterative search of the (local or global) extremum.
The aim of the theory of optimization is to find the location of the extremum (i.e. maximum or minimum) of a (possibly constrained) function defined over one or more (real) dimensions. An extremum point can be either local or global. A local extremum is a point such that the object function is known to obtain its highest (in the case of maximization) or lowest (in the case of minimization) value within a given sub-region of the entire domain over which the optimization problem is considered. A global extremum is the point at which the (object) function takes it maximum or minimum value over the entire domain for which the optimization problem is considered. Here we offer procedures which are designed for finding both the local and global extremum.
You should select an optimization procedure to use in accordance with the properties of the optimization problem you are considering. For the unidimensional case there are two approaches to selecting the particular algorithm to use, as described below:
This approach focuses on the properties of the problem at hand. In particular, we take into account the following criteria when selecting the particular optimization procedure to use:
By using this information and taking into account your particular applications needs you will able to select the most appropriate procedure to use.
It is also true that in the unidimensional optimization case the algorithms can be roughly broken down into the following three categories:
Apart from categorizing your problem within one of these three criteria the only other information required in the selection of an approach is whether the object function of your optimization problem is differentiable or not, and in the case of the second and third categories whether you wish to select the set of bracketing and locate algorithms which is used within the procedure.
Unless you particular wish to fine tune the optimization algorithms for your given problem at hand we strongly advise that when wishing to find the local or global extremum over an interval that the algorithms with a preset default set of bracketing and locate algorithms are used. The algorithms with these preset internal algorithms are as follows:
seekNextExtreme
seekNextExtremeDeriv
globalExtreme
globalExtremeDeriv
Remark: The function used within an optimization
problem must be provided using setFunction, which
takes as a parameters an instance of a class which implements one of the
UniDimensionalFunction sub-interfaces. When
we refer to a function being general we refer to the fact that only the
getValueAt method, giving
the functions value at a points has been implemented. By differentiable
function we refer to the fact that in addition to the implementation of
this method you have also implemented Derivative.getDerivativeAt(double).
To offer the greatest power and flexibility we provide methods which allow the Bracketing and Locate algorithms used within the optimization procedures to be selected and configured. This allows the algorithm to be finely tuned to find the exact requirements of your problem at hand and the level of precision and robustness required. We offer the following four procedures, two for finding the local extremum and two for finding the global extremum:
seekNextExtreme
seekNextExtremeDeriv
globalExtreme
globalExtremeDeriv
For those who require speed at the expense of precision we offer the following methods for finding the local extremum of a general function which are not even necessarily continuous.
seekExtremeValueUnidir - Finds the value of
the unidimensional object function at a local extremum (maximum or minimum) found,
where the specific bracketing and locate algorithms from the Enterprise JavaBeans
BracketingAlgorithm and LocateAlgorithm are
set and the initial point given.
seekExtremeUnidir - Evaluates the location of a (local)
extremum (maximum or minimum) of a unidimensional object function and returns the type
Extremum which contains the coordinate value of the extremum sought of the type of
extremum found (i.e. whether maximum or minimum).
seekExtremeBidir - Evaluates the location of
a local minimum of a unidimensional function with a iterative search started in two directions,
when the bracketing and locate algorithms and initial point are given.
For all three of these methods the specific bracketing and locate algorithms used
within the algorithm must be selected (i.e. given via a parameter) from the Enterprise JavaBean's
BracketingAlgorithm and LocateAlgorithm.
A very effective means by which to select the optimal Bracketing and Locate algorithm combination for your particular problem, is to just try the 16 combinations of algorithms and then compare the results found. To assist (and demonstrate) this approach we provide within this package client examples which solve various unidimensional optimization problems using the various combinations of Bracketing and Locate algorithms. By adopting these examples (i.e. set your function rather than use the preset object function) you will be able to select the optimal bracketing and locate algorithm combination for your particular optimization problem but just comparing the results given by the various algorithms.
For unidimensional optimization problems the constraints can only take very simple forms,
for example lowerBound ≤ x ≤ upperBound, where lowerBound,
upperBound are two given real numbers. Therefore we are able to offer a number of
refined algorithms to deal with the unidimensional constrained case, two such examples are
globalExtremeDeriv, and globalExtreme.
As mentioned above the algorithms implemented within this Enterprise JavaBean work most efficiently when the functions are `well behaved'. Generally speaking what we mean by `well behaved' is that the smoother the function, the more `well behaved' the function is. This is important to our study here since generally the more `well behaved' a function the more efficient and stable the optimization algorithms contained within this Enterprise JavaBean will be when applied to the given function at hand. This principle is true for both general or differentiable functions.
The reason for this is that the `greedy type' algorithms implemented here have as a basis that at each iterative step we move to the extremum point within a given neighborhood lying in one of a number of chosen directions. Such `greedy type' or calculus inspired arguments work increasingly more effectively as the function on which they are applied gets smoother.
Remark: In practice, the requirement that the majority of the procedures within this Enterprise JavaBean require that the object function is continuous or even differentiable is not a restriction with most practical applications. The reason being that processes generated from real world systems such as economic systems will result in the study of object functions which are in nearly all cases are continuous and even differentiable.
It is also important to point out that though we may consider non-continuous functions
with some of the algorithms these functions must never return a NaN (Not a
number). In order to guarantee this we must ensure that for all points within the domain
over which the optimization problem is considered the object function does not return
such as value. If such an value is returned, the algorithms will exit and throw an
InvalidUniDimensionalFunctionException
exception. If this exception is thrown, you will then be able to call methods within the
Exception class which provide the coordinate value of the point where the function evaluates
to a Double.NaN. By modifying your given function at points where it returns
a NaN you should be able to modify the object function of the optimization
problem so that the essential features of the underlying problem are preserved but the
optimization algorithm can be successfully applied.
The local extremum (i.e. minimum or maximum) is just the extremum in a neighborhood of a point, where the global extremum is the extremum on the whole domain over which the optimization problem is considered. In practice it is generally the global extremum which is desired and for constrained optimization problems (i.e. with an upper and lower bound) we provide effective algorithms which treat this case, namely:
globalExtreme(ExtremumTypes, double, double, int, double, int)
globalExtremeDeriv(ExtremumTypes, double, double, int, double, int)
For unconstrained optimization problems since you can never be certain that the local extremum is in fact the global extremum. There are no iterative algorithms which are effective at finding the global extremum of a unconstrained problem.
The UniDimensionalException is thrown if a function
is not set and one of the optimization solver algorithms is called. If the algorithm
requires a differential object function and a differentiable function has not been set
then a UniDimensionalException will be thrown. For details
concerning the implementation and the setting of a function please see the documentation
of setFunction.
seekExtremeValueUnidir - Finds the location of the (local)
extremum (maximum or minimum) of the unidimensional function, where the specific bracketing
and locate algorithm from the Enterprise JavaBean's BracketingAlgorithm and
LocateAlgorithm used by the algorithm must be selected.
seekExtremeUnidir - Evaluates the value of the unidimensional
object function at the (local) extremum (maximum or minimum), where the specific bracketing
and locate algorithm from the Enterprise JavaBean's BracketingAlgorithm and
LocateAlgorithm used by the algorithm must be selected.
seekExtremeBidir - Seeks a local minimum of the unidimensional
function, where the specific bracketing and locate algorithm from the Enterprise JavaBean's
BracketingAlgorithm and LocateAlgorithm
used by the algorithm must be selected.
seekNextExtreme(ExtremumTypes, double, double, int) - Seek local minimum for a general function
using a default set of Bracketing and Locate algorithms.
seekNextExtreme(ExtremumTypes, double, double, BracketingAlgorithm[], LocateAlgorithm[], int) - Same as
above but you are able to select the set of Bracketing and Locate algorithms used.
seekNextExtremeDeriv(ExtremumTypes, double, double, int) - Seeks local minimum of a unidimensional
differentiable function using a default set of Bracketing and Locate algorithms.
seekNextExtremeDeriv(ExtremumTypes, double, double, BracketingAlgorithm[], LocateAlgorithm[], int) - Same
as above but you are able to select the set of Bracketing and Locate algorithms used.
globalExtreme(ExtremumTypes, double, double, int, double, int) - Seek global extremum within an interval
of the real line for a general unidimensional function.
globalExtreme(ExtremumTypes, double, double, int, double, BracketingAlgorithm[], LocateAlgorithm[], int)
- Same as above except you are able to select set of the Locate and Bracketing algorithms used.
globalExtremeDeriv(ExtremumTypes, double, double, int, double, int) - Seeks the global extremum
within the real line of differentiable unidimensional function, using a default set of Bracketing and Locate
algorithms.
globalExtremeDeriv(ExtremumTypes,double,double,int,double,BracketingAlgorithm[],LocateAlgorithm[],int)
- Same as above but you are able to select the set of Bracketing and Locate algorithms used.
| Method Summary | |
double |
globalExtreme(ExtremumTypes extremumType,
double lowerBound,
double upperBound,
int noSubIntervals,
double tolerance,
BracketingAlgorithm[] bracketingAlgorithm,
LocateAlgorithm[] locateAlgorithm,
int maxIterations)
Seeks the global extreme within an interval of an unidimensional optimization problem with a general object function using information from a user selected set of locate and bracketing algorithms. |
double |
globalExtreme(ExtremumTypes extremumType,
double lowerBound,
double upperBound,
int noSubIntervals,
double tolerance,
int maxIterations)
Seeks the global extreme within an interval of an unidimensional optimization problem with a general object function using information from a default set of locate and bracketing algorithms. |
double |
globalExtremeDeriv(ExtremumTypes extremumType,
double lowerBound,
double upperBound,
int noSubIntervals,
double tolerance,
BracketingAlgorithm[] bracketingAlgorithm,
LocateAlgorithm[] locateAlgorithm,
int maxIterations)
Seeks the global extreme within an interval of an unidimensional optimization problem with a differentiable object function using information from a user selected set of locate and bracketing algorithms. |
double |
globalExtremeDeriv(ExtremumTypes extremumType,
double lowerBound,
double upperBound,
int noSubIntervals,
double tolerance,
int maxIterations)
Seeks the global extreme within an interval of an unidimensional optimization problem with a differentiable object function using information from a default set of locate and bracketing algorithms. |
double |
seekExtremeBidir(double initialPoint,
BracketingAlgorithm bracketingAlgorithm,
LocateAlgorithm locateAlgorithm,
double minDistance,
double bracketingParameter,
double tolerance,
int maxIterations)
Seeks a location of a (local) minimum of a unidimensional object function using user selected bracketing and locate algorithms from BracketingAlgorithm
and LocateAlgorithm respectively and starting the iterative search
in two directions from a given initial point.
|
Extremum |
seekExtremeUnidir(double initialPoint,
BracketingAlgorithm bracketingAlgorithm,
LocateAlgorithm locateAlgorithm,
double minDistance,
double bracketingParameter,
double tolerance,
int maxIterations)
Evaluates the location of a (local) extremum (i.e. maximum or minimum) of the unidimensional object function, where the specific bracketing and locate algorithms from the Enterprise JavaBeans BracketingAlgorithm and LocateAlgorithm are set
and the initial point given. |
double |
seekExtremeValueUnidir(double initialPoint,
BracketingAlgorithm bracketingAlgorithm,
LocateAlgorithm locateAlgorithm,
double minDistance,
double bracketingParameter,
double tolerance,
int maxIterations)
Finds the value of the unidimensional object function at the local extremum (maximum or minimum) found, where the specific bracketing and locate algorithms from the Enterprise JavaBean's BracketingAlgorithm and
LocateAlgorithm are set and the initial point given. |
double |
seekNextExtreme(ExtremumTypes extremumType,
double initialPoint,
double tolerance,
BracketingAlgorithm[] bracketingAlgorithm,
LocateAlgorithm[] locateAlgorithm,
int maxIterations)
Seeks the closest local extremum to a given initialPoint for the unidimensional object
function using information from a user selected set of bracketing and location algorithms.
|
double |
seekNextExtreme(ExtremumTypes extremumType,
double initialPoint,
double tolerance,
int maxIterations)
Seeks the closest local extremum to a given initialPoint for the unidimensional object
function using information from a default set of bracketing and location algorithms.
|
double |
seekNextExtremeDeriv(ExtremumTypes extremumType,
double initialPoint,
double tolerance,
BracketingAlgorithm[] bracketingAlgorithm,
LocateAlgorithm[] locateAlgorithm,
int maxIterations)
Seeks the closest local extremum to a given initialPoint for the unidimensional
differentiable object function using information from a user selected set of bracketing and
location algorithms.
|
double |
seekNextExtremeDeriv(ExtremumTypes extremumType,
double initialPoint,
double tolerance,
int maxIterations)
Seeks the closest local extremum to a given initialPoint for the unidimensional
differentiable object function using information from a default set of bracketing and location
algorithms.
|
void |
setFunction(FunctionDelivery deliveryOfUniDimensionalFunction)
Submits a new uni-dimensional function for which the location of the extremum is to be found. |
| Methods inherited from interface javax.ejb.EJBObject |
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove |
| Method Detail |
public void setFunction(FunctionDelivery deliveryOfUniDimensionalFunction)
throws FunctionDeliveryException,
RemoteException
In order to provide a function which is to be used within the algorithms contained within this Enterprise JavaBean you are required to implement one of the following interfaces:
UniDimensionalFunction - For unidimensional functions which are either
not differentiable or for which the differentiable is not known.
Derivative - For unidimensional functions which are differentiable and the differential
is known. Note that the Derivative interface inherits from the UniDimensionalFunction
interface.
For further explicit details concerning how these interfaces are implemented (including source code) see
the documentation for the Enterprise JavaBeans UniDimensionalFunction and
Derivative.
deliveryOfUniDimensionalFunction - References an instance of a class which implements the function through the use of the UniDimensionalFunction and Derivative interfaces.
FunctionDeliveryException
RemoteException
public double seekExtremeValueUnidir(double initialPoint,
BracketingAlgorithm bracketingAlgorithm,
LocateAlgorithm locateAlgorithm,
double minDistance,
double bracketingParameter,
double tolerance,
int maxIterations)
throws TooManyUniDimensionalIterationsException,
InvalidUniDimensionalFunctionException,
UniDimensionalException,
RemoteException
BracketingAlgorithm and
LocateAlgorithm are set and the initial point given. In order to find
the location of the extremum you may use seekExtremeUnidir,
which applied the same algorithm except returns the location of the extremum rather
than the value of the object function at a extremum.
Once the object function has been set you should specify the specific bracketing
and locate algorithms which are used within this method, by passing as parameters the
appropriate procedure from the Enterprise JavaBeans BracketingAlgorithm
and LocateAlgorithm.
The iterative search will begin from the point initialPoint,
with the accuracy of the result depending on the algorithms chosen and the
algorithms settings corresponding to the last four parameters. The last four
parameters do not have a general interpretation but there exact meaning
and use should become clear once the bracketing and location algorithms are
chosen and we refer the read to the corresponding documentation of the Enterprise JavaBeans
BracketingAlgorithm and LocateAlgorithm,
or the Mathematical Documentation chapter of the PDF documentation for further details.
initialPoint - the initial point for which the iterative search from the extremum is started from.bracketingAlgorithm - the bracketing algorithm used selected from the Enterprise JavaBean BracketingAlgorithm.locateAlgorithm - the locate algorithm used selected from the Enterprise JavaBean LocateAlgorithm.minDistance - this parameter is required by all bracketing algorithms within BracketingAlgorithm, and usually signifies the minimal distance between the end points of any bracketed interval in which the extremum lies. Therefore, the value used here should be approximately as large as the tolerance parameter.bracketingParameter - this parameter is required by some bracketing algorithms. For a detailed explanation as to its meaning and use for particular bracketing algorithms selected please see the BracketingAlgorithm documentation or the Mathematical Documentation chapter of the accompanying PDF documentation.tolerance - the tolerance used within the exit condition of the iterative locate algorithm used. A reasonable value to take for the tolerance is 1E-5.maxIterations - the maximum number of iterations used only in the iterative locate algorithms, in such cases a reasonable value to use is 300. If the number of iterations exceeds this number TooManyUniDimensionalIterationsException will be thrown.
TooManyUniDimensionalIterationsException - thrown if the exit criteria of the locate
algorithm was not triggered and hence the (local) extremum found after maxIterations
iterations.
InvalidUniDimensionalFunctionException - thrown if the object function given returns invalid
values, such as NaN.
UniDimensionalException - thrown if algorithms selected require a differentiable
function but one has not been set, or if the no function has been set. In particular,
in the case of a differentiable function the Derivative interface will need to be
implemented and in the case of a general function the Function interface will need
to be implemented.
RemoteExceptionapplies the same algorithm for the corresponds bracketing and locate
algorithms except that here the {@link Extremum} type is returned which encapsulates the type
of the extremum found (i.e. maximum or minimum) and the coordinate value of the object function
at the extremum found.,
seekExtremeBidir(double, com.webcab.ejb.math.optimization.unidimensional.BracketingAlgorithm, com.webcab.ejb.math.optimization.unidimensional.LocateAlgorithm, double, double, double, int)
public Extremum seekExtremeUnidir(double initialPoint,
BracketingAlgorithm bracketingAlgorithm,
LocateAlgorithm locateAlgorithm,
double minDistance,
double bracketingParameter,
double tolerance,
int maxIterations)
throws TooManyUniDimensionalIterationsException,
InvalidUniDimensionalFunctionException,
UniDimensionalException,
RemoteException
BracketingAlgorithm and LocateAlgorithm are set
and the initial point given. This method returns the type Extremum which contains the coordinate
value of the extremum sought of the type of extremum found (i.e. whether maximum or minimum). In order to find
the value of the object function at the extremum found you may use seekExtremeValueUnidir,
which applied the same algorithm except but returns the value of the object function at the extremum rather
than the coordinate value of the extremum found.
Remark: This approach in general will yield less precise results than seekExtremeBidir(double, com.webcab.ejb.math.optimization.unidimensional.BracketingAlgorithm, com.webcab.ejb.math.optimization.unidimensional.LocateAlgorithm, double, double, double, int),
for corresponding choices of the locate and bracketing algorithms, but will also also be faster by a factor of two.
Once the object function has been set you should specify the specific bracketing
and locate algorithms which are used within this method, by passing as parameters the
appropriate procedure from the Enterprise JavaBeans BracketingAlgorithm
and LocateAlgorithm.
The iterative search will begin from the point initialPoint,
with the accuracy of the result depending on the algorithms chosen and the
algorithms settings corresponding to the last four parameters. The last four
parameters do not have a general interpretation but there exact meaning
and use should become clear once the bracketing and location algorithms are
chosen and we refer the read to the corresponding documentation of the Enterprise JavaBeans
BracketingAlgorithm and LocateAlgorithm,
or the Mathematical Documentation chapter of the PDF documentation for further details.
initialPoint - the initial point for which the iterative search from the extremum is started from.bracketingAlgorithm - the bracketing algorithm used selected from the Enterprise JavaBean BracketingAlgorithm.locateAlgorithm - the locate algorithm used selected from the Enterprise JavaBean LocateAlgorithm.minDistance - this parameter is required by all bracketing algorithms within BracketingAlgorithm, and usually signifies the minimal distance between the end points of any bracketed interval in which the extremum lies. Therefore, the minDistance parameter should be approximately the same magnitude as tolerance parameter.bracketingParameter - this parameter is required by some bracketing algorithms. For a detailed explanation as to its meaning and use for particular bracketing algorithms selected please see the BracketingAlgorithm documentation or the Mathematical Documentation chapter of the accompanying PDF documentation.tolerance - the tolerance used within the exit condition of the iterative locate algorithm used. A reasonable value to take for the tolerance is 1E-5.maxIterations - the maximum number of iterations used only in the iterative locate algorithms, in such cases a reasonable value to use is 300. If the number of iterations exceeds this number TooManyUniDimensionalIterationsException will be thrown.
TooManyUniDimensionalIterationsException - thrown if the number of iterations in locate
algorithms is greater than maxIterations.
InvalidUniDimensionalFunctionException - thrown if the user function returns invalid
values like infinity or NaN.
UniDimensionalException - thrown if you use an algorithm which requires derivable functions
but the delivered function does not implement the Derivative interface; also thrown if the
delivered function does not implement an interface which extends Function.
RemoteExceptionapplies the same algorithm except that here the value of the
object function at the extremum found (i.e. maximum or minimum) is returned.
public double seekExtremeBidir(double initialPoint,
BracketingAlgorithm bracketingAlgorithm,
LocateAlgorithm locateAlgorithm,
double minDistance,
double bracketingParameter,
double tolerance,
int maxIterations)
throws TooManyUniDimensionalIterationsException,
InvalidUniDimensionalFunctionException,
UniDimensionalException,
RemoteException
BracketingAlgorithm
and LocateAlgorithm respectively and starting the iterative search
in two directions from a given initial point.
Remark: This approach in general will yield more precise results than
seekExtremeUnidir(double, com.webcab.ejb.math.optimization.unidimensional.BracketingAlgorithm, com.webcab.ejb.math.optimization.unidimensional.LocateAlgorithm, double, double, double, int), for corresponding choices of the locate and bracketing algorithms,
but will also be slower by a factor of two.
Once the object function has been set you should specify the specific bracketing
and locate algorithms which are used within this method, by passing as parameters the
appropriate procedure from the Enterprise JavaBeans BracketingAlgorithm
and LocateAlgorithm.
The iterative search will begin from the point initialPoint,
with the accuracy of the result depending on the algorithms chosen and the
algorithms settings corresponding to the last four parameters. The last four
parameters do not have a general interpretation but there exact meaning
and use should become clear once the bracketing and location algorithms are
chosen and we refer the read to the corresponding documentation of the Enterprise JavaBeans
BracketingAlgorithm and LocateAlgorithm,
or the Mathematical Documentation chapter of the PDF documentation for further details.
initialPoint - the initial point for which the iterative search from the extremum is started from.bracketingAlgorithm - the bracketing algorithm used selected from the Enterprise JavaBean BracketingAlgorithm.locateAlgorithm - the locate algorithm used selected from the Enterprise JavaBean LocateAlgorithm.minDistance - this parameter is required by all bracketing algorithms within BracketingAlgorithm, and usually signifies the minimal distance between the end points of any bracketed interval in which the extremum lies. Therefore, the minDistance parameter should be approximately the same magnitude as tolerance parameter.bracketingParameter - this parameter is required by some bracketing algorithms. For a detailed explanation as to its meaning and use for particular bracketing algorithms selected please see the BracketingAlgorithm documentation or the Mathematical Documentation chapter of the accompanying PDF documentation.tolerance - the tolerance used within the exit condition of the iterative locate algorithm used. A reasonable value to take for the tolerance is 1E-5.maxIterations - the maximum number of iterations used only in the iterative locate algorithms, in such cases a reasonable value to use is 300. If the number of iterations exceeds this number TooManyUniDimensionalIterationsException will be thrown.
initialPoint).
TooManyUniDimensionalIterationsException - thrown if the number of iterations in locate
algorithms is greater than maxIterations.
InvalidUniDimensionalFunctionException - thrown if the user function returns invalid
values like infinity or NaN.
UniDimensionalException - thrown if you use an algorithm which requires derivable
functions but the delivered function does not implement the Derivative interface; also
thrown if the delivered function does not implement an interface which extends Function.
RemoteException
public double seekNextExtreme(ExtremumTypes extremumType,
double initialPoint,
double tolerance,
int maxIterations)
throws TooManyUniDimensionalIterationsException,
InvalidUniDimensionalFunctionException,
UniDimensionalException,
RemoteException
initialPoint for the unidimensional object
function using information from a default set of bracketing and location algorithms.
Unlike seekExtremeValueUnidir and
seekExtremeUnidir which use only one pair of bracketing and
locate algorithms and which can be rather imprecise. This method uses information from
a defaults set of bracketing and locate algorithms, whereas in the associated method
seekNextExtreme(...,BracketingAlgorithm[],...)
you are able to selected the group and location and bracketing algorithms used. Though
the justification for this approach is heuristic in nature in many instances it leads
to a improvement in the accuracy of the results found. Moreover, this approach also has
the important property that the probability to miss extremum is greatly reduced.
The basic idea of this approach is that for each iteration all the algorithms with the
default set are invoked and the "best" next point of all the algorithms is used as the
starting point of the next iteration. Here the tolerance set will be the level
of the tolerance used within each of the bracketing and locate algorithms. Please note that
the precision used should also increase as the initial point moves closer to the local
extremum.
Once the object function has been set you should specify the initialPoint
from where the closest local extremum will be found, the type of extremum sought,
the tolerance and the maximum number of iterations which can be used.
extremumType - indicates the type of extreme searched: in the case of a minimum, extremumType == ExtremumTypes.MINIMUM; and in the case of a maximum, extremumType == ExtremumTypes.MAXIMUM.initialPoint - the initial point for which the iterative search from the extremum is started from.tolerance - the tolerance of the result. The actual coordinate value of the extreme will lie in the interval (result - tolerance, result + tolerance). Hence, the value for the tolerance, should reflect the level of accuracy required.maxIterations - the maximum number of iterations used only in the iterative locate algorithms, in such cases a reasonable value to use is 300. If the number of iterations exceeds this number TooManyUniDimensionalIterationsException will be thrown.
initialPoint
in the case of a maximum being sought, or less than the initialPoint in the case
of the minimum being sought.
UniDimensionalException - thrown if the delivered function does not implement
Function or an interface which extends Function.
TooManyUniDimensionalIterationsException - thrown if the number of iterations is grater than maxIterations.
InvalidUniDimensionalFunctionException - thrown if the user function returns invalid values like infinity or NaN.
RemoteException
public double seekNextExtreme(ExtremumTypes extremumType,
double initialPoint,
double tolerance,
BracketingAlgorithm[] bracketingAlgorithm,
LocateAlgorithm[] locateAlgorithm,
int maxIterations)
throws TooManyUniDimensionalIterationsException,
InvalidUniDimensionalFunctionException,
UniDimensionalException,
RemoteException
initialPoint for the unidimensional object
function using information from a user selected set of bracketing and location algorithms.
Unlike seekExtremeValueUnidir and
seekExtremeUnidir which use only one pair of bracketing and
locate algorithms and which can be rather imprecise. This method uses information from
a set of user defined bracketing and locate algorithms, if you wish we also provide
the method seekNextExtreme(int, double, double, int),
for which we have selected a collected of bracketing and location algorithms. Though
the justification for this approach is heuristic in nature in many instances it leads
to a improvement in the accuracy of the results found. Moreover, this approach also
has the important property that the probability to miss extremum is greatly reduced.
The basic idea of this approach is that for each iteration all the algorithms chosen are invoked (even if there are duplicates) and the "best" next point of all the algorithms is used as the starting point of the next iteration. The precision used in each of the bracketing and locate algorithms should be similar (possibly even identical). The precision used should also increase as the initial point moves closer to the local extremum. In order to ensure the efficient execution of this approach certain care must be taken in the selection of the algorithms used. The reason being that for algorithms which fail for the given problem at hand though not influencing the result, will make significant computation demands during the methods execution.
Once the object function has been set you should specify the set of bracketing
and locate algorithms which are used within this method, by passing as parameters the
appropriate procedures from the Enterprise JavaBeans BracketingAlgorithm
and LocateAlgorithm.
Finally the initialPoint from which the closest local extremum will be sought.
It is also necessary to set the type of extremum sought along with the tolerance and the maximum
number of iterations used.
extremumType - indicates the type of extreme searched: in the case of a minimum, extremumType == ExtremumTypes.MINIMUM; and in the case of a maximum, extremumType == ExtremumTypes.MAXIMUM.initialPoint - the initial point for which the iterative search from the extremum is started from.tolerance - the tolerance of the result. The actual coordinate value of the extreme will lie in the interval (result - tolerance, result + tolerance). Hence, the value for the tolerance, should reflect the level of accuracy required.bracketingAlgorithm - the bracketing algorithm used selected from the Enterprise JavaBean BracketingAlgorithm.locateAlgorithm - the locate algorithm used selected from the Enterprise JavaBean LocateAlgorithm.maxIterations - the maximum number of iterations used only in the iterative locate algorithms, in such cases a reasonable value to use is 300. If the number of iterations exceeds this number TooManyUniDimensionalIterationsException will be thrown.
initialPoint
in the case of a maximum being sought, or less than the initialPoint in the case
of the minimum being sought.
UniDimensionalException - thrown if the delivered function does not implement
Function or an interface which extends Function; also thrown if you use a bracketing
or locate algorithm which needs derivable functions and your function does not
implement Derivative or an interface which extends it.
TooManyUniDimensionalIterationsException - thrown if the number of iterations is grater than
maxIterations.
InvalidUniDimensionalFunctionException - thrown if the user function returns invalid values
like infinity or NaN.
RemoteException
public double seekNextExtremeDeriv(ExtremumTypes extremumType,
double initialPoint,
double tolerance,
int maxIterations)
throws TooManyUniDimensionalIterationsException,
InvalidUniDimensionalFunctionException,
UniDimensionalException,
RemoteException
initialPoint for the unidimensional
differentiable object function using information from a default set of bracketing and location
algorithms.
Unlike seekExtremeValueUnidir and
seekExtremeUnidir which use only one pair of bracketing and
locate algorithms and which can be rather imprecise. This method uses information from
a defaults set of bracketing and locate algorithms, whereas in the associated method
seekNextExtreme(...,BracketingAlgorithm[],...)
you are able to selected the group and location and bracketing algorithms used. Though
the justification for this approach is heuristic in nature in many instances it leads
to a improvement in the accuracy of the results found. Moreover, this approach also has
the important property that the probability to miss extremum is greatly reduced.
The basic idea of this approach is that for each iteration all the algorithms with the
default set are invoked and the "best" next point of all the algorithms is used as the
starting point of the next iteration. Here the tolerance set will be the level
of the tolerance used within each of the bracketing and locate algorithms. Please note that
the precision used should also increase as the initial point moves closer to the local
extremum.
Once the object function has been set you should specify the initialPoint
from where the closest local extremum will be sought. You are also required to set the
type of extremum sought, the tolerance and the maximum number of iterations used.
extremumType - indicates the type of extreme searched: in the case of a minimum, extremumType == ExtremumTypes.MINIMUM; and in the case of a maximum, extremumType == ExtremumTypes.MAXIMUM.initialPoint - the initial point for which the iterative search from the extremum is started from.tolerance - the tolerance of the result. The actual coordinate value of the extreme will lie in the interval (result - tolerance, result + tolerance). Hence, the value for the tolerance, should reflect the level of accuracy required.maxIterations - the maximum number of iterations used only in the iterative locate algorithms, in such cases a reasonable value to use is 300. If the number of iterations exceeds this number TooManyUniDimensionalIterationsException will be thrown.
initialPoint
in the case of a maximum being sought, or less than the initialPoint in the case
of the minimum being sought.
UniDimensionalException - thrown if the delivered function does not implement
Derivative or an interface which extends Derivative.
TooManyUniDimensionalIterationsException - thrown if the number of iterations is grater than
maxIterations.
InvalidUniDimensionalFunctionException - thrown if the user function returns invalid
values like infinity or NaN.
RemoteException
public double seekNextExtremeDeriv(ExtremumTypes extremumType,
double initialPoint,
double tolerance,
BracketingAlgorithm[] bracketingAlgorithm,
LocateAlgorithm[] locateAlgorithm,
int maxIterations)
throws TooManyUniDimensionalIterationsException,
InvalidUniDimensionalFunctionException,
UniDimensionalException,
RemoteException
initialPoint for the unidimensional
differentiable object function using information from a user selected set of bracketing and
location algorithms.
Unlike seekExtremeValueUnidir and
seekExtremeUnidir which use only one pair of bracketing and
locate algorithms and which can be rather imprecise. This method uses information from
a set of user defined bracketing and locate algorithms, if you wish we also provide
the method seekNextExtremeDeriv(int, double, double, int),
for which we have selected a collected of bracketing and location algorithms. Though
the justification for this approach is heuristic in nature in many instances it leads
to a improvement in the accuracy of the results found. Moreover, this approach also
has the important property that the probability to miss extremum is greatly reduced.
The basic idea of this approach is that for each iteration all the algorithms chosen are invoked (even if there are duplicates) and the "best" next point of all the algorithms is used as the starting point of the next iteration. The precision used in each of the bracketing and locate algorithms should be similar (possibly even identical). The precision used should also increase as the initial point moves closer to the local extremum. In order to ensure the efficient execution of this approach certain care must be taken in the selection of the algorithms used. The reason being that for algorithms which fail for the given problem at hand though not influencing the result, will make significant computation demands during the methods execution.
Once the object function has been set you should specify the set of bracketing
and locate algorithms which are used within this method, by passing as parameters the
appropriate procedures from the Enterprise JavaBeans BracketingAlgorithm
and LocateAlgorithm.
Finally the initialPoint from which the closest local extremum will be sought
must be given. It is also necessary to provide the type of extremum sought along with the tolerance
and the maximum number of iterations which can be used.
extremumType - indicates the type of extreme searched: in the case of a minimum, extremumType == ExtremumTypes.MINIMUM; and in the case of a maximum, extremumType == ExtremumTypes.MAXIMUM.initialPoint - the initial point for which the iterative search from the extremum is started from.tolerance - the tolerance of the result. The actual coordinate value of the extreme will lie in the interval (result - tolerance, result + tolerance). Hence, the value for the tolerance, should reflect the level of accuracy required.bracketingAlgorithm - the bracketing algorithm used selected from the Enterprise JavaBean BracketingAlgorithm.locateAlgorithm - the locate algorithm used selected from the Enterprise JavaBean LocateAlgorithm.maxIterations - the maximum number of iterations used only in the iterative locate algorithms, in such cases a reasonable value to use is 300. If the number of iterations exceeds this number TooManyUniDimensionalIterationsException will be thrown.
initialPoint
in the case of a maximum being sought, or less than the initialPoint in the case
of the minimum being sought.
UniDimensionalException - thrown if the delivered function does not implement
Derivative or an interface which extends Derivative.
TooManyUniDimensionalIterationsException - thrown if the number of iterations is grater
than maxIterations.
InvalidUniDimensionalFunctionException - thrown if the user function returns invalid values
like infinity or NaN.
RemoteException
public double globalExtremeDeriv(ExtremumTypes extremumType,
double lowerBound,
double upperBound,
int noSubIntervals,
double tolerance,
int maxIterations)
throws InvalidUniDimensionalFunctionException,
TooManyUniDimensionalIterationsException,
UniDimensionalException,
RemoteException
This method uses its own default set of bracketing and locate algorithms from which the "best" point
is selected during each iteration in order to improve accuracy in a similar fashion to
seekNextExtreme. However in addition, by varying the noSubIntervals
parameter we are able to ensures that the maximum advancing
step for each iteration will (upperBound - lowerBound) / noSubIntervals, where lowerBound
and upperBound are the end points of the interval over which the global extremum is sought.
These two processes reduce the probability to missing a local extremes which are each candidates
of the global extremum being sought within the interval considered.
Remark: In addition to this method we also offer the method globalExtremeDeriv(...,BracketingAlgorithm[],...),
which is similar in approach to this method except you are able to set the default set of
bracketing and locate algorithms which are used at each step.
Once the object function has been set you should specify:
initialPoint from where the closest local extremum is sought.
extremumType - indicates the type of extreme searched: in the case of a minimum, extremumType == ExtremumTypes.MINIMUM; and in the case of a maximum, extremumType == ExtremumTypes.MAXIMUM.lowerBound - the coordinate value on the real line of the beginning of the interval over which the global extremum (with respect to the interval considered) is sought.upperBound - the coordinate value on the real line of the end of the interval over which the global extremum (with respect to the interval considered) is sought.noSubIntervals - the number of intermediate "safety" points to be used, in order to ensure that the advance step do not become to large. Note that the larger this parameter is the less likely we are to miss any local extremum in the search for the global extremum.tolerance - the tolerance of the result. The actual coordinate value of the extreme will lie in the interval (result - tolerance, result + tolerance). Hence, the value for the tolerance, should reflect the level of accuracy required.maxIterations - the maximum number of iterations which is only used in the iterative locate algorithms, in such cases a reasonable value to use is 300. If the number of iterations exceeds this number TooManyUniDimensionalIterationsException will be thrown.
UniDimensionalException - thrown if the delivered function does not implement
Derivative or an interface which extends Derivative.
InvalidUniDimensionalFunctionException - thrown if the user function returns invalid values
like infinity or NaN.
TooManyUniDimensionalIterationsException - thrown if the number of iterations is greater
than maxIterations.
RemoteException
public double globalExtremeDeriv(ExtremumTypes extremumType,
double lowerBound,
double upperBound,
int noSubIntervals,
double tolerance,
BracketingAlgorithm[] bracketingAlgorithm,
LocateAlgorithm[] locateAlgorithm,
int maxIterations)
throws InvalidUniDimensionalFunctionException,
TooManyUniDimensionalIterationsException,
UniDimensionalException,
RemoteException
This method uses a user defined set of bracketing and locate algorithms from which the "best" point
is selected during each iteration in order to improve accuracy in a similar fashion to
seekNextExtreme. However in addition, by varying the noSubIntervals
parameter we are able to ensures that the maximum advancing
step for each iteration will (upperBound - lowerBound) / noSubIntervals, where lowerBound
and upperBound are the end points of the interval over which the global extremum is sought.
These two processes reduce the probability to missing a local extremes which are each candidates
of the global extremum within the interval considered.
Remark: In addition to this method we also offer the method globalExtremeDeriv(int, double, double, int, double int),
which is similar in approach to this method except that we have provide a default set of bracketing
and locate algorithms which are used at each step.
Once the object function has been set you should specify the set of bracketing
and locate algorithms which are used within this method, by passing as parameters the
appropriate procedures from the Enterprise JavaBeans BracketingAlgorithm
and LocateAlgorithm.
Finally the initialPoint from which the closest local extremum will be sought
should be provided along with the type of extremum searched for, the tolerance and the maximum number
of iterations which can be used.
extremumType - indicates the type of extreme searched: in the case of a minimum, extremumType == ExtremumTypes.MINIMUM; and in the case of a maximum, extremumType == ExtremumTypes.MAXIMUM.lowerBound - the coordinate value on the real line of the beginning of the interval over which the global extremum is sought.upperBound - the coordinate value on the real line of the end of the interval over which the global extremum is sought.noSubIntervals - the number of intermediate "safety" points to be used, in order to ensure that the advance steps do not get to large. Note that the larger the parameter the less likely we are to miss any local extremum in the search for the global extremum.tolerance - the tolerance of the result. The actual coordinate value of the extreme will lie in the interval (result - tolerance, result + tolerance). Hence, the value for the tolerance, should reflect the level of accuracy required.bracketingAlgorithm - the bracketing algorithm used selected from the Enterprise JavaBean BracketingAlgorithm.locateAlgorithm - the locate algorithm used selected from the Enterprise JavaBean LocateAlgorithm.maxIterations - the maximum number of iterations which is only used in the iterative locate algorithms, in such cases a reasonable value to use is 300. If the number of iterations exceeds this number TooManyUniDimensionalIterationsException will be thrown.
UniDimensionalException - thrown if the delivered function does not implement
Derivative or an interface which extends Derivative.
InvalidUniDimensionalFunctionException - thrown if the user function returns invalid values like
infinity or NaN.
TooManyUniDimensionalIterationsException - thrown if the number of iterations is greater than
maxIterations.
RemoteException
public double globalExtreme(ExtremumTypes extremumType,
double lowerBound,
double upperBound,
int noSubIntervals,
double tolerance,
int maxIterations)
throws InvalidUniDimensionalFunctionException,
TooManyUniDimensionalIterationsException,
UniDimensionalException,
RemoteException
This method uses its own default set of bracketing and locate algorithms from which the "best" point
is selected during each iteration in order to improve accuracy in a similar fashion to
seekNextExtreme. However in addition, by varying the noSubIntervals
parameter we are able to ensures that the maximum advancing
step for each iteration will (upperBound - lowerBound) / noSubIntervals, where lowerBound
and upperBound are the end points of the interval over which the global extremum is sought.
These two processes reduce the probability to missing a local extremes which are each candidates
of the global extremum being sought within the interval considered.
Remark: In addition to this method we also offer the method globalExtreme(...,BracketingAlgorithm[],...),
which is similar in approach to this method except you are able to set the default set of
bracketing and locate algorithms which are used at each step.
Once the object function has been set you should specify the interval over which the extremum
is sought by providing the upper and lower bounds of the interval. You will also need to provide the
initialPoint, from where the closest local extremum will be sought, the type of extremum sought,
the tolerance and the maximum number of iterations which can be used.
extremumType - indicates the type of extreme searched: in the case of a minimum, extremumType == ExtremumTypes.MINIMUM; and in the case of a maximum, extremumType == ExtremumTypes.MAXIMUM.lowerBound - the coordinate value on the real line of the beginning of the interval over which the global extremum is sought.upperBound - the coordinate value on the real line of the end of the interval over which the global extremum is sought.noSubIntervals - the number of intermediate "safety" points to be used, in order to ensure that the advance steps do not get to large. Note that the larger the parameter the less likely we are to miss any local extremum in the search for the global extremum.tolerance - the tolerance of the result. The actual coordinate value of the extreme will lie in the interval (result - tolerance, result + tolerance). Hence, the value for the tolerance, should reflect the level of accuracy required.maxIterations - the maximum number of iterations which is only used in the iterative locate algorithms, in such cases a reasonable value to use is 300. If the number of iterations exceeds this number TooManyUniDimensionalIterationsException will be thrown.
UniDimensionalException - thrown if the delivered function does not implement
Function or an interface which extends Function
InvalidUniDimensionalFunctionException - thrown if the user function returns invalid values like infinity or NaN.
TooManyUniDimensionalIterationsException - thrown if the number of iterations is greater than maxIterations.
RemoteException
public double globalExtreme(ExtremumTypes extremumType,
double lowerBound,
double upperBound,
int noSubIntervals,
double tolerance,
BracketingAlgorithm[] bracketingAlgorithm,
LocateAlgorithm[] locateAlgorithm,
int maxIterations)
throws InvalidUniDimensionalFunctionException,
TooManyUniDimensionalIterationsException,
UniDimensionalException,
RemoteException
This method uses a user defined set of bracketing and locate algorithms from which the "best" point
is selected during each iteration in order to improve accuracy in a similar fashion to
seekNextExtreme. However in addition, by varying the noSubIntervals
parameter we are able to ensures that the maximum advancing
step for each iteration is: (upperBound - lowerBound) / noSubIntervals, where lowerBound
and upperBound are the end points of the interval over which the global extremum is sought.
These two processes reduce the probability to missing a local extremes which are each candidates
of the global extremum being sought within the interval considered which is being sought.
Remark: In addition to this method we also offer the method globalExtreme(int, double, double, int, double int),
which is similar in approach to this method except that we have provide a default set of bracketing
and locate algorithms which are used at each step.
Once the object function has been set you should specify the set of bracketing
and locate algorithms which are used within this method, by passing as parameters the
appropriate procedures from the Enterprise JavaBeans BracketingAlgorithm
and LocateAlgorithm.
Finally the initialPoint from which the closest local extremum will be sought
within the interval consider, the type of extremum required, the tolerance and the maximum number
of iterations used.
extremumType - indicates the type of extreme searched: in the case of a minimum, extremumType == ExtremumTypes.MINIMUM; and in the case of a maximum, extremumType == ExtremumTypes.MAXIMUM.lowerBound - the coordinate value on the real line of the beginning of the interval over which the global extremum is sought.upperBound - the coordinate value on the real line of the end of the interval over which the global extremum is sought.noSubIntervals - the number of intermediate "safety" points to be used, in order to ensure that the advance steps do not get to large. Note that the larger the parameter the less likely we are to miss any local extremum in the search for the global extremum.tolerance - the tolerance of the result. The actual coordinate value of the extreme will lie in the interval (result - tolerance, result + tolerance). Hence, the value for the tolerance, should reflect the level of accuracy required.bracketingAlgorithm - the bracketing algorithm used selected from the Enterprise JavaBean BracketingAlgorithm.locateAlgorithm - the locate algorithm used selected from the Enterprise JavaBean LocateAlgorithm.maxIterations - the maximum number of iterations which is only used in the iterative locate algorithms, in such cases a reasonable value to use is 300. If the number of iterations exceeds this number TooManyUniDimensionalIterationsException will be thrown.
UniDimensionalException - thrown if the delivered function does not implement
Function or an interface which extends Function; also thrown if you use a bracketing
or locate algorithm which needs derivable functions and your function does not
implement Derivative or an interface which extends it.
InvalidUniDimensionalFunctionException - thrown if the user function returns invalid values like infinity or NaN.
TooManyUniDimensionalIterationsException - thrown if the number of iterations is greater than maxIterations.
RemoteException
|
WebCab Optimization v2.6 (J2EE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||