首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Jess匹配规则不触发

Jess匹配规则不触发
EN

Stack Overflow用户
提问于 2017-12-01 16:03:36
回答 0查看 45关注 0票数 0

我在定义匹配规则时遇到困难。

代码语言:javascript
复制
(defrule set-current  
    ?desAct <- (Actuator (name 0) (StrokeLength ?sl) (Force ?f) 
    (nominalCurrent ?c3)) 
    (test (eq ?c3 0)) ; I have defined this to change only if value is not 
                      ; set yet
    ?act <- (Actuator (inputVoltage ?v1)  ; actuator that has matching slots
    (StrokeLength ?sl1)
    (nominalCurrent ?c1))
    (test (eq ?sl1 ?sl)) ; for same stroke length I want to modify 
                         ; nominalCurrent of ?desAct
    =>
    (modify ?desAct (nominalCurrent ?c1))
    )   

?desAct表示我希望根据某些标准根据其他现有事实更改哪些槽值的事实。我不确定为什么这条规则不会因为以下事实而触发:

代码语言:javascript
复制
f-4   (MAIN::Actuator (name 4) (inputVoltage 12) (Force 17) (StrokeLength 10) (length 62) (width 18) (height 15.1) (motorType DC) (speedAtNomLoad 25) (weight 28) (nominalCurrent 0.46) (highTemp 50) (lowTemp -10) (price 90) (dutyCycle 20))
f-9   (MAIN::Actuator (name 0) (inputVoltage 12) (Force 17) (StrokeLength 10) (length 10) (width 10) (height 10) (motorType DC) (speedAtNomLoad 0) (weight 0) (nominalCurrent 0) (highTemp 0) (lowTemp 0) (price 0) (dutyCycle 0))

我期望与此规则的名称为0的执行器具有与f-4相同的nominalCurrent,但规则不会触发。

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47589017

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档