public void SetInput2()
{
this.Power = new LinguisticVariable("Moc_samochodu", 20, 180);
TrapezoidalFunction function1 = new TrapezoidalFunction(40, 100, TrapezoidalFunction.EdgeType.Right);
FuzzySet set1 = new FuzzySet("mała", function1);
TrapezoidalFunction function2 = new TrapezoidalFunction(70, 100, 130);
FuzzySet set2 = new FuzzySet("średnia", function2);
TrapezoidalFunction function3 = new TrapezoidalFunction(100, 160, TrapezoidalFunction.EdgeType.Left);
FuzzySet set3 = new FuzzySet("duża", function3);
Power.AddLabel(set1);
Power.AddLabel(set2);
Power.AddLabel(set3);
database.AddVariable(Power);
double y1;
double y2;
double y3;
for (float x = 20; x < 180; x += 0.5f)
{
if (Power.GetLabelMembership("mała", x + 0.5f) + Power.GetLabelMembership("mała", x) > 0)
{
y1 = Power.GetLabelMembership("mała", x);
chart5.Series["Mała"].Points.AddXY(x, y1);
}
if (Power.GetLabelMembership("średnia", x + 0.5f) + Power.GetLabelMembership("średnia", x) > 0)
{
y2 = Power.GetLabelMembership("średnia", x);
chart5.Series["Średnia"].Points.AddXY(x, y2);
}
if (Power.GetLabelMembership("duża", x + 0.5f) + Power.GetLabelMembership("duża", x) > 0)
{
y3 = Power.GetLabelMembership("duża", x);
chart5.Series["Duża"].Points.AddXY(x, y3);
}
}
}