摘要
描述了如何使用面向对象语言Java来设计启发式搜索算法。该设计充分利用Java语言的继承、封装和多态等特征,遵循开-闭原则、里氏替换原则等重要面向对象的设计原则,抽象化了启发式搜索算法,使得启发式搜索算法成为一个可复用构件。最后,演示了如何使用该可复用构件求解八数码问题。
The paper describes how to design heuristic searching algorithm by using object-oriented language Java. The design uses inheritance,encapsulation and polymorphism, feature of object-oriented technology, follows the principles of the open closed principle,the Liskov substitution principle etc, to make the heuristic searching algorithm a reusable component.At last,demonstrated how to apply it to the puzzle of eight-digit.
出处
《微机发展》
2005年第7期11-13,共3页
Microcomputer Development
关键词
面向对象
启发式搜索
开-闭原则
Object-Oriented
heuristic search
the Open-Closed Pincepal