Documentation
¶
Index ¶
- func CrispMF(x float64) float64
- func EmptyMF(x float64) float64
- type MembershipFunc
- func NewBellMF(a, b, c float64) MembershipFunc
- func NewDiffSigmoidMF(a, b, c, d float64) MembershipFunc
- func NewGaussianComboMF(mu1, sigma1, mu2, sigma2 float64) MembershipFunc
- func NewGaussianMF(mu, sigma float64) MembershipFunc
- func NewSigmoidMF(a, b float64) MembershipFunc
- func NewTrapMF(a, b, c, d float64) MembershipFunc
- func NewTriangleMF(a, b, c float64) MembershipFunc
- type Set
- func (s *Set) AddElement(u, g float64)
- func (s Set) AlphaCut(alpha float64) Set
- func (s Set) Centroid() float64
- func (s Set) Compliment() Set
- func (s Set) Core() Set
- func (s Set) Elements() []float64
- func (s Set) Grade(u float64) float64
- func (s Set) Grades() []float64
- func (s Set) Intersection(other Set) Set
- func (s Set) IsCrisp() bool
- func (s Set) IsEmpty() bool
- func (s Set) IsEqual(other Set) bool
- func (s Set) String() string
- func (s Set) StrongAlphaCut(alpha float64) Set
- func (s Set) Support() Set
- func (s Set) Union(other Set) Set
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MembershipFunc ¶
MembershipFunc type
func NewDiffSigmoidMF ¶
func NewDiffSigmoidMF(a, b, c, d float64) MembershipFunc
NewDiffSigmoidMF func
func NewGaussianComboMF ¶
func NewGaussianComboMF(mu1, sigma1, mu2, sigma2 float64) MembershipFunc
NewGaussianComboMF func
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set struct
func NewCrispSet ¶
NewCrispSet func
Example ¶
s := NewCrispSet([]float64{1, 2, 3, 4}) fmt.Println(s)
Output: {1/1, 1/2, 1/3, 1/4}
func NewEmptySet ¶
func NewEmptySet() Set
NewEmptySet func
Example ¶
s := NewEmptySet() fmt.Println(s)
Output: {}
func NewFuzzySet ¶
NewFuzzySet func
Example ¶
s := NewFuzzySet([]float64{1, 2, 3, 4}, []float64{0.1, 0.2, 0.3, 0.4}) fmt.Println(s)
Output: {0.1/1, 0.2/2, 0.3/3, 0.4/4}
func NewFuzzySetFromMF ¶
func NewFuzzySetFromMF(u []float64, m MembershipFunc) Set
NewFuzzySetFromMF func
Example ¶
a := NewFuzzySetFromMF([]float64{1, 2, 3, 4}, EmptyMF) b := NewFuzzySetFromMF([]float64{1, 2, 3, 4}, CrispMF) c := NewFuzzySetFromMF( []float64{1, 2, 3, 4}, func(x float64) float64 { return 0.5 }, ) d := NewFuzzySetFromMF( []float64{0, 1, 2, 3, 4, 5}, NewTrapMF(0, 2, 3, 5), ) fmt.Println(a) fmt.Println(b) fmt.Println(c) fmt.Println(d)
Output: {0/1, 0/2, 0/3, 0/4} {1/1, 1/2, 1/3, 1/4} {0.5/1, 0.5/2, 0.5/3, 0.5/4} {0/0, 0.5/1, 1/2, 1/3, 0.5/4, 0/5}
Click to show internal directories.
Click to hide internal directories.