36 "The \"SAMPLING\" statement defines methods used for the optimizer in sample mode.")
40 (
"TYPE",
"UNIFORM_INT, UNIFORM, GAUSSIAN, FROMFILE, LATIN_HYPERCUBE");
43 (
"VARIABLE",
"Name of design variable");
46 (
"SEED",
"seed for random sampling");
49 (
"FNAME",
"File to read from the sampling points");
52 (
"N",
"Number of sampling points", 1);
55 (
"RANDOM",
"Whether sequence should be sampled randomly (default: false)",
false);
58 (
"STEP",
"Increment for randomized sequences (default: 1)", 1.0);
82 if (sampling ==
nullptr) {
84 "OpalSample \"" + name +
"\" not found.");
98 "Lower bound >= upper bound.");
109 if (type ==
"UNIFORM_INT") {
111 }
else if (type ==
"UNIFORM") {
113 }
else if (type ==
"GAUSSIAN") {
115 }
else if (type ==
"FROMFILE") {
121 "Unknown sampling method: '" + type +
"'.");
124 if (type ==
"UNIFORM_INT") {
130 }
else if (type ==
"UNIFORM") {
136 }
else if (type ==
"GAUSSIAN") {
142 }
else if (type ==
"FROMFILE") {
146 }
else if (type ==
"LATIN_HYPERCUBE") {
152 }
else if (type ==
"RANDOM_SEQUENCE_UNIFORM_INT") {
162 }
else if (type ==
"RANDOM_SEQUENCE_UNIFORM") {
174 "Unknown sampling method: '" + type +
"'.");
int seed
The current random seed.
virtual void execute()
Check the OpalSample data.
The base class for all OPAL definitions.
The base class for all OPAL exceptions.
std::string toUpper(const std::string &str)
unsigned int getSize() const
std::vector< Attribute > itsAttr
The object attributes (see Attribute.hh).
bool getBool(const Attribute &attr)
Return logical value.
static OpalSample * find(const std::string &name)
Find sampling method.
static OpalData * getInstance()
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const
std::string getVariable() const
std::shared_ptr< SamplingMethod > sampleMethod_m
void initialize(const std::string &dvarName, double lower, double upper, size_t modulo=1, bool sequence=false)
Object * find(const std::string &name)
Find entry.
Attribute makeBool(const std::string &name, const std::string &help)
Make logical attribute.
virtual OpalSample * clone(const std::string &name)
Make clone.
double FromFile(std::string file, const std::vector< double > &referencePoint)
double getReal(const Attribute &attr)
Return real value.
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
OpalSample()
Exemplar constructor.
std::string getString(const Attribute &attr)
Get string value.