【发布时间】:2014-05-28 14:00:19
【问题描述】:
我想使用模糊逻辑框架在 c# 中编写一个小代码,其中用户将输入 0 到 10 之间的数字,并且数字需要分类为低、中和高。 Low 是 0 到 3,Moderate 是 3 到 7,High 是介于 6 到 10 之间。使用三角隶属函数。任何猜测如何做到这一点我阅读了一些关于模糊框架的教程,但无法让我的问题适合那些。以下是我写的代码,
class Program
{
static void Main(string[] args)
{
ContinuousDimension score = new ContinuousDimension("score", "score of word", "unit", 0, 10);
//Definition of basic fuzzy sets with which we will work
// input sets:
ContinuousSet low = new RightQuadraticSet(score, "Low Score", 0, 3, 4);
ContinuousSet high = new LeftQuadraticSet(score, "High Score", 6, 7, 10);
ContinuousSet mod = new BellSet(score, "Moderate Score", 5, 1, 2);
....
}
我现在应该如何继续。我已经手动为意见词分配了一些分数,范围为 0 到 10,我想使用三角函数将此意见词的强度分类为低、中或高。
【问题讨论】:
-
发布您迄今为止编写的代码,并根据您正在处理的确切问题制定一个问题。如果您已经编写了一个工作版本,并且没有特定的错误和异常,请将其发布到代码审查中。
-
我编辑了问题,请重新开始...
标签: c# fuzzy-logic