本文整理汇总了C++中OutputVariable::output方法的典型用法代码示例。如果您正苦于以下问题:C++ OutputVariable::output方法的具体用法?C++ OutputVariable::output怎么用?C++ OutputVariable::output使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputVariable
的用法示例。
在下文中一共展示了OutputVariable::output方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: applyDefaults
void Preferences::applyDefaults() {
fl::Engine* engine = Model::Default()->engine();
if (engine->numberOfRuleBlocks() == 0) {
QMessageBox::critical(this, "Error",
"Current engine has no rule blocks. "
"At least one ruleblock was expected.",
QMessageBox::Ok);
return;
}
std::string tnorm = Minimum().className();
std::string snorm = Maximum().className();
std::string activation = Minimum().className();
RuleBlock* ruleblock = engine->getRuleBlock(0);
if (ruleblock->getTnorm()) tnorm = ruleblock->getTnorm()->className();
if (ruleblock->getSnorm()) snorm = ruleblock->getSnorm()->className();
if (ruleblock->getActivation()) activation = ruleblock->getActivation()->className();
std::string defuzzifier = Centroid().className();
int divisions = fl::fuzzylite::defaultDivisions();
std::string accumulation = Maximum().className();
if (engine->numberOfOutputVariables() > 0) {
OutputVariable* variable = engine->getOutputVariable(0);
if (variable->getDefuzzifier()) {
defuzzifier = variable->getDefuzzifier()->className();
divisions = variable->getDefuzzifier()->getDivisions();
}
if (variable->output()->getAccumulation())
accumulation = variable->output()->getAccumulation()->className();
}
engine->configure(tnorm, snorm, activation, accumulation, defuzzifier, divisions);
}
示例2: onChangeAccumulation
void Preferences::onChangeAccumulation(int) {
std::string accumulation = ui->cbx_accumulation->currentText().toStdString();
fl::Engine* engine = Model::Default()->engine();
for (int i = 0; i < engine->numberOfOutputVariables(); ++i) {
OutputVariable* outputVariable = engine->getOutputVariable(i);
outputVariable->output()->setAccumulation(
Factory::instance()->snorm()->create(accumulation));
}
}
示例3: loadFromModel
void Preferences::loadFromModel() {
disconnect();
fl::Engine* engine = Model::Default()->engine();
if (engine->numberOfRuleBlocks() == 0) {
QMessageBox::critical(this, "Error",
"Current engine has no rule blocks. "
"At least one ruleblock was expected.",
QMessageBox::Ok);
return;
}
RuleBlock* ruleblock = engine->getRuleBlock(0);
ui->cbx_tnorm->setCurrentIndex(indexOfTnorm(ruleblock->getTnorm()->className()));
ui->cbx_snorm->setCurrentIndex(indexOfSnorm(ruleblock->getSnorm()->className()));
ui->cbx_activation->setCurrentIndex(indexOfTnorm(ruleblock->getActivation()->className()));
if (engine->numberOfOutputVariables() > 0) {
OutputVariable* variable = engine->getOutputVariable(0);
ui->cbx_defuzzifier->setCurrentIndex(
indexOfDefuzzifier(variable->getDefuzzifier()->className()));
ui->sbx_divisions->setValue(variable->getDefuzzifier()->getDivisions());
ui->cbx_accumulation->setCurrentIndex(
indexOfSnorm(variable->output()->getAccumulation()->className()));
} else {
ui->cbx_defuzzifier->setCurrentIndex(0);
ui->sbx_divisions->setValue(fl::fuzzylite::defaultDivisions());
ui->cbx_accumulation->setCurrentIndex(0);
}
ui->ckx_any->setChecked(engine->hasHedge(Any().name()));
ui->ckx_extremely->setChecked(engine->hasHedge(Extremely().name()));
ui->ckx_not->setChecked(engine->hasHedge(Not().name()));
ui->ckx_seldom->setChecked(engine->hasHedge(Seldom().name()));
ui->ckx_somewhat->setChecked(engine->hasHedge(Somewhat().name()));
ui->ckx_very->setChecked(engine->hasHedge(Very().name()));
connect();
}