求程序注解5 part1

来源:百度知道 编辑:UC知道 时间:2024/06/20 07:48:59
求注释每一句程序。。。太长了一个问题发不出来,麻烦解题的高手连后两个part一起解答一下,谢谢!

using System;
using System.Collections.Generic;

namespace Fuzzy
{

public enum MfCompositionType
{
Min,
Max,
Prod,
Sum
}

public interface IMembershipFunction
{

double GetValue(double x);
}

public class TriangularMembershipFunction : IMembershipFunction
{
double _x1, _x2, _x3;

public TriangularMembershipFunction()
{ }

public TriangularMembershipFunction(double x1, double x2, double x3)
{
if (!(x1 <= x2 && x2 <= x3))
{
throw new ArgumentException();
}

_x1 = x1;
_x2 = x2;
_x3 = x3;
}

public double X1
{

using System;
using System.Collections.Generic;

namespace Fuzzy
{
//定义一个MfCompositionType类型的枚举
public enum MfCompositionType
{
Min,
Max,
Prod,
Sum
}

//创建一个接口
public interface IMembershipFunction
{
//初始化一个GetValue方法.返回类型为double.参数为double类型的
double GetValue(double x);
}
//定义一个TriangularMembershipFunction类.继承于IMembershipFunction
public class TriangularMembershipFunction : IMembershipFunction
{
//声明3个double类型的变量
double _x1, _x2, _x3;
//定义一个无参的构造函数
public TriangularMembershipFunction()
{ }

//定义有参的构造函数.
public TriangularMembershipFunction(double x1, double x2, double x3)
{
//如果(x1 <= x2 && x2 <= x3)不成立..则抛出异常
if (!(x1 <= x2 && x2 <= x3))