本文整理汇总了C++中FuzzyOutput::addMembership方法的典型用法代码示例。如果您正苦于以下问题:C++ FuzzyOutput::addMembership方法的具体用法?C++ FuzzyOutput::addMembership怎么用?C++ FuzzyOutput::addMembership使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FuzzyOutput
的用法示例。
在下文中一共展示了FuzzyOutput::addMembership方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test
void test()
{
float m;
left.reset();
right.reset();
// if obstructionAhead is far then left = fast, right = fast
m = obstructionAhead.is(Distance::FAR);
left.addMembership(Speed::MEDIUM, m);
right.addMembership(Speed::MEDIUM, m);
m = obstructionAhead.is(Distance::CLOSE);
left.addMembership(Speed::SLOW, m);
right.addMembership(Speed::SLOW, m);
// if obstructionAhead is close and betterDirection is left then left = slow, right = fast
m = betterDirection.is(Direction::LEFT);
left.addMembership(Speed::SLOW, m);
right.addMembership(Speed::FAST, m);
m = betterDirection.is(Direction::RIGHT);
left.addMembership(Speed::FAST, m);
right.addMembership(Speed::SLOW, m);
printf("Left=%d, Right=%d\n",
left.getCrispValue(),
right.getCrispValue());
}