genopt.db
Class ContinuousParameter

java.lang.Object
  extended by genopt.db.IndependentParameter
      extended by genopt.db.ContinuousParameter
All Implemented Interfaces:
java.lang.Cloneable

public class ContinuousParameter
extends IndependentParameter

Object that represents a continuous parameter of the optimization process. Note the meaning of field constraints.

Meaning of field constraints:

 1: no under boundary, no upper boundary
 2: under boundary,    no upper boundary
 3: under boundary,    upper boundary
 4: no under boundary, upper boundary 

This project was carried out at:

and supported by

GenOpt Copyright (c) 1998-2011, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.

Version:
GenOpt(R) 3.1.0 (December 8, 2011)

Author:
Michael Wetter

Field Summary
protected  int constraint
          kind of constraint
1: continuous, unconstrained,
2: continuous, lower bounded,
3: continuous, lower and upper bounded,
4: continuous, upper bounded
protected  double maximum
          upper boundary
protected  double minimum
          lower boundary
protected  double original
          value in the original space
protected  double originalStepSize
          step size in the original space
 
Fields inherited from class genopt.db.IndependentParameter
name
 
Constructor Summary
ContinuousParameter()
          constructor.
ContinuousParameter(java.lang.String VariableName, double MinValue, double OriginalValue, double MaxValue, double OriginalStepSize, int Constraint)
          Constructor for a continuous variable.
 
Method Summary
protected  java.lang.Object clone()
          Clone
 int getKindOfConstraint()
          Gets the kind of constraint
 double getMaximum()
          Gets the maximum restriction of the parameter
 double getMinimum()
          Gets the minimum restriction of the parameter
 double getOriginalStepSize()
          Gets the step size in the original space
 double getOriginalValue()
          Gets the parameter value in the original space
static double getTransformedStepSize(double x, double dx, double l, double u, int con, int dir)
          Gets the step size in the transformed space
 double getTransformedValue()
          Gets the parameter value in the transformed space
static double[] transformValue(double[] x, double[] l, double[] u, int[] con, int dir)
          Transforms a value from the original to the transformed space or vice-versa, depending on the value of direction
static double transformValue(double x, double l, double u, int con, int dir)
          Transforms a value from the original to the transformed space or vice-versa, depending on the value of direction
 
Methods inherited from class genopt.db.IndependentParameter
getName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

original

protected double original
value in the original space


minimum

protected double minimum
lower boundary


maximum

protected double maximum
upper boundary


originalStepSize

protected double originalStepSize
step size in the original space


constraint

protected int constraint
kind of constraint
1: continuous, unconstrained,
2: continuous, lower bounded,
3: continuous, lower and upper bounded,
4: continuous, upper bounded

Constructor Detail

ContinuousParameter

public ContinuousParameter()
constructor. Does nothing


ContinuousParameter

public ContinuousParameter(java.lang.String VariableName,
                           double MinValue,
                           double OriginalValue,
                           double MaxValue,
                           double OriginalStepSize,
                           int Constraint)
Constructor for a continuous variable.

Parameters:
VariableName - Name of the free parameter as specified in the command file
MinValue - Minimum of free parameter
OriginalValue - Initial value of free parameter in orginal space
MaxValue - Maximum of free parameter
OriginalStepSize - Step size in original space
Constraint - Integer that specifies the kind of parameter constraints
1: continuous, unconstrained,
2: continuous, lower bounded,
3: continuous, lower and upper bounded,
4: continuous, upper bounded
Method Detail

clone

protected java.lang.Object clone()
Clone

Overrides:
clone in class java.lang.Object

getOriginalValue

public final double getOriginalValue()
Gets the parameter value in the original space

Returns:
parameter value in the original space

getTransformedValue

public final double getTransformedValue()
Gets the parameter value in the transformed space

Returns:
parameter value in the transformed space

getMinimum

public final double getMinimum()
Gets the minimum restriction of the parameter

Returns:
minimum restriction of the parameter

getMaximum

public final double getMaximum()
Gets the maximum restriction of the parameter

Returns:
maximum restriction of the parameter

getOriginalStepSize

public final double getOriginalStepSize()
Gets the step size in the original space

Returns:
step size in the original space

getKindOfConstraint

public final int getKindOfConstraint()
Gets the kind of constraint

Returns:
kind of constraint

transformValue

public static double[] transformValue(double[] x,
                                      double[] l,
                                      double[] u,
                                      int[] con,
                                      int dir)
Transforms a value from the original to the transformed space or vice-versa, depending on the value of direction

Parameters:
x - the value that has to be transformed
l - its minimum value (or any dummy value if not applicable for this type of constraint
u - its minimum value (or any dummy value if not applicable for this type of constraint
con - kind of constraint
dir - 0 if transformation has to be done from original to transformed space, 1 otherwise
Returns:
the transformed value

transformValue

public static double transformValue(double x,
                                    double l,
                                    double u,
                                    int con,
                                    int dir)
Transforms a value from the original to the transformed space or vice-versa, depending on the value of direction

Parameters:
x - the value that has to be transformed
l - its minimum value (or any dummy value if not applicable for this type of constraint
u - its minimum value (or any dummy value if not applicable for this type of constraint
con - kind of constraint
dir - 0 if transformation has to be done from original to transformed space, 1 otherwise
Returns:
the transformed value

getTransformedStepSize

public static double getTransformedStepSize(double x,
                                            double dx,
                                            double l,
                                            double u,
                                            int con,
                                            int dir)
Gets the step size in the transformed space

Parameters:
x - the parameter value in the original space
dx - the step size in the original space
l - its minimum value (or any dummy value if not applicable for this type of constraint
u - its minimum value (or any dummy value if not applicable for this type of constraint
con - kind of constraint
dir - 0 if transformation has to be done from original to transformed space, 1 otherwise
Returns:
step size in the transformed space