mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-05-06 19:42:58 +00:00
45 lines
988 B
C#
45 lines
988 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace Esiur.Analysis.Fuzzy
|
|
{
|
|
public class ContinuousSet : INumericalSet<double>
|
|
{
|
|
public MembershipFunction Function { get; set; }
|
|
|
|
public double AlphaCut { get; set; } = double.MaxValue;
|
|
|
|
|
|
|
|
public INumericalSet<double> Intersection(INumericalSet<double> with)
|
|
{
|
|
return new OperationSet(Operation.Intersection, this, with);
|
|
}
|
|
|
|
public INumericalSet<double> Union(INumericalSet<double> with)
|
|
{
|
|
return new OperationSet(Operation.Union, this, with);
|
|
}
|
|
|
|
public ContinuousSet(MembershipFunction function)
|
|
{
|
|
this.Function = function;
|
|
}
|
|
|
|
public double this[double input]
|
|
{
|
|
get
|
|
{
|
|
|
|
var results = Function(input);
|
|
|
|
return results > AlphaCut ? AlphaCut : results;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|