|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgenopt.db.IndependentParameter
genopt.db.DiscreteParameter
public class DiscreteParameter
Object that represents a discrete parameter of the optimization process.
discreteType: 0: string 1: integer 2: double
This project was carried out at:
and supported byGenOpt 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.
| Field Summary | |
|---|---|
protected int |
dimension
number of admissible elements |
protected int |
discreteType
flag for native type of elements in values0: string, 1: integer, 2: double |
protected int |
index
current value of the parameter |
protected java.lang.String[] |
values
set of admissible values |
protected double[] |
valuesNum
set of admissible values. |
| Fields inherited from class genopt.db.IndependentParameter |
|---|
name |
| Constructor Summary | |
|---|---|
DiscreteParameter()
constructor. |
|
DiscreteParameter(java.lang.String VariableName,
int InitialValue,
java.lang.String[] Values)
Constructor for a discrete variable. |
|
| Method Summary | |
|---|---|
protected java.lang.Object |
clone()
Clone |
int |
getDiscreteType()
Gets the discrete discreteType, as specified in DiscreteParameter. |
int |
getIndex()
Gets the index that points to the currently selected value. |
double |
getValueDouble()
Gets the double representation of the currently selected value. |
double |
getValueDouble(int ind)
Gets the double representation of the element with index ind. |
java.lang.String |
getValueString()
Gets the string representation of the currently selected value. |
java.lang.String |
getValueString(int ind)
Gets the string representation of the element with index ind. |
int |
length()
Gets the number of elements |
| 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 |
|---|
protected java.lang.String[] values
protected double[] valuesNum
valuesNum is the double representation of values
protected int dimension
protected int discreteType
values
protected int index
| Constructor Detail |
|---|
public DiscreteParameter()
public DiscreteParameter(java.lang.String VariableName,
int InitialValue,
java.lang.String[] Values)
VariableName - Name of the free parameter as specified in the
command fileInitialValue - Index of initial value of free parameterValues - Set of admissible values| Method Detail |
|---|
protected java.lang.Object clone()
clone in class java.lang.Objectpublic final int getIndex()
public final int length()
public final java.lang.String getValueString()
public final java.lang.String getValueString(int ind)
ind.
ind - index of the element
indpublic final double getValueDouble()
public final double getValueDouble(int ind)
ind.ind is returned.
ind - index of the element
indpublic int getDiscreteType()
discreteType, as specified in DiscreteParameter.
discreteType
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||