模糊逻辑FuzzyLogic

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

模糊逻辑FuzzyLogic•In1965LotfiZadeh,aprofessorattheUniversityofCaliforniaBerkeley,wrotehisoriginalpaperlayingoutfuzzysettheory.Zadeh于1965年提出模糊逻辑。Theessenceoffuzzylogicisthateverythingisamatterofdegree.•把传统集合论中由特征函数决定的绝对隶属关系模糊化。•可以取集合[0,1]上的任何值。模糊逻辑FuzzyLogic一个模糊集A是以隶属函数μ(x)来描述,当=1时,x确定性隶属于A;当=0时,x确定性不隶属于A;当=其他值时,隶属程度模糊。Aμ(x)Aμ(x)μ(x)AAExample-1隶属函数年龄μ0305065YMO1年龄在30~65岁之间的人不能确定性地划归某一个子集。Example-2温控器•Astandardhomecentralairconditionerisequippedwithathermostat,whichthehomeownersetstoaspecifictemperature.•带温控器的家庭用中央空调,主人设定一特定温度。高于该温度,则启动风扇;低于该温度,则停止风扇。Example-2温控器•模糊推理过程是由给定的输入值根据模糊规则产生清晰的(非模糊)输出值的过程。温度控制器温度差风扇HowCanYouUseFuzzyLogicinGames?•Youcanusefuzzylogictocontrolbotsorothernonplayercharacterunits.•Youalsocanuseforassessingthreatsposedbyplayers.•Youcanusefuzzylogictoclassifybothplayerandnonplayercharacters.控制系统应用Controlapplications•Controllingtrains•Airconditioning•Heatingsystems•robots知识库模糊化清晰化规则估值被控系统模糊控制器的结构评价威胁程度ThreatAssessment•Inthebattlesimulationgamethecomputerteamoftenhastodeployunitsasdefenseagainstapotentiallythreateningenemyforce.如何用模糊方法对敌人的威胁实施防御?•Range-near,close,far,andveryfar,•Size-tiny,small,medium,large,ormassive.分类Classification•Youwanttorankbothplayerandnonplayercharactersinyourgameintermsoftheircombatprowesssuchashitpoints,armorclass,wimpy,easy,tough,strengthetc.•定义战争勇猛程度-弱、容易、强、很强等。模糊逻辑的基础FuzzyLogicBasics•Thefuzzycontrolorinferenceprocesscomprisesthreebasicsteps:模糊控制或模糊推理过程包含三步:(1)模糊化(2)模糊推理(3)逆模糊化Fuzzification:CrispInputFuzzyInputFuzzyRulesFuzzyOutputDefuzzificationCrispOutputFuzzyprocessoverview模糊化overview-Fuzzification•Thisstepconvertscrispdata(realnumbers)tofuzzydata,thedegreeofmembershipofthecrispinputinpredefinedfuzzysets.模糊化是用精确数值创建模糊变量的过程。以精确数值计算隶属函数值,得到响应的隶属度。•Underweight,overweight,idealweight.模糊化Fuzzification1060CrispvalueFuzzyvalue0.8Example-空调温控器•输入值是-13华氏度•Biggrade=0.25•Mediumgrade=0.75•Smallgrade=0.000.750.25BIGMEDIUMSMALL-20-30-1050-13模糊规则overview-FuzzyRules•Youcancombinetheinputsusinglogical,fuzzyrulestodeterminethedegreetowhicheachruleistrue.对输入数据使用模糊规则得到规则确定性的程度。•IfoverweightANDNOTactivethenfrequentexercise如果某人过重且不活动,则需要经常锻炼。•IfoverweightANDactivethenmoderatediet如果某人过重且活动,则调整饮食。清晰化overview-Defuzzification•Thisprocessoftakingfuzzyoutputmembershipandproducingacorrespondingcrispnumbericaloutputiscalleddefuzzification.•在推理得到的模糊集合中去一个相对最能代表这个模糊集合的单值的过程,称为清晰化或逆模糊化(解模糊或模糊判决)。(1)模糊化Fuzzfication•Inputtoafuzzysystemcanoriginateintheformofcrispnumbers.对模糊系统,输入确切数值。•Forexample,apersonweigha185.3poundsorapersonis6feet1inchtall.•185.3pounds–slightlyoverweight•6feet1inch-tall隶属函数MembershipFunctions•Membershipfunctionsmapinputvariablestoadegreeofmembership,inafuzzyset,between0and1.隶属函数将输入数据转换成模糊集[0,1]之间的隶属度。•Inputvalueslowerthanx0-false•Valueshigherthanx0-true布尔隶属函数Booleanlogicmembershipfunction1.00.0X0FALSETRUE等级隶属函数Grademembershipfunction1.00.0X0FALSETRUEX1Point-slopequationforastraightlinePoint(x0,y0),(x1,y1)•y-y1=m(x-x1)•m=y1-y0x1-x0(x0,y0)(x1,y1)XYPoint-slopequation0xx1-x0x0x1-x01x≤x0x0xx1x≥x1f(x)=example•x0=175,x1=195•Apersonweight=170•0-overweightisfalse•Heisnotweight.•Apersonweight=185•Heisoverweighttoadegreeof0.5.•0.5=(185-175)/(195-175)量化模糊集Qualitativefuzzysets1.00.0UnderweightIdealWeightOverweightUnderweight=adegreeof0ideal=adegreeof0.75overweight=adegreeof0.15三角隶属函数Triangularmembershipfunction1.00.0x0x1x2三角隶属函数Triangularmembershipfunction0xx1-x0x0x1-x01x≤x0x0xx1x=x1f(x)=-xx2-x1x2x2-x1x1xx2+反相等级隶属函数Reversegrademembershipfunction1.00.0x0x1Reversegrademembershipfunction1-xx1-x0x1x1-x00x≤x0x0xx1x≥x1f(x)=+梯形隶属函数Trapezoidmembershipfunction1.00.0x0x1x3x2梯形隶属函数Trapezoidmembershipfunction-xx3-x2x3x3-x2x2xx3+0xx1-x0x0x1-x01x≤x0x0xx1f(x)=-x1≤x≤x2Example-七个模糊集Sevenfuzzysets1.00.0FLLNLCNRRFRCENTER、NEARRIGHT、RIGHT、FARRIGHT、NEARLEFT、LEFT、FARLEFT隶属函数代码描述Fuzzymembershipfunctionsdoublefuzzygrade(doublevalue,doublex0,doublex1){doubleresult=0;doublex=value;if(x=x0)result=0;elseif(x=x1)result=1;elseresult=(x/(x1-x0))-(x0/(x1-x0));returnresult;}隶属函数代码描述Fuzzymembershipfunctionsdoublefuzzyreversegrade(doublevalue,doublex0,doublex1){doubleresult=0;doublex=value;if(x=x0)result=1;elseif(x=x1)result=0;elseresult=(-x/(x1-x0))+(x1/(x1-x0));returnresult;}隶属函数代码描述Fuzzymembershipfunctionsdoublefuzzytriangle(doublevalue,doublex0,doublex1,doublex2){doubleresult=0;doublex=value;if(x=x0)result=0;elseif(x==x1)result=1;elseif((xx0)&&(xx1))result=(x/(x1-x0))-(x0/(x1-x0));elseresult=(-x/(x2-x1))+(x2/(x2-x1));returnresult;}隶属函数代码描述Fuzzymembershipfunctionsdoublefuzzytrapezoid(doublevalue,doublex0,doublex1,doublex2,doublex3){doubleresult=0;doublex=value;if(x=x0)result=0;elseif((x=x1)&&(x=x2))result=1;elseif((xx0)&&(xx1))result=(x/(x1-x0))-(x0/(x1-x0));elseresult=(-x/(x3-x2))+(x3/(x3-x2));returnresult;}保值函数Hedges•Hedgefunctionsaresometimesusedtomodifythedegreeofmembershipreturnedbyamembershipfunction.•VERY(Truth(A))=Truth(A)•NOT_VERY(Truth(A))=Truth(A)•Truth(A)isthedegreeofmembershipofAinsomefuzzyset.20.5(2)模糊规则Fuzzyrules•基本形式:ifAthenB•A-antecedent,orpremise前置条件•B-consequentorconclusion结果或结论模

1 / 66
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功