本文整理汇总了C++中Problem::allVariablesAreContinuousOrStaticTransformations方法的典型用法代码示例。如果您正苦于以下问题:C++ Problem::allVariablesAreContinuousOrStaticTransformations方法的具体用法?C++ Problem::allVariablesAreContinuousOrStaticTransformations怎么用?C++ Problem::allVariablesAreContinuousOrStaticTransformations使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Problem
的用法示例。
在下文中一共展示了Problem::allVariablesAreContinuousOrStaticTransformations方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: samplesForCentralComposite
int DDACEAlgorithmOptions::samplesForCentralComposite(const Problem& problem) {
if (!problem.allVariablesAreContinuousOrStaticTransformations()) {
LOG(Info,"Problem '" << problem.name() << "' has un-ignorable discrete variables, which "
<< "means that the central composite algorithm cannot be applied.");
return 0;
}
int n = problem.numContinuousVariables();
return 1 + 2*n + static_cast<int>(std::pow(2.0,n));
}
示例2: samplesForBoxBehnken
int DDACEAlgorithmOptions::samplesForBoxBehnken(const Problem& problem) {
if (!problem.allVariablesAreContinuousOrStaticTransformations()) {
LOG(Info,"Problem '" << problem.name() << "' has un-ignorable discrete variables, which "
<< "means that the box-behnken algorithm cannot be applied.");
return 0;
}
int n = problem.numContinuousVariables();
return 1 + n * static_cast<int>(std::pow(2.0,n-1));
}
示例3: setSamplesForGrid
bool DDACEAlgorithmOptions_Impl::setSamplesForGrid(int numGridPartitions,const Problem& problem) {
if (algorithmType() != DDACEAlgorithmType::grid) {
LOG(Info,"This method only applies to the grid algorithm type, but '" << algorithmType()
<< "' is selected.");
return false;
}
if (!problem.allVariablesAreContinuousOrStaticTransformations()) {
LOG(Info,"Problem '" << problem.name() << "' has un-ignorable discrete variables, which "
<< "means that the grid algorithm cannot be applied.");
return false;
}
bool result = setSymbols(numGridPartitions);
result = result && setSamples(static_cast<int>(std::pow((double)numGridPartitions,problem.numContinuousVariables())));
return result;
}
示例4: isCompatibleProblemType
bool DDACEAlgorithm_Impl::isCompatibleProblemType(const Problem& problem) const {
DDACEAlgorithmOptions options = ddaceAlgorithmOptions();
// Some types only work for continuous problems.
if (!problem.allVariablesAreContinuousOrStaticTransformations()) {
switch (options.algorithmType().value()) {
case DDACEAlgorithmType::central_composite :
case DDACEAlgorithmType::box_behnken :
case DDACEAlgorithmType::grid :
LOG(Warn,"DDACE Central Composite, Box-Behnken and Grid algorithms only work with continuous "
<< "variables. (All discrete variables must be down-selected to 0-1 selected "
<< "perturbations.) DesignOfExperiments can be used to run a grid design on discrete "
<< "variables.");
return false;
default :
break;
}
}
return true;
}