Пример #1
0
        public int CompareTo(Fuzzy other)
        {
            var result = this < other ? -1 : this > other ? 1 : 0;

            return(result);
        }
Пример #2
0
        public static Fuzzy operator *(Fuzzy left, Fuzzy right)
        {
            var res = new Fuzzy(Math.Min(Math.Max(left.Value * right.Value, 0.0), 1.0));

            return(res);
        }
Пример #3
0
 public static Func <TParameter, Fuzzy> Mult <TParameter>(this Func <TParameter, Fuzzy> first, Fuzzy second) => ctx => first(ctx) * second;
Пример #4
0
 public bool Equals(Fuzzy other)
 {
     return(Math.Abs(Value - other.Value) < Epsilon);
 }
Пример #5
0
 public static Func <TParameter, Fuzzy> Xor <TParameter>(this Func <TParameter, Fuzzy> first, Fuzzy second) => ctx => first(ctx) ^ second;
Пример #6
0
 public static Fuzzy Mult(this Fuzzy first, Fuzzy second) => first * second;
Пример #7
0
 public static Fuzzy Xor(this Fuzzy first, Fuzzy second) => first ^ second;
Пример #8
0
 public static Func <TParameter, Fuzzy> Xor <TParameter>(this Fuzzy first, Func <TParameter, Fuzzy> second) => ctx => first ^ second(ctx);
Пример #9
0
 public static Func <TParameter, Fuzzy> And <TParameter>(this Func <TParameter, Fuzzy> first, Func <TParameter, bool> second) => ctx => first(ctx) & Fuzzy.Create(second(ctx));
Пример #10
0
 public static Fuzzy Or(this Fuzzy first, Fuzzy second) => first | second;
Пример #11
0
 public static Fuzzy And(this Fuzzy first, Fuzzy second) => first & second;
Пример #12
0
 public static Func <TParameter, Fuzzy> Not <TParameter>(Func <TParameter, bool> func) => ctx => Fuzzy.Create(!func(ctx));
Пример #13
0
 public static Fuzzy Not(this Fuzzy value) => !value;
Пример #14
0
 public static Func <TParameter, Fuzzy> Is <TParameter>(Func <TParameter, bool> f) => ctx => Fuzzy.Create(f(ctx));
Пример #15
0
 public static Func <TParameter, Fuzzy> Is <TParameter>(Fuzzy val) => ctx => val;