Main Page Files Productions Problem Spaces Operators Goal Hierarchy Groups Prod. By Type Todo All
elaborations/
monitor.soar
[src]
Go to the documentation for this file...
00001 00002 ##! 00003 # @file elaborations/monitor.soar 00004 # @brief Monitor (and report) the world state, movements and achievement of the goal! 00005 # 00006 # @desc 00007 # 00008 00009 ##! 00010 # @production monitor*world-state 00011 # @brief Report changes in the world state. 00012 # 00013 # @desc <blockquote><i> 00014 # Report the state of a block. This rule fires, writes to the terminal (and 00015 # retracts!) every time the 'on' and 'below' attributes for a block change. 00016 # </i></blockquote> 00017 # @problem-space any-ps 00018 00019 sp {monitor*world-state 00020 (state <s> ^block <block>) 00021 (<block> ^name <n> ^on <o> ^below <b>) 00022 --> 00023 (write (crlf) | state: |<o>| < |<n>| < |<b>||)} 00024 00025 ##! 00026 # @production monitor*move-block 00027 # @brief Report uses of the "move-block" operator. 00028 # 00029 # @desc 00030 # @problem-space any-ps 00031 # @operator move-block 00032 00033 # monitor movements 00034 sp {monitor*move-block 00035 (state <s> ^operator <o>) 00036 (<o> ^name move-block 00037 ^block <m> 00038 ^destination <d>) 00039 --> 00040 (write (crlf) | MOVE(|<m>|,|<d>|)| )} 00041 00042 ##! 00043 # @production monitor*goal*achieved 00044 # @brief Report and halt the system when the goal is achieved. 00045 # 00046 # @desc 00047 # The goal is achieved when the current state matches the 00048 # desired goal state. 00049 # @problem-space any-ps 00050 00051 sp {monitor*goal*achieved 00052 (state <s> ^goal <g>) 00053 (<g> ^block <ga> <gb> <gc>) 00054 (<ga> ^name a ^on <a1> ^below <a2>) 00055 (<gb> ^name b ^on <b1> ^below <b2>) 00056 (<gc> ^name c ^on <c1> ^below <c2>) 00057 (<s> ^block <a> <b> <c>) 00058 (<a> ^name a ^on <a1> ^below <a2>) 00059 (<b> ^name b ^on <b1> ^below <b2>) 00060 (<c> ^name c ^on <c1> ^below <c2>) 00061 --> 00062 (write (crlf) |The problem has been solved.|) 00063 (halt)} 00064