问题
i am trying to optimize my FIS with the help of a GA, with matlab optimization toolbox. The code looks like this:
function errorr=fun3_2(x)
Name='eleni';
Type='mamdani';
NumInputs='8';
NumOutputs='1';
% NumRules='80';
AndMethod='min';
OrMethod='max';
ImpMethod='min';
AggMethod='max';
DefuzzMethod='centroid';
a=newfis('eleni');
%INPUTS_______________input 1____________
a.input(1).name='ARIAS';
a.input(1).range=[0 1];
a.input(1).mf(1).name='1';
a.input(1).mf(1).type='trimf';
a.input(1).mf(1).params=[x(1) x(2) x(3)];
a.input(1).mf(2).name='2';
a.input(1).mf(2).type='trimf';
a.input(1).mf(2).params=[x(4) x(5) x(6)];
a.input(1).mf(3).name='3';
a.input(1).mf(3).type='trimf';
a.input(1).mf(3).params=[x(7) x(8) x(9)];
.... ...and so on, for totally 8 inputs and 1 output of 10 MFs each.
I insert linear inequalities correctly, so as
0<x(1)<x(2)<x(3)<1
0<x(4)<x(5)<x(6)<1
..etc..
but after 10 or less iterations the process stops and the following error message appers:
Error running optimization. Illegal parameter condition: b > c
Any ideas of what i should do to keep it running?
回答1:
the tables A and B for the linear inequalities, are (assuming only 2 mfs, and then generalize it)
A=[-1 0 0 0 0 0;
1 -1 0 0 0 0;
0 1 -1 0 0 0;
0 0 1 0 0 0;
0 0 0 -1 0 0;
0 0 0 1 -1 0;
0 0 0 0 1 -1;
0 0 0 0 0 1]
B=[0;0;0;1;0;0;0;1]
matrix B is the problem, because ΑΧ<=Β, so in that way it suggests that maybe x1=x2..etc. The equality must be eliminated! Assuming there is a slight difference between the parameters, solves the problem, thus table B must be defined as follows, and the ga runs:
B=[-0.01;-0.01;-0.01;0.99;-0.01;-0.01;-0.01;0.99]
来源:https://stackoverflow.com/questions/32199593/optimization-of-fis-membership-functions-via-ga