bool DDACEAlgorithmOptions_Impl::setSamplesAndSymbolsForOrthogonalArray(int symbols, int multiplier) { if (!((algorithmType() == DDACEAlgorithmType::oas) || (algorithmType() == DDACEAlgorithmType::oa_lhs))) { LOG(Info,"This method only applies to the oas and oas_lhs algorithm types, but '" << algorithmType() << "' is selected."); return false; } bool result(false); if (!((symbols == 4) || isPrime(symbols))) { LOG(Info,"For orthogonal array sampling, symbols must be prime or equal to 4."); return result; } OptionalInt oldSymbols = this->symbols(); result = setSymbols(symbols); if (result) { result = setSamples(multiplier * static_cast<int>(std::pow((double)symbols,2))); if (!result) { if (oldSymbols) { setSymbols(*oldSymbols); } else { clearSymbols(); } } } return result; }
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; }
QVariant ParameterStudyAlgorithmOptions_Impl::toVariant() const { QVariantMap map = AlgorithmOptions_Impl::toVariant().toMap(); map["parameter_study_algorithm_type"] = toQString(algorithmType().valueName()); return QVariant(map); }
QVariant DDACEAlgorithmOptions_Impl::toVariant() const { QVariantMap map = AlgorithmOptions_Impl::toVariant().toMap(); map["ddace_algorithm_type"] = toQString(algorithmType().valueName()); return QVariant(map); }