Up: Blocks World API documentation
Package blocks-world
This package contains the source code of chapter 21, "The Blocks World with Classes and Methods" from Lisp (3rd edition) by Winston
and Horn.
About This PackageExample The different kinds of blocks Concrete block classes The hand Methods for the blocks world A picture of the worldThe block objects represent a world that "looks" like this:/----\ ^ /---------\ ^ | b4 | / \ | | / \ \____/ /_w7_\ | | / \ /----\ /----\ | | / \ /--------\ /^\ | b1 | | b2 | | b3 | / \ | b6 | (l8 ) \____/ \____/ \_________/ /_w5__\ \________/ \./ +-----------------------------------------------------------+ | | +-----------------------------------------------------------+ ExampleIn the initial configuration, where all blocks have been placed directly on the table (not shown), the blocks-world:put-on method will move the objects like this:BLOCKS-WORLD> (put-on b1 b2) Move hand to pick up B1 at location (1 2). Grasp B1. Removing support relations between B1 and TABLE. Move B1 to top of B2 at location (2 2). Adding support relations between B1 and B2. Ungrasp B1. T The different kinds of blocksMovable blocks than can be moved onto load supporting blocks. Using multiple inheritance, there are also blocks that can do both.The basic-block classThe load-bearing-block classThe movable-block class
The superclass of objects in the Blocks World that can be moved by the
hand. ... Concrete block classesThese are the blocks found in our world.The table supporting the rest of the world. ... A useful movable building block with a flat top. ... An interesting movable building block. ... The block is a sphere. ... The handThe hand is movable. It can hold at most one block.The hand that moves the world. ... Returns the name of the hand. ... Returns the position of the hand. ... Returns the block the hand is currently holding. ... Methods for the blocks worldMake space on support for object. ... Grasps the block using the hand. ... Ungrasps the block if hand is holding it. ... Make space on top of this instance. ... | Exported Symbol Index
|