CLIPS-控制策略

一、通过定义规则来控制先后,不通过优先级

二、

CLIPS> (ppdeffacts control-information)
(deffacts MAIN::control-information
   (phase detection)
   (phase-after detectionisolation)
   (phase-after isolationrecovery)
   (phase-after recoverydetection))
CLIPS> (ppdefrule change-phase)
(defrule MAIN::change-phase
   (declare (salience -10))
   ?phase <-(phase ?current-phase)
   (phase-after ?current-phase?next-phase)
   =>
   (retract ?phase)
   (assert (phase?next-phase)))
CLIPS> (run 10)
FIRE    1change-phase: f-1591,f-2
<== f-1591  (phase detection)
==> f-1592  (phase isolation)
==> Activation-10   change-phase: f-1592,f-3
FIRE    2change-phase: f-1592,f-3
<== f-1592  (phase isolation)
==> f-1593  (phase recovery)
==> Activation-10   change-phase: f-1593,f-4
FIRE    3change-phase: f-1593,f-4
<== f-1593  (phase recovery)
==> f-1594  (phase detection)
==> Activation-10   change-phase: f-1594,f-2
FIRE    4change-phase: f-1594,f-2
<== f-1594  (phase detection)
==> f-1595  (phase isolation)
==> Activation-10   change-phase: f-1595,f-3
FIRE    5change-phase: f-1595,f-3
<== f-1595  (phase isolation)
==> f-1596  (phase recovery)
==> Activation-10   change-phase: f-1596,f-4
FIRE    6change-phase: f-1596,f-4
<== f-1596  (phase recovery)
==> f-1597  (phase detection)
==> Activation-10   change-phase: f-1597,f-2
FIRE    7change-phase: f-1597,f-2
<== f-1597  (phase detection)
==> f-1598  (phase isolation)
==> Activation-10   change-phase: f-1598,f-3
FIRE    8change-phase: f-1598,f-3
<== f-1598  (phase isolation)
==> f-1599  (phase recovery)
==> Activation-10   change-phase: f-1599,f-4
FIRE    9change-phase: f-1599,f-4
<== f-1599  (phase recovery)
==> f-1600  (phase detection)
==> Activation-10   change-phase: f-1600,f-2
FIRE   10 change-phase:f-1600,f-2
<== f-1600  (phase detection)
==> f-1601  (phase isolation)
==> Activation-10   change-phase: f-1601,f-3
10 rulesfired       Run time is 0.0899999999999181 seconds.
111.111111111212 rules per second.
5 mean number of facts (5 maximum).
1 mean number of instances (1 maximum).
1 mean number of activations (1 maximum).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值