第一范文网 - 专业文章范例文档资料分享平台

assignment4-pf-问题解答

来源:用户分享 时间:2025/5/26 9:59:18 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

KWIC Implemented with Pipe and Filter Architectural

Style (Assignment 4)

1.

Questions

1. In both modifications of the current system you needed to extend the

functionality of the system. Which modules from the original KWIC system did you need to modify to implement the new functionality in both cases? Does this mean that the pipe and filter KWIC system is robust to design changes in the functionality of the system? Is the same true for any pipe and filter system?

解答:在两种情况下都只需修改原系统中的KWIC模块,即调度控

制模块。这意味着管道过滤器风格的KWIC系统是十分健壮的。但这并不一定适用于所有采用管道过滤器风格的系统。

2. Filters in pipe and filter systems are completely independent entities. Thus,

filters:

a. Do not share state (data) with other filters.

b. Do not know the identity of neighbor filters in the pipeline.

c. Process their data concurrently and incrementally, i.e., they do not

wait for other filters to start or finish their jobs.

Would it be possible to implement an interactive version of the KWIC system, which will allow users to delete certain lines from the data flow but still not violate any of the above defined filter properties?

解答:由于无法获知其它过滤器的状态以及流通与管道中的数据,因

此无法实现交互式的KWIC系统,若想删除特定行,可增加一个用于删除的过滤器。

3. Normally, filters in pipe and filter systems work as follows. They read data

from the input pipe, transform it and write it to the output pipe. Usually, this involves copying of data from the input to the output pipe. If the number of filters in a pipeline of a complex pipe and filter system is large then there is a lot of in-memory data copying. How this may affect the overall system performance?

解答:当有大量管道与过滤器存在时,由于有大量的数据拷贝会消耗

大量内存,这会严重影响系统性能,使系统处理数据的能力降低。

2.KWIC (Pipe and Filter)修改

一、 整体分析

管道过滤器风格的KWIC系统包含KWIC、Pipe、ShiftFilter、Input、Output、LineTransformer、CircularShifter、Alphabetizer几大模块。

其中Input、Output、LineTransformer、CircularShifter、Alphabetizer均为继承自抽象类Filter的过滤器。

调整各类输入、输出流之后,系统结构如下:

Inputin_csCircularShiftercs_sfShiftFiltersf_alOutput

lt_opLineTransformeral_ltAlphabetizer

二、运行结果截图:

1)noise.txt文件截图

Figure 1 noise.txt文件

line.txt文件截图

Figure 2 line.txt文件

程序运行结果截图

搜索更多关于: assignment4-pf-问题解答 的文档
assignment4-pf-问题解答.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c6ts1q0atc792i2o9mdcu_1.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top