【发布时间】:2016-05-21 01:35:12
【问题描述】:
根据AddingRuleWithJessTab 中给出的多槽设置示例规则AssertingHasSiblingMulti1,我创建了以下Jess 规则,用于在我的属性foundPollutionSources 上设置多槽值:
(defrule findPHPolluters
(declare (salience 553))
(object
(is-a http..#PollutionSources)
(OBJECT ?sitepoll)
(http..potentialPollutant
$? ?b&:(eq (instance-name ?b)(instance-name http..#pH)) $?)
(http..#pollutionSourceName ?psName)
(http..#pollutionType ?psType)
)
(object
(is-a http..#MeasurementSite)
(OBJECT ?loc)
(http..#hasSourcesOfPollution $?sitepoll_list)
)
(object
(is-a http..#ModeratePHMeasurement)
(OBJECT ?mob)
(http..#observationResultLocation ?loc)
(http..#foundPollutionSources $?existing_poll_list)
)
=>
(if (not (member$ ?sitepoll $?sitepoll_list)) then
(printout t "pH pollution source: " ?psName " (Location: " ?psType ")" crlf)
(slot-set ?mob http..#foundPollutionSources (create$ $?existing_poll_list ?sitepoll))
)
)
但是,当我运行此规则时,会出现以下异常:
Jess 在执行时报告了例程 ValueVector.set 中的错误 规则 LHS (MTELN),同时执行规则 LHS (TECT)。消息:不好 在此向量上调用 set() 时的索引 117:...
【问题讨论】: