当前位置: 首页>>代码示例>>C++>>正文


C++ Problem::allVariablesAreContinuousOrStaticTransformations方法代码示例

本文整理汇总了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));
}
开发者ID:jtanaa,项目名称:OpenStudio,代码行数:9,代码来源:DDACEAlgorithmOptions.cpp

示例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));
}
开发者ID:jtanaa,项目名称:OpenStudio,代码行数:9,代码来源:DDACEAlgorithmOptions.cpp

示例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;
 }
开发者ID:jtanaa,项目名称:OpenStudio,代码行数:15,代码来源:DDACEAlgorithmOptions.cpp

示例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;
  }
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:22,代码来源:DDACEAlgorithm.cpp


注:本文中的Problem::allVariablesAreContinuousOrStaticTransformations方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。