54 "The \"SAMPLING\" statement defines methods used for the optimizer in sample mode.")
58 (
"TYPE",
"Distribution type.", {
"UNIFORM_INT",
"UNIFORM",
"GAUSSIAN",
"FROMFILE",
"LATIN_HYPERCUBE"});
61 (
"VARIABLE",
"Name of design variable");
64 (
"SEED",
"seed for random sampling");
67 (
"FNAME",
"File to read from the sampling points");
70 (
"N",
"Number of sampling points", 1);
73 (
"RANDOM",
"Whether sequence should be sampled randomly (default: false)",
false);
76 (
"STEP",
"Increment for randomized sequences (default: 1)", 1.0);
100 if (sampling ==
nullptr) {
102 "OpalSample \"" +
name +
"\" not found.");
114 if ( lower >= upper )
116 "Lower bound >= upper bound.");
127 if (
type ==
"UNIFORM_INT") {
129 }
else if (
type ==
"UNIFORM") {
131 }
else if (
type ==
"GAUSSIAN") {
133 }
else if (
type ==
"FROMFILE") {
139 if (
type ==
"UNIFORM_INT") {
145 }
else if (
type ==
"UNIFORM") {
151 }
else if (
type ==
"GAUSSIAN") {
157 }
else if (
type ==
"FROMFILE") {
161 }
else if (
type ==
"LATIN_HYPERCUBE") {
167 }
else if (
type ==
"RANDOM_SEQUENCE_UNIFORM_INT") {
177 }
else if (
type ==
"RANDOM_SEQUENCE_UNIFORM") {
Attribute makeBool(const std::string &name, const std::string &help)
Make logical attribute.
double getReal(const Attribute &attr)
Return real value.
Attribute makePredefinedString(const std::string &name, const std::string &help, const std::initializer_list< std::string > &predefinedStrings)
Make predefined string attribute.
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
bool getBool(const Attribute &attr)
Return logical value.
std::string getString(const Attribute &attr)
Get string value.
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
int seed
The current random seed.
boost::function< boost::tuple< double, bool >arguments_t)> type
double FromFile(std::string file, const std::vector< double > &referencePoint)
The base class for all OPAL definitions.
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const
std::vector< Attribute > itsAttr
The object attributes.
Object * find(const std::string &name)
Find entry.
static OpalData * getInstance()
static OpalSample * find(const std::string &name)
Find sampling method.
void initialize(const std::string &dvarName, double lower, double upper, size_t modulo=1, bool sequence=false)
unsigned int getSize() const
std::shared_ptr< SamplingMethod > sampleMethod_m
virtual void execute()
Check the OpalSample data.
virtual OpalSample * clone(const std::string &name)
Make clone.
std::string getVariable() const
OpalSample()
Exemplar constructor.
The base class for all OPAL exceptions.