没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
试读
204页
Jess(Java Expert System Shell)是一个扩展CLIPS的基于Java平台的规则引擎。它以CLIPS的设计原理为基础进行编写,除继承了CLIPS的优点外,还具有许多自己独特的特征,如支持正向和逆向推理,可以在系统运行环境下直接调用Java的类库等。 尽管Jess可以作为一个独立程序运行,但是常常把Jess库嵌入到Java代码中,通过使用Jess的API或Java规则引擎API(由javax.rules包定义)来实现Jess相应的功能。 本书将详细介绍如何将jess内嵌到eclipse中,已成功在钢铁企业烧结厂专家系统中应用。
资源推荐
资源详情
资源评论
Jess
®
The Rule Engine for the Java
™
Platform
Version 7.1p2
November 5, 2008
© Ernest Friedman-Hill
Sandia National Laboratories
i
Table of Contents
Introduction..........................................................................................................................................1
1. Getting Started..................................................................................................................................3
1.1. Requirements.............................................................................................................................3
1.2. Getting ready.............................................................................................................................4
2. The JessDE Developer's Environment...................................................................................................7
2.1. Installing the JessDE...................................................................................................................7
2.2. Using the JessDE........................................................................................................................8
3. Jess Language Basics.......................................................................................................................11
3.1. Symbols..................................................................................................................................11
3.2. Numbers..................................................................................................................................11
3.3. Strings....................................................................................................................................11
3.4. Lists........................................................................................................................................12
3.5. Comments...............................................................................................................................12
3.6. Calling functions.......................................................................................................................12
3.7. Variables.................................................................................................................................13
3.8. Control flow.............................................................................................................................15
4. Defining Functions in Jess.................................................................................................................17
4.1. Deffunctions.............................................................................................................................17
4.2. Defadvice.................................................................................................................................17
5. Working Memory.............................................................................................................................19
5.1. Templates................................................................................................................................19
5.2. Unordered facts........................................................................................................................21
5.3. Shadow facts: reasoning about Java objects.................................................................................22
5.4. Ordered facts...........................................................................................................................28
5.5. The deffacts construct...............................................................................................................29
5.6. How Facts are Implemented.......................................................................................................29
6. Making Your Own Rules....................................................................................................................31
6.1. Introducing defrules..................................................................................................................31
6.2. Simple patterns........................................................................................................................32
6.3. Patterns in Depth......................................................................................................................34
6.4. Matching in Multislots................................................................................................................36
6.5. Pattern bindings.......................................................................................................................37
6.6. More about regular expressions..................................................................................................38
6.7. Salience and conflict resolution...................................................................................................38
6.8. The 'and' conditional element.....................................................................................................39
6.9. The 'or' conditional element........................................................................................................39
6.10. The 'not' conditional element....................................................................................................40
6.11. The 'exists' conditional element.................................................................................................40
6.12. The 'test' conditional element...................................................................................................41
6.13. The 'logical' conditional element................................................................................................42
6.14. The 'forall' conditional element..................................................................................................43
6.15. The 'accumulate' conditional element.........................................................................................43
6.16. The 'unique' conditional element...............................................................................................45
6.17. Node index hash value.............................................................................................................45
6.18. The 'slot-specific' declaration for deftemplates............................................................................45
6.19. The 'no-loop' declaration for rules..............................................................................................45
6.20. Removing rules.......................................................................................................................45
6.21. Forward and backward chaining................................................................................................46
6.22. Defmodules............................................................................................................................47
7. Querying Working Memory................................................................................................................53
7.1. Linear search............................................................................................................................53
7.2. The defquery construct..............................................................................................................53
7.3. A simple example......................................................................................................................54
ii
7.4. The variable declaration.............................................................................................................56
7.5. The max-background-rules declaration........................................................................................56
7.6. The count-query-results command..............................................................................................56
7.7. Using dotted variables...............................................................................................................56
8. Using Java from Jess........................................................................................................................59
8.1. Java reflection..........................................................................................................................59
8.2. Transferring values between Jess and Java code...........................................................................61
8.3. Implementing Java interfaces with Jess........................................................................................62
8.4. Java Objects in working memory.................................................................................................63
8.5. Setting and Reading Java Bean Properties....................................................................................64
9. Jess Application Design.....................................................................................................................65
9.1. What makes a good Jess application?..........................................................................................65
9.2. Command-line, GUI, or embedded?.............................................................................................65
10. Introduction to Programming with Jess in Java...................................................................................67
10.1. The jess.Rete class..................................................................................................................67
10.2. The jess.JessException class.....................................................................................................71
10.3. The jess.Value class................................................................................................................72
10.4. The jess.Context class.............................................................................................................75
10.5. The jess.ValueVector class........................................................................................................75
10.6. The jess.Funcall class..............................................................................................................76
10.7. The jess.Fact class..................................................................................................................76
10.8. The jess.Deftemplate class.......................................................................................................78
10.9. Parsing Jess code with jess.Jesp................................................................................................79
10.10. The jess.Token class..............................................................................................................80
10.11. The jess.JessEvent and jess.JessListener classes.......................................................................80
10.12. Setting and Reading Java Bean Properties................................................................................82
10.13. Formatting Jess Constructs.....................................................................................................82
11. Embedding Jess in a Java Application................................................................................................85
11.1. Introduction...........................................................................................................................85
11.2. Motivation..............................................................................................................................85
11.3. Doing it with Jess....................................................................................................................85
11.4. Making your own rules.............................................................................................................87
11.5. Multiple Rule Engines...............................................................................................................88
11.6. Jess in a Multithreaded Environment..........................................................................................90
11.7. Error Reporting and Debugging.................................................................................................90
11.8. Creating Rules from Java..........................................................................................................91
12. Adding Commands to Jess...............................................................................................................93
12.1. Writing Extensions...................................................................................................................93
12.2. Writing Extension Packages......................................................................................................95
12.3. Obtaining References to Userfunction Objects.............................................................................96
13. Creating Graphical User Interfaces in the Jess Language.....................................................................97
13.1. Handling Java AWT events........................................................................................................97
13.2. Screen Painting and Graphics....................................................................................................98
14. Jess and XML...............................................................................................................................101
14.1. Introduction.........................................................................................................................101
14.1. Introduction.........................................................................................................................101
14.2. The JessML Language............................................................................................................101
14.3. Writing Constructs in JessML...................................................................................................104
14.4. Parsing JessML......................................................................................................................105
15. The javax.rules API......................................................................................................................107
15.1. Introduction.........................................................................................................................107
15.2. Using javax.rules..................................................................................................................107
16. The Jess Function List...................................................................................................................111
16.1. (- <numeric-expression> <numeric-expression>+)...................................................................111
16.2. (-- <variable>).....................................................................................................................111
16.3. (/ <numeric-expression> <numeric-expression>+)...................................................................111
16.4. (* <numeric-expression> <numeric-expression>+)..................................................................111
16.5. (** <numeric-expression> <numeric-expression>)...................................................................112
16.6. (+ <numeric-expression> <numeric-expression>+)..................................................................112
16.7. (++ <variable>)...................................................................................................................112
16.8. (< <numeric-expression> <numeric-expression>+)..................................................................112
iii
16.9. (<= <numeric-expression> <numeric-expression>+)................................................................112
16.10. (<> <numeric-expression> <numeric-expression>+)..............................................................113
16.11. (= <numeric-expression> <numeric-expression>+)................................................................113
16.12. (> <numeric-expression> <numeric-expression>+)................................................................113
16.13. (>= <numeric-expression> <numeric-expression>+)..............................................................113
16.14. (abs <numeric-expression>)................................................................................................113
16.15. (add <Java object>)............................................................................................................114
16.16. (agenda [<module-name> | *])............................................................................................114
16.17. (and <expression>+)..........................................................................................................114
16.18. (apply <expression>+)........................................................................................................114
16.19. (asc <string>)....................................................................................................................114
16.20. (as-list <java-object>).........................................................................................................115
16.21. (assert <fact>+).................................................................................................................115
16.22. (assert-string <string-expression>).......................................................................................115
16.23. (bag <bag-command> <bag-arguments>+)...........................................................................116
16.24. (batch <filename> [<charset>])...........................................................................................116
16.25. (bind <variable> <expression>)...........................................................................................117
16.26. (bit-and <integer-expression>+)...........................................................................................117
16.27. (bit-not <integer-expression>).............................................................................................118
16.28. (bit-or <integer-expression>+).............................................................................................118
16.29. (bload <filename>).............................................................................................................118
16.30. (break)..............................................................................................................................118
16.31. (bsave <filename>).............................................................................................................118
16.32. (build <string-expression>)..................................................................................................119
16.33. ([call] <java object> | <class-name> <method-name> <argument>*).....................................119
16.34. (call-on-engine <Java object> <jess-code>)..........................................................................120
16.35. (clear)...............................................................................................................................120
16.36. (clear-focus-stack)..............................................................................................................120
16.37. (clear-storage)....................................................................................................................120
16.38. (close <router-identifier>*)..................................................................................................121
16.39. (complement$ <list-expression> <list-expression>)................................................................121
16.40. (context)............................................................................................................................121
16.41. (continue)..........................................................................................................................121
16.42. (count-query-results <query-name> <expression>*)..............................................................121
16.43. (create$ <expression>*)......................................................................................................122
16.44. (defadvice (before | after) (<function-name> | <list> | ALL ) <function-call>+).........................122
16.45. (defclass <template-name> <Java class name> [extends <template-name>])...........................122
16.46. (definstance <template-name> <Java object> [static | dynamic | auto] )..................................122
16.47. (delete$ <list-expression> <begin-integer-expression> <end-integer-expression>)....................123
16.48. (dependencies <fact-id>).....................................................................................................123
16.49. (dependents <fact-id>)........................................................................................................123
16.50. (div <numeric-expression> <numeric-expression>+)..............................................................123
16.51. (do-backward-chaining <template-name>).............................................................................124
16.52. (duplicate <fact-specifier> (<slot-name> <value>)+).............................................................124
16.53. (e)....................................................................................................................................124
16.54. (engine).............................................................................................................................124
16.55. (eq <expression> <expression>+)........................................................................................125
16.56. (eq* <expression> <expression>+)......................................................................................125
16.57. (eval <lexeme-expression>).................................................................................................125
16.58. (evenp <expression>).........................................................................................................125
16.59. (exit).................................................................................................................................125
16.60. (exp <numeric-expression>)................................................................................................126
16.61. (explode$ <string-expression>)............................................................................................126
16.62. (external-addressp <expression>).........................................................................................126
16.63. (fact-id <integer>)..............................................................................................................126
16.64. (facts [<module name> | *])................................................................................................126
16.65. (fact-slot-value <fact-id> <slot-name>)................................................................................127
16.66. (fetch <string or symbol>)...................................................................................................127
16.67. (filter <predicate function> <list>)........................................................................................127
16.68. (first$ <list-expression>).....................................................................................................127
16.69. (float <numeric-expression>)...............................................................................................127
16.70. (floatp <expression>)..........................................................................................................128
16.71. (focus <module-name>+)....................................................................................................128
16.72. (for <initializer> <condition> <increment> <body expression>*).............................................128
16.73. (foreach <variable> <list-expression> <action>*)..................................................................128
16.74. (format <router-identifier> <string-expression> <expression>*)..............................................129
剩余203页未读,继续阅读
dfzow
- 粉丝: 2
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Image_1713714819368.png
- 数据可视化 matplotlib 实例.docx
- Python 使用 Matplotlib 绘制甘特图的实践.docx
- matplotlib 中的 cmap 参数介绍.docx
- 基于matlab的毕业设计基于Matlab使用LQR实现车辆轨迹跟踪源码.zip
- 基于Matplotlib 的高互动性可视化系统设计与实现
- matplotlib 数据可视化报告.docx
- 传统网页UI设计在移动应用开发中的应用研究.pdf
- 基于pytorch实现BERT+BiLSTM+CRF实现中文命名实体识别源码.zip
- 校园帮项目,毕业设计/课程设计/javaWeb/SSM
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页