人工智能动物识别专家系统Word格式.docx

上传人:b****3 文档编号:16055840 上传时间:2022-11-18 格式:DOCX 页数:13 大小:52.57KB
下载 相关 举报
人工智能动物识别专家系统Word格式.docx_第1页
第1页 / 共13页
人工智能动物识别专家系统Word格式.docx_第2页
第2页 / 共13页
人工智能动物识别专家系统Word格式.docx_第3页
第3页 / 共13页
人工智能动物识别专家系统Word格式.docx_第4页
第4页 / 共13页
人工智能动物识别专家系统Word格式.docx_第5页
第5页 / 共13页
点击查看更多>>
下载资源
资源描述

人工智能动物识别专家系统Word格式.docx

《人工智能动物识别专家系统Word格式.docx》由会员分享,可在线阅读,更多相关《人工智能动物识别专家系统Word格式.docx(13页珍藏版)》请在冰豆网上搜索。

人工智能动物识别专家系统Word格式.docx

该动物是鸟

规则4:

动物会飞,且会下蛋

则:

规则5:

动物吃肉

该动物是肉食动物

规则6:

动物有犬齿,且有爪,且眼盯前方

则:

该动物是食肉动物

规则7:

动物是哺乳动物,且有蹄

该动物是有蹄动物

规则8:

动物是哺乳动物,且是反刍动物

规则9:

动物是哺乳动物,且是食肉动物,且是黄褐色的,且有暗斑点

该动物是豹

规则10:

动物是黄褐色的,且是哺乳动物,且是食肉,且有黑条纹

该动物是虎

规则11:

动物有暗斑点,且有长腿,且有长脖子,且是有蹄类

该动物是长颈鹿

规则12:

动物有黑条纹,且是有蹄类动物

该动物是斑马

规则13:

动物有长腿,且有长脖子,且是黑色的,且是鸟,且不会飞

该动物是鸵鸟

规则14:

动物是鸟,且不会飞,且会游泳,且是黑色的

该动物是企鹅

规则15:

动物是鸟,且善飞

该动物是信天翁

六.推理树

规则1

七.代码

#include<

string.h〉

math.h>

#include〈stdio.h〉

iostream。

h〉

#defineTrue1

#defineFalse0

#defineDontKnow-1

char*str[]={”chew_cud反刍动物”,"

hooves蹄类动物"

"

mammal哺乳动物”,”forward_eyes眼盯前方"

”claws有爪”,”pointed_teeth有犬齿"

”eat_meat吃肉"

lay_eggs会下蛋"

fly会飞"

”feathers有羽毛”,”ungulate有蹄"

carnivore食肉动物”,"

bird鸟"

give_milk能产奶”,

"

has_hair有毛发"

,”fly_well善飞”,”black&white_color黑白色"

,”can_swim会游泳”,

long_legs长腿"

,”long_neck长脖子”,"

black_stripes黑条纹”,"

dark_spots黑斑点”,

”tawny_color黄褐色"

albatross信天翁"

”penguin企鹅"

”ostrich驼鸟”,”zebra斑马"

”giraffe长颈鹿"

,"

tiger老虎"

”cheetah猎豹”,0};

intrulep[][6]={{22,23,12,3,0,0},{21,23,12,3,0,0},{22,19,20,11,0,0},

{21,11,0,0,0,0},{17,19,20,13,—9,0},{17,18,13,—9,0,0},{16,13,0,0,0,0},

{15,0,0,0,0,0},{14,0,0,0,0,0},{10,0,0,0,0,0},{8,7,0,0,0,0},

{7,0,0,0,0,0},{4,5,6,0,0,0},{2,3,0,0,0,0},{1,3,0,0,0,0}};

intrulec[]={30,29,28,27,26,25,24,3,3,13,13,12,12,11,11,0};

classfact

{private:

intNumber;

charName[21];

intActive;

intSucc;

public:

fact*Next;

fact(intNum,char*L)

{

strcpy(Name,L);

Number=Num;

Active=False;

Succ=DontKnow;

Next=NULL;

char*GetName()

char*L;

L=newchar[21];

strcpy(L,Name);

returnL;

}

intGetNumber()

returnNumber;

intGetAct()

returnActive;

intGetSucc()

returnSucc;

voidPutAct(constintAct0,intSuc0)

Active=Act0;

Succ=Suc0;

};

fact*Fact;

classlist

{private:

intNumber;

list*Next;

list(intNum)

Number=Num;

};

classrule

char*Name;

list*Pre;

intConc;

rule*Next;

rule(char*N,intP[],intC);

~rule();

intQuery();

voidGetName()

cout〈<

Name;

rule:

~rule()

list*L;

while(Pre)

L=Pre—〉Next;

deletePre;

Pre=L;

deleteName;

rule(char*N,intP[],intC)

inti;

list*L;

Pre=NULL;

Name=newchar[strlen(N)+1];

strcpy(Name,N);

i=0;

while(P[i]!

=0)

L=newlist(P[i++]);

L->

Next=Pre;

Pre=L;

Conc=C;

intrule:

Query()

charc;

intTag=0;

fact*F;

F=Fact;

L=Pre;

if(L==NULL)

\nError”;

while(L!

=NULL)

F=Fact;

for(;

;

if(abs(L—>

GetNumber())==F—〉GetNumber())

break;

F=F->

Next;

if(L—>

GetNumber()〉0)

if((F—〉GetSucc())==true){L=L->

Next;

continue;

if((F-〉GetSucc())==false)returnfalse;

else

if((F->

GetSucc())==True)

returnFalse;

if((F—>

GetSucc())==False)

L=L—〉Next;

continue;

cout<

〈F-〉GetName()〈〈”(Y/N)"

〈〈endl;

c=getchar();

flushall();

if((c=='

Y’)||(c==’y'

))

if(L->

GetNumber()>

0)

F—>

PutAct(1,True);

GetNumber()<

F—〉PutAct(1,True);

Tag=—1;

if(L—〉GetNumber()<

F-〉PutAct(—1,False);

F-〉PutAct(—1,False);

Tag=-1;

returnFalse;

L=L-〉Next;

for(;

if(Conc==F-〉GetNumber())

break;

if(Conc〈24)

F—〉PutAct(1,True);

if(Tag!

=—1)

if(Conc==F->

GetNumber())

F->

PutAct(1,True);

〈"

\nThisaniamalis"

〈<

GetName()〈<

endl;

returnTrue;

intmain()

fact*F,*T;

rule*Rule,*R;

charch[8];

inti=1;

Fact=NULL;

while(str[i—1])

F=newfact(i,str[i-1]);

Next=Fact;

Fact=F;

i++;

Fact=NULL;

while(F)

T=F;

F=F—〉Next;

T->

Fact=T;

ch[0]=’R’;

ch[1]=’U'

ch[2]='

L'

ch[3]=’E'

ch[4]='

_'

ch[5]='

a’;

ch[6]=’\0'

Rule=NULL;

for(i=0;

i〈15;

i++)

R=newrule(ch,rulep[i],rulec[i]);

R->

Next=Rule;

Rule=R;

ch[5]++;

R=Rule;

i=R—〉Query();

if((i==1)||(i==-1))

R=R—〉Next;

if(!

R)

if(!

cout〈〈”没有这种动物。

”<

<

endl;

〈”pressanykeytoexit。

”〈〈endl;

getchar();

八.截图

 

九.感想

通过这次课程设计我对专业课的学习有了更加深刻的认识,让我知道了学无止境的道理。

我们每一个人永远不能满足于现有的成就,人生就像在爬山,一座峰的后面还有更高的山峰在等着你.挫折是一份财富,经历是一份拥有。

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 解决方案 > 营销活动策划

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1