Exemplo n.º 1
0
    static public IFuzzy Complement(IFuzzy A)
    {
        // Copy A so that later changes don't modify
        IFuzzy copy = (IFuzzy)A.Clone();

        // We lose our bounds :(
        return(new DelegateFuzzy((x) =>
                                 1.0f - copy.Membership(x)
                                 , Mathf.NegativeInfinity, Mathf.Infinity));
    }
Exemplo n.º 2
0
    // Lukasiewicz t-norm derived implication
    static public IFuzzy Implication(IFuzzy A, IFuzzy B)
    {
        // Take snapshots of A and B
        IFuzzy copy_A = (IFuzzy)A.Clone();
        IFuzzy copy_B = (IFuzzy)B.Clone();

        // We lose our bounds :(
        return(new DelegateFuzzy((x) =>
                                 Mathf.Min(1 - copy_A.Membership(x) + copy_B.Membership(x), 1),
                                 Mathf.NegativeInfinity, Mathf.Infinity
                                 ));
    }
Exemplo n.º 3
0
    static public IFuzzy Intersection(IFuzzy A, IFuzzy B)
    {
        // Copy A and B so that later changes don't modify this result
        IFuzzy copy_A = (IFuzzy)A.Clone();
        IFuzzy copy_B = (IFuzzy)B.Clone();

        // Compute the new bounds
        float left  = Mathf.Max(A.close_left, B.close_left);
        float right = Mathf.Min(A.close_right, B.close_right);

        return(new DelegateFuzzy((x) =>
                                 Mathf.Min(copy_A.Membership(x), copy_B.Membership(x)),
                                 left, right
                                 ));
    }