Java Doc for BRuleEngine.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » reasoner » rulesys » impl » oldCode » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » RSS RDF » Jena 2.5.5 » com.hp.hpl.jena.reasoner.rulesys.impl.oldCode 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.hp.hpl.jena.reasoner.rulesys.impl.oldCode.BRuleEngine

BRuleEngine
public class BRuleEngine (Code)
Part of the backward chaining rule interpreter. Maintains an agenda containing an ordered list of RuleStates awaiting processing (each RuleState represents the tip of a partially expanded search tree).

This object does the top level scheduling of rule processing. By default it batches up several results from the top rule in the agenda before switching to expand other trees. The size of this batch is adjustable.


author:
   Dave Reynolds
version:
   $Revision: 1.8 $ on $Date: 2008/01/02 12:09:45 $


Field Summary
protected  LinkedListagenda
    
protected  intbatchSize
    
protected  GoalTablegoalTable
    
protected  BackwardRuleInfGraphIinfGraph
    
static  Loglogger
    
protected  longnRulesFired
    
protected  booleanrecordDerivations
    
protected  RuleStoreruleStore
    
protected  booleantraceOn
    

Constructor Summary
public  BRuleEngine(BackwardRuleInfGraphI infGraph, RuleStore rules)
     Constructor.
public  BRuleEngine(BackwardRuleInfGraphI infGraph)
     Constructor.

Method Summary
public  voidaddRule(Rule rule)
     Add a single rule to the store. N.B.
public synchronized  voidappendToAgenda(RuleState rs)
     Append a new rule node to the end of the agenda.
public  voiddeleteAllRules()
     Delete all the rules.
public  voiddeleteRule(Rule rule)
     Remove a single rule from the store. N.B.
public  voiddump()
     Dump an a summary of the goal table state to stdout.
public synchronized  GoalStatefindGoal(TriplePattern goal)
     Find the set of memoized solutions for the given goal and return a GoalState that can traverse all the solutions.
public  ListgetAllRules()
     Return an ordered list of all registered rules.
public  BackwardRuleInfGraphIgetInfGraph()
     Return the rule infernce graph that owns this engine.
public  longgetNRulesFired()
    
public synchronized  voidhalt()
     Stop the current work.
public  booleanisTraceOn()
     Return true if traces of rule firings should be logged.
public synchronized  Triplenext(GoalState topGoalState)
     The main processing loop.
public  RuleStatenextAgendaItem()
     Get next agenda item.
public synchronized  voidprependToAgenda(RuleState rs)
     Prepend a new rule node to the head of the agenda.
public  booleanprocessBuiltin(ClauseEntry clause, Rule rule, BindingEnvironment env)
    
public synchronized  voidreset()
     Clear all tabled results.
public  ListrulesFor(TriplePattern goal)
    
public  voidsetDerivationLogging(boolean recordDerivations)
    
public  voidsetTraceOn(boolean state)
     Set the state of the trace flag.

Field Detail
agenda
protected LinkedList agenda(Code)
a list of active RuleStates to be processed



batchSize
protected int batchSize(Code)
The size of the result batch permitted before a rule should reschedule itself lower on the agenda



goalTable
protected GoalTable goalTable(Code)
The table of all goals



infGraph
protected BackwardRuleInfGraphI infGraph(Code)
The inference graph which is using this engine - used for calling builtins



logger
static Log logger(Code)



nRulesFired
protected long nRulesFired(Code)
performance stats - number of rules fired



recordDerivations
protected boolean recordDerivations(Code)
Set to true to flag that derivations should be logged



ruleStore
protected RuleStore ruleStore(Code)
Indexed version of the rule set



traceOn
protected boolean traceOn(Code)
True if debug information should be written out




Constructor Detail
BRuleEngine
public BRuleEngine(BackwardRuleInfGraphI infGraph, RuleStore rules)(Code)
Constructor.
Parameters:
  infGraph - the parent inference graph which is using this engine
Parameters:
  rules - the indexed set of rules to process



BRuleEngine
public BRuleEngine(BackwardRuleInfGraphI infGraph)(Code)
Constructor. Creates an empty engine to which rules must be added.
Parameters:
  infGraph - the parent inference graph which is using this engine




Method Detail
addRule
public void addRule(Rule rule)(Code)
Add a single rule to the store. N.B. This will invalidate current partial results and the engine should be reset() before future queries.



appendToAgenda
public synchronized void appendToAgenda(RuleState rs)(Code)
Append a new rule node to the end of the agenda.



deleteAllRules
public void deleteAllRules()(Code)
Delete all the rules.



deleteRule
public void deleteRule(Rule rule)(Code)
Remove a single rule from the store. N.B. This will invalidate current partial results and the engine should be reset() before future queries.



dump
public void dump()(Code)
Dump an a summary of the goal table state to stdout. Just debugging, do not use for real.



findGoal
public synchronized GoalState findGoal(TriplePattern goal)(Code)
Find the set of memoized solutions for the given goal and return a GoalState that can traverse all the solutions.
Parameters:
  goal - the goal to be solved a GoalState which can iterate over all of the goal solutions



getAllRules
public List getAllRules()(Code)
Return an ordered list of all registered rules.



getInfGraph
public BackwardRuleInfGraphI getInfGraph()(Code)
Return the rule infernce graph that owns this engine.



getNRulesFired
public long getNRulesFired()(Code)
Return the number of rules fired since this rule engine instance was created and initialized



halt
public synchronized void halt()(Code)
Stop the current work. This is called if the top level results iterator has either finished or the calling application has had enough. We leave any completed results in the GoalTable but clear out the agenda and all non-compelted results.



isTraceOn
public boolean isTraceOn()(Code)
Return true if traces of rule firings should be logged.



next
public synchronized Triple next(GoalState topGoalState)(Code)
The main processing loop. Continues processing agenda items until either a new solution to the top goal has been found or the agenda is empty and so no more solutions are available.
Parameters:
  topGoalState - the top level GoalState whose values are being sought null if all processing is complete and no more solutions areavailable, otherwise returns the next result available for the topGoal.



nextAgendaItem
public RuleState nextAgendaItem()(Code)
Get next agenda item. May do heuristic selection of next item to process.



prependToAgenda
public synchronized void prependToAgenda(RuleState rs)(Code)
Prepend a new rule node to the head of the agenda.



processBuiltin
public boolean processBuiltin(ClauseEntry clause, Rule rule, BindingEnvironment env)(Code)
Process a call to a builtin predicate
Parameters:
  clause - the Functor representing the call
Parameters:
  env - the BindingEnvironment for this call
Parameters:
  rule - the rule which is invoking this call true if the predicate succeeds



reset
public synchronized void reset()(Code)
Clear all tabled results.



rulesFor
public List rulesFor(TriplePattern goal)(Code)
Return a list of rules that match the given goal entry



setDerivationLogging
public void setDerivationLogging(boolean recordDerivations)(Code)
Set to true to enable derivation caching



setTraceOn
public void setTraceOn(boolean state)(Code)
Set the state of the trace flag. If set to true then rule firings are logged out to the Log at "INFO" level.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

w_ww.__j__a__v___a_2___s.___c__om_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.