频道栏目
IT货架 > > 正文
JACK——BOMExercise3
网友分享于:Jun 12, 2018 11:54:26 PM    来源: IT货架   

来源:http://aosgrp.com/

 

Exercise 3

Use the InferenceGoalEvent class instead of BDIGoalEvent.

 

Introduction

In this example, you will use an InferenceGoalEvent instead of the BDIGoalEvent. This illustrates two concepts. The first is the difference between these two types of event (i.e. the InferenceGoalEvent will cause all applicable plans to be executed). Secondly, it shows that there is a separate plan instance generated in the applicable set for each of the possible bindings in the context method. This means that in this example we will see all the subcomponents being printed. A separate plan instance will be responsible for printing the message about each subcomponent.

 

Instructions

1. Modify the FindSubcomponent event so that it is an InferenceGoalEvent and not a BDIGoalEvent.

2. Compile and test the program. The tests should involve at least one component which is composed of four or more subcomponents.

 

示例程序

 

运行结果:

(1) seat is a subcomponent of chair

(2) back is a subcomponent of chair

(3) arm is a subcomponent of chair

(4) leg is a subcomponent of chair

 

运行结果分析

Chair的所有子部件都找到(1)、(2)、(3)和(4)。

广告服务联系QQ:1134687142 | 网站地图

版权所有: IT货架- 内容来自互联网,仅供用于技术学习,请遵循相关法律法规. 京ICP备11030978号-1