Strong suspicion I've made the same changes on Ploughwright and on Mason
But I'll get them all into Git then sort them out.
This commit is contained in:
parent
ae26a393e8
commit
792ad6fbfa
|
@ -2,7 +2,7 @@
|
|||
"Knowledge base to use in testing."
|
||||
(:require
|
||||
[arboretum.dengine.case :refer [make-case]]
|
||||
[arboretum.dengine.core :refer [add-dtree! add-feature!]]
|
||||
[arboretum.dengine.core :refer [add-dtree!]]
|
||||
[arboretum.dengine.feature :refer [make-feature]]
|
||||
[arboretum.dengine.kb :refer [!kb]]
|
||||
[arboretum.dengine.node :refer [make-node]]
|
||||
|
@ -37,7 +37,20 @@
|
|||
|
||||
(reset! !kb testkb)
|
||||
|
||||
(add-feature! "Is entitled to Widows' Allowance" :is-entitled-to-widows-allowance false nil)
|
||||
;; TODO:
|
||||
;; we can't add a node in `add-feature!` since creating the root node requires
|
||||
;; that the feature already exists. So the 'rootnode' argument to `add-feature`
|
||||
;; and make-feature is not useful and should be deleted. We also need to test
|
||||
;; when adding a dtree to an existing feature that the rootnode references that
|
||||
;; feature.
|
||||
|
||||
;; OK, it's worse than that. We can't persist and restore a knowledge base in
|
||||
;; which features are directly linked from DTree nodes, since then we would
|
||||
;; (probably) create multiple copies of the feature when reloading. So probably
|
||||
;; the node should only hold the id of the feature, not a direct link.
|
||||
|
||||
;; This does mean, however, that the node could be made at feature creation
|
||||
;; time.
|
||||
|
||||
(add-dtree! :is-entitled-to-widows-allowance
|
||||
(make-node :is-entitled-to-widows-allowance false
|
||||
|
@ -65,7 +78,7 @@
|
|||
"Although your late husband's contributions were sufficient, we understand you have a pension.")
|
||||
(list (make-node :under-pension-age-when-bereaved true
|
||||
"Because you were under pensionable age when bereaved, you are entitled to Widows' Allowance")
|
||||
(make-node :husband-not-entitled-to-cata-rp true
|
||||
"Because your husband was not entitled to a Category A Retirement Pension, you are entitled to Widows' Allowance")))))))
|
||||
(make-node :husband-not-entitled-to-cata-rp true
|
||||
"Because your husband was not entitled to a Category A Retirement Pension, you are entitled to Widows' Allowance")))))))
|
||||
|
||||
(pp/pprint @!kb)
|
||||
|
|
Loading…
Reference in a new issue