Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.stsci.edu/~rdouglas/publications/thesis/chapter2_16.html
Дата изменения: Tue May 13 19:35:10 1997
Дата индексирования: Sat Dec 22 18:54:32 2007
Кодировка:

Поисковые слова: п п п п п п п п п п п п п п п п п п п п п п п п п
Tower Building Objects



Next: List of Rules Up: Rob's Thesis Previous: Sample Run

Tower Building Objects

Appendix - Tower Building Objects

~ ~ This appendix shows the objects which are used in COOL - CLIPS Object Oriented Language - and their relationships to each other. Some of the objects are related by an IS-A relationship. This means that one of the objects is a more specific version of the other. Objects are also related by a COMPOSED-OF relationship, in which an object is composed of instances of other objects, eg. a tower is composed of supports. Figure shows these relationships. Also included in this appendix is a listing of the COOL code which implements these objects and relationships.

;**********************************************************************
; TOYS.CLP - the objects used in SNEAKERS
;**********************************************************************

;***** TOYS in SNEAKERS ****

(defclass TOY (is-a USER)
        (slot time))

;********** POINTS *********

(defclass POINT (is-a TOY)
        (slot x)
        (slot y)
        (slot z))

;*********** PLATFORMS ************

(defclass PLATFORM (is-a TOY)
        (slot shape (allowed-symbols SQUARE TRIANGLE))
        (slot corner1)
        (slot corner2)
        (slot corner3)
        (slot corner4))

;********* SUPPORTS **********

(defclass ROD (is-a TOY)
        (slot start-point)
        (slot end-point))

(defclass BRACE (is-a ROD))

(defclass SUPPORT (is-a ROD)
        (slot length (allowed-integers 1 2 4 6))
        (slot destination)
        (slot material (read-only)(allowed-symbols ALUMINUM STEEL WOOD))
        (slot cost)
        (slot weight)
        (slot durability (read-only))
        (slot strength (read-only))
        (slot manufact-time (read-only))
        (slot disposal-cost (read-only))
        (slot illegal-connectors (multiple)(read-only) 
                (allowed-symbols WELD BOLT SNAP)))

(defclass ALUMINUM-ROD (is-a SUPPORT)
        (slot material (composite)(default ALUMINUM))
        (slot cost (default 8))
        (slot weight (default 3))
        (slot durability (composite) (default 6))
        (slot strength (composite) (default 4))
        (slot manufact-time (composite) (default 2))
        (slot disposal-cost (composite) (default 1))
        (slot illegal-connectors (composite)))

(defclass STEEL-ROD (is-a SUPPORT)
        (slot material (composite)(default STEEL))
        (slot cost (default 2))
        (slot weight (default 10))
        (slot durability (composite) (default 3))
        (slot strength (composite)(default 10))
        (slot manufact-time (composite) (default 4))
        (slot disposal-cost (composite) (default 2))
        (slot illegal-connectors (composite)))

(defclass WOOD-ROD (is-a SUPPORT)
        (slot material (composite)(default WOOD))
        (slot cost (default 1))
        (slot weight (default 2))
        (slot durability (composite) (default 1))
        (slot strength (composite) (default 1))
        (slot manufact-time (composite) (default 1))
        (slot disposal-cost (composite) (default 3))
        (slot illegal-connectors (composite) (default WELD SNAP)))

;*********** CONNECTORS *************

(defclass CONNECTOR (is-a TOY)
        (slot position)
        (slot type (read-only)(allowed-symbols WELD BOLT SNAP))
        (slot cost (read-only))
        (slot assembly-time (read-only))
        (slot disposal-cost (read-only))
        (slot illegal-materials        (multiple)(read-only)
                (allowed-symbols ALUMINUM STEEL WOOD))
        (slot angles-allowed (multiple)(read-only)))

(defclass BOLT (is-a CONNECTOR)
        (slot type (composite)(default BOLT))
        (slot cost (composite) (default 1))
        (slot assembly-time (composite) (default 3))
        (slot disposal-cost (composite) (default 1))
        (slot illegal-materials (composite))
        (slot angles-allowed (composite)(default 0 45 90)))

(defclass SNAP (is-a CONNECTOR)
        (slot type (shared)(read-only)(default SNAP))
        (slot cost (composite) (default 2))
        (slot assembly-time (composite) (default 1))
        (slot disposal-cost (composite) (default 1))
        (slot illegal-materials (composite)(default WOOD))
        (slot angles-allowed (composite)(default 0 90)))

(defclass WELD (is-a CONNECTOR)
        (slot type (composite)(default WELD))
        (slot cost (composite) (default 5))
        (slot assembly-time (composite) (default 8))
        (slot disposal-cost (composite) (default 4))
        (slot illegal-materials (composite)(default WOOD))
        (slot angles-allowed (composite)(default 0 30 45 60 90)))

;*********** TOWERS ***********

(defclass TOWER (is-a TOY)
        (slot height (default 15))
        (slot basesize)
        (slot platformsize)
        (slot supports (multiple))
        (slot no_of_supports (default 0))
        (slot connectors (multiple))
        (slot no_of_connectors (default 0))
        (slot braces (multiple))
        (slot no_of_braces (default 0))
        (slot platform)
        (slot style (read-only)(allowed-symbols I A X))
        (slot cost (read-only))
        (slot strength (read-only))
        (slot assembly-time (read-only))
        (slot marketability (read-only)))

(defclass I-TOWER (is-a TOWER)
        (slot style (composite)(default I))
        (slot basesize (default 2))
        (slot platformsize (default 2))
        (slot cost (composite)(default 1))
        (slot strength (composite)(default 1))
        (slot assembly-time (composite)(default 1))
        (slot marketability (composite)(default 8)))

(defclass A-TOWER (is-a TOWER)
        (slot style (composite)(default A))
        (slot basesize (default 4))
        (slot platformsize (default 1))
        (slot cost (composite)(default 6))
        (slot strength (composite)(default 3))
        (slot assembly-time (composite)(default 6))
        (slot marketability (composite)(default 3)))

(defclass X-TOWER (is-a TOWER)
        (slot style (composite)(default X))
        (slot basesize (default 6))
        (slot platformsize (default 6))
        (slot cost (composite)(default 4))
        (slot strength (composite)(default 5))
        (slot assembly-time (composite)(default 7))
        (slot marketability (composite)(default 6)))


rdouglas@stsci.edu