欢迎来到冰点文库! | 帮助中心 分享价值,成长自我!
冰点文库
全部分类
  • 临时分类>
  • IT计算机>
  • 经管营销>
  • 医药卫生>
  • 自然科学>
  • 农林牧渔>
  • 人文社科>
  • 工程科技>
  • PPT模板>
  • 求职职场>
  • 解决方案>
  • 总结汇报>
  • ImageVerifierCode 换一换
    首页 冰点文库 > 资源分类 > DOCX文档下载
    分享到微信 分享到微博 分享到QQ空间

    动物识别系统实验报告.docx

    • 资源ID:13460338       资源大小:141.33KB        全文页数:67页
    • 资源格式: DOCX        下载积分:5金币
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录
    二维码
    微信扫一扫登录
    下载资源需要5金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP,免费下载
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    动物识别系统实验报告.docx

    1、动物识别系统实验报告动物识别系统实验报告题目:基于web的动物识别系统 院系: 信科院计算机系日期:2013年10月31日 1. 实验目的及开发工具. 1 2. 实验原理. 1 3. 数据库设计. 1 3.1 数据库设计思想 . 1 3.2 数据库系统结构 . 2 4. 系统设计. 2 4.1系统首页 . 3 4.2 动物识别 . 4 4.3 添加规则 . 6 4.4 删除规则 . 10 5. 实验心得.11 6. 实验总结.11 1. 实验目的及开发工具 编写一个基于WEB的动物识别系统,实现对动物的识别,理解产生式表达式;熟悉产生式系统的基本过程;熟悉ASP.NET与数据库结合。 本系统采

    2、用的开发工具为SQL server 2005,Visual Studio 2008 ,程序设计语言为ASP.NET2.0 , C# 。 2. 实验原理 产生式系统是把一组产生式放在一起,并让它们相互配合,协同作用,一个产生式的结论可以供另一个产生式作为已知事实使用,以求得问题的解决。产生式的基本形式为P Q或者if P then Q 产生式规则分析如下: 动物识别系统的部分推理网络 3. 数据库设计 3.1 数据库设计思想 通过以上分析,我们建立了一个DBai数据库,其中存放两张表,分别是条件表Condition和规则表principle。 1 表1 :条件表Condition 项目名 数据结

    3、构 说明 ConditionID Int 编号,主键 ConditionContent Varchar(20) 条件内容 表2:规则表principle 项目名 数据结构 说明 RuleID Int 编号,主键 Condition1 Int 条件1编号 Condition2 Int 条件2编号 Condition3 Int 条件3编号 Condition4 Int 条件4编号 Condition5 Int 条件5编号 Conclusion Int 结论 3.2 数据库系统结构 条件表是一个用来存放与求解问题有关的各种当前信息的数据结构。例如问题的初始状态、输入的事实、推理得到的中间结论和最终结

    4、论。 规则表是一个用来存放与求解问题有关的所有规则的集合,也称为知识库。它包含了问题从初始状态转换成目标状态所需要的所有变换规则。 在推理过程中,当规则表中某条规则的前提可以和综合数据库中的已知事实相匹配时,该规则被激活。由它推出的结论将被作为新的事实放入数据库,称为后面推理的已知事实。所以数据库系统结构如下: 数据库 条件表 规则表 4. 系统设计 本系统分为三个功能模块,分别是动物识别、添加规则、删除规则。系统2 实现如下,其中distinguish.aspx实现动物识别;Addrule.aspx实现添加规则;Deleterule.aspx实现删除规则;主页实现为main.aspx和top

    5、.aspx;连接数据库调用DBFunction.cs。 4.1系统首页 在浏览器上显示动物识别系统的首页如下图所示。 3 连接数据库的关键代码: public DBFunction(DBTransactionType TranType) string Constring = server=;uid=dbai;pwd=syssys;database=dbai; _con = new SqlConnection(Constring); try _con.Open(); _cmd = _con.CreateCommand(); if (TranType = DBTransactionType.Wit

    6、hTran) _tran = _con.BeginTransaction(); _cmd.Transaction = _tran; catch (Exception ex) throw ex; 4.2 动物识别 单击“动物识别”按钮,页面跳转后可根据条件对动物进行判别,比如选择“有羽毛”,点击“查询”按钮,则系统显示识别的结果,如下图所示: 主要源代码: using (DBFunction DBfun = new DBFunction(DBTransactionType.NonTran) 4 /查询在这次用户选择的所有的规则能够得到的所有的规则,将这些规则的所有结论都放到congditions

    7、中,作为其他的条件。 dt = DBfun.ExecforQuery(select * from principle); int l = 5; int test = 0; while (l 0) for (i = 0; i dt.Rows.Count; i+) string sql_condition_chosen = find_sql(chosen); DataTable dt_conditions = DBfun.ExecforQuery(sql_condition_chosen); bool check = true; for (int j = 1; j 6; j+) if (dt.Ro

    8、wsij.ToString() = ) else if (!is_in(dt.Rowsij.ToString().Trim(), dt_conditions) check = false; break; if (check = true & rule_is_choseni = false test = 1; string to_exe; DataTable dt_temp = null; result += 从 ; to_exe = string.Format(select * from Condition a,Condition b where a.ConditionIDb.Conditio

    9、nID and b.ConditionContent=0, dt.RowsiConclusion.ToString(); dt_temp = DBfun.ExecforQuery(to_exe); int number = dt_temp.Rows.Count; condition_is_chosennumber = true; rule_is_choseni = true; to_exe = string.Format(select ConditionContent from Condition where ConditionID=0 or ConditionID=1 or Conditio

    10、nID=2 or ConditionID=3 or ConditionID=4, dt.RowsiCondition1.ToString(), dt.RowsiCondition2.ToString(), dt.RowsiCondition3.ToString(), 5 dt.RowsiCondition4.ToString(), dt.RowsiCondition5.ToString(); dt_temp = DBfun.ExecforQuery(to_exe); for (int n = 0; n dt_temp.Rows.Count; n+) if (n dt_temp.Rows.Cou

    11、nt - 1) result += dt_temp.RowsnConditionContent.ToString() + 和; else result += dt_temp.RowsnConditionContent.ToString(); result += 可以看出,该动物; to_exe = string.Format(select ConditionContent from Condition where ConditionID=0, dt.RowsiConclusion.ToString(); dt_temp = DBfun.ExecforQuery(to_exe); result

    12、+= dt_temp.Rows0ConditionContent.ToString() + nn; rule_is_choseni = true; string conclu = string.Format(select * from Condition where ConditionID0, dt.RowsiConclusion.ToString(); dt_temp = DBfun.ExecforQuery(conclu); int number_of_rule = dt_temp.Rows.Count; chosennumber_of_rule = number_of_rule; l-;

    13、 if (test = 0) result += 从所选条件不能推出任意结论; this.TextBox1.Text = result; 4.3 添加规则 如果对规则库进行添加,可单击“添加规则”按钮,输入需要添加的条件和结论即可。 6 主要源代码: /添加已经在数据库中的项 for (int j = 0; j 0 & numbers = 5) string sql_insert = insert into principle(Condition1,Condition2,Condition3,Condition4,Condition5,Conclusion)values(; while (co

    14、nditionposition + 1 != -1) sql_insert += conditionposition + 1.ToString() + ,; position+; for (int pos = position + 1; pos 5) this.Literal1.Text=不能选择超过5个条件; else if (numbers = 0) this.Literal1.Text = 至少要有一个前件; else this.Literal1.Text = 不能没有结论; 4.4 删除规则 单击“删除规则”按钮,可实现对规则的删除操作。 主要源代码: protected void B

    15、utton1_Click(object sender, EventArgs e) int a = this.GridView1.SelectedIndex; int rule_id_to_deletel; using (DBFunction Dbfun = new DBFunction(DBTransactionType.NonTran) 10 DataTable dt = Dbfun.ExecforQuery(select * from principle); rule_id_to_deletel = Convert.ToInt32(dt.RowsaRuleID.ToString(); Dbfun.ExecForNonQuery(string.Format(delete from principle where RuleID=0, rule_id_to_deletel); Response.Redirect(Deleterule.aspx); 5. 实验心得 甘庆晴:通过本次实验,我掌握了人工智能的产生式表达式,熟悉产生式系统的基本过程。小组分工后我主


    注意事项

    本文(动物识别系统实验报告.docx)为本站会员主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2023 冰点文库 网站版权所有

    经营许可证编号:鄂ICP备19020893号-2


    收起
    展开