专家系统clips程序设计报告

上传人:ss****gk 文档编号:208875835 上传时间:2021-11-08 格式:DOC 页数:23 大小:484.87KB
返回 下载 相关 举报
专家系统clips程序设计报告_第1页
第1页 / 共23页
专家系统clips程序设计报告_第2页
第2页 / 共23页
专家系统clips程序设计报告_第3页
第3页 / 共23页
专家系统clips程序设计报告_第4页
第4页 / 共23页
专家系统clips程序设计报告_第5页
第5页 / 共23页
点击查看更多>>
资源描述

《专家系统clips程序设计报告》由会员分享,可在线阅读,更多相关《专家系统clips程序设计报告(23页珍藏版)》请在金锄头文库上搜索。

1、专家系统与决策支持系统课程期末考查实验报告学号成绩:膳食葡萄酒推荐专家膳食摘要:本实验以Clips 6.3为开发平台,结合专家系统相关知识,编写专家系统 葡萄酒推荐专家”,R在根据膳食结构以及用户喜好来推荐合适的葡萄洒。关键词:葡萄酒;膳食;专家系统;ClipsH录1专家系统描述441.2输入、输出、数据库、规则定义41.3程序流程82专家系统编写过程92.1模块定义9MAIN 模块9QUESTIONS 模块10WINE-QUESTIONS 模块11RULES 模块12CHOOSE-QUALITIES 模块14WINES 模块18PRINT-RESULTS 模块192.9编程总结193系统模拟

2、运行203.1模式选择203.2力喊20龍203.3开始运行213.4回答问题213.5输出葡萄酒清单223.6运行总结221专家系统描述1.1用途膳食葡萄洒筛选专家用于根据膳食结构以及用户喜好来为用户筛选合适的葡萄洒。系统在了解用户膳食的主要成分、调味汁、UI味,以及用户对葡萄洒的洒体、颜色、甜 度的苒好之沿,通过推理机的筛选,最终给川户推荐合适的葡萄酒。1.2输入、输出、数据库、规则定义1.2.1输入定义系统输入为通过句用户提问的7/式与用户进行交互得到输入信息,输入的信息为用户膳 食的主要成分、凋味汁、U味,以及川户对葡萄洒的洒体、颜色、甜度的喜好。具体的变量 名称及4选属性如下图:变量

3、名含义可选属性main-component主要成分meat,fish,poultryhas-sauce是否有调味汁yes,nosauce调味汁spicy, sweet,cream,tomatotastiness口味delicate,average,strongpreferred-body洒体light,medium, fullpreferred-color颜色red, whitepreferred-sweetness甜度dry, medium, sweet备注:当用户不淸楚如何回答时可以回答“unknown”。1.2.2输出定义系统在川户输出完毕后经过推理运兑得到最终结果,为川户推荐合适的葡萄

4、酒,输岀的 结果为按照推荐指数降序输出葡萄酒的名称及推荐指数以供川户参考,中推荐指数在推理 机运算过程中产生,以百分比形式表示。1.2.3数据库定义系统在进行推理机运算过程中,需耍调用数据库,这个数据库存储葡萄洒的详细信息,主要包括葡萄酒的名称、颜色、洒体以及甜度,详细内容如下表所示:名称name颜色color酒体body甜度sweetnessGamayredmediummedium sweetChabliswhitelightdrySauvignon-BlancwhitemediumdryChardonnaywhitemedium fullmedium drySoavewhitelightm

5、edium dryRieslingwhitelight mediummedium sweetGeverztraminerwhitefullanyChenin-Blancwhitelightmedium sweetValpolicellaredlightanyCabemet-Sauvignonredanydry mediumZinfandelredanydry mediumPinot-NoirredmediummediumBurgundyredfullany1.2.4规则定义筛选葡萄酒推理机的规则递循if-then规则,主要根据葡萄洒数据炸的变量数量分为二个模块:筛选合适酒体的规则、筛选合适颜色

6、的规则、筛选合适甜度的规则。其中certainty 表示推荐指数,单位为(1) 筛选合适洒体的规则 Rl: if has-sauce is yes and sauce is spicythen best-body is fullR2: iftastiness is delicatethen best-body is light R3: iftastiness is averagethen best-body is light with certainty 30 andbest-body is medium with certainty 60 andbest-body is full with

7、certainty 30 R4: if tastiness is strongthen best-body is medium with certainty 40 andbest-body is full with certainty 8()R5: if has-sauce is yes and sauce is creamthen best-body is medium with certainty 40 andbest-body is full with certainty 60R6: if preferred-body is fullthen best-body is full with

8、 certainty 40R7: ifpreferred-body is mediumthen best-body is medium with certainty 40R8: ifpreferred-body is lightthen best-body is light with certainty 40R9: if preferred-body is light and best-body is fullthen best-body is mediumRIO: if preferred-body is full and best-body is light then best-body

9、is mediumR11: if preferred-body is unknownthen best-body is light with certainty 20 andbest-body is medium with certainty 20 andbest-body is full with certainty 20(2)筛选合适颜色的规则Rl: if main-component is meatthen best-color is red with certainty 90R2: if main-component is poultry and has-turkey is no th

10、en best-color is white with certainty 90 andbest-color is red with certainty 30R3: if main-component is poultry and has-turkey is yesthen best-color is red with certainty 80 andbest-color is white with certainty 50 R4: ifmain-component is fishthen best-color is whiteR5: ifmain-component is-not fish

11、andhas-sauce is yes and sauce is tomatothen best-color is redR6: if has-sauce is yes and sauce is creamthen best-color is white with certainty 40R7: if preferred-color is redthen best-color is red with certainty 40R8: if preferred-color is white)then best-color is white with certainty 40R9: if prefe

12、rred-color is unknownthen best-color is red with certainty 20 andbest-color is white with certainty 20(3) 筛选合适甜度的规则 Rl: if has-sauce is yes and sauce is sweetthen best-sweetness is sweet with certainty 90 andbest-sweetness is medium with certainty 40R2: if preferred-sweetness is drythen best-sweetne

13、ss is dry with certainty 40R3: ifpreferred-sweetness is mediumthen best-sweetness is medium with certainty 40R4: ifpreferred-sweetness is sweetthen best-sweetness is sweet with certainty 40R5: if best-sweetness is sweet and preferred-sweetness is drythen best-sweetness is mediumR6: if best-sweetness

14、 is dry and preferred-sweetness is sweetthen best-sweetness is mediumR7: if preferred-sweetness is unknownthen best-sweetness is dry with certainty 20 andbest-sweetness is medium with certainty 20 and best-sweetness is sweet with certainty 201.3程序流程结束2专家系统编写过程2.1模块定义CLIPS拥耔支持模块化开发的知识基础和执行机构。CLIPS通过defmodule结构来定义 各种模块,将知识痄分块,膳食葡萄洒筛选专家系统定义了7个模块,各个模块在定义之后 通过export语句进行导出,通过import进行妤入。代码如下:(defmodule MAIN (export ?ALL)(defmodule QUESTIONS (import MAIN ?ALL) (export ?ALL)(defmodule WINE-QUESTIONS (import QUESTIONS ?AL

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 其它办公文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号