;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; GET_COMPUTER_MOVE_LHS ; ; FILE NAME: GET_COMPUTER_MOVE_LHS.OPS ; CREATION DATE: 11/20/89 ; AUTHOR: Frederick S. Schebor ; REVISIONS: ; Date Initials Reason for Revision ; PURPOSE: Left-hand-side knowledge source for triggering a right-hand-side knowledge source which will permit the computer ; to evaluate a tic-tac-toe board and select the best possible move., ; METHOD: If blackboard conditions are right, then send a response to the agenda. ; REFERENCED ROUTINES: ; get_blackboard_data_ops5_shell FUNCTION ) ; send_agenda_response_ops5_shell FUNCTION ) ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ( EXTERNAL ( get_blackboard_data_ops5_shell SYMBOLIC-ATOM ( SYMBOLIC-ATOM BY REFERENCE ) ) ( send_agenda_response_ops5_shell INTEGER-ATOM ( SYMBOLIC-ATOM BY REFERENCE ) ( INTEGER-ATOM BY REFERENCE ) ( FLOAT-ATOM BY REFERENCE ) ( FLOAT-ATOM BY REFERENCE ) ) ) ( LITERALIZE blackboard_items blackboard_status game_status next_move ) ( LITERALIZE status return_status ) ( STARTUP ( WATCH 0 ) ( DISABLE HALT ) ( STRATEGY LEX ) ( MAKE START ) ( RUN ) ) ( P get_blackboard_status ;Get blackboard status { ( START ) } --> ( REMOVE ) ( MAKE blackboard_items ^blackboard_status ( get_blackboard_data_ops5_shell BLACKBOARD_STATUS ) ) ) ( P match_blackboard_status ;Status RUNNING? ( blackboard_items ^blackboard_status RUNNING ) --> ( MAKE blackboard_items ^game_status ( get_blackboard_data_ops5_shell GAME_STATUS ) ) ) ( P match_game_status ;Game status GET_MOVE? ( blackboard_items ^game_status GET_MOVE ) --> ( MAKE blackboard_items ^next_move ( get_blackboard_data_ops5_shell NEXT_MOVE ) ) ) ( P send_agenda_response ;Next move COMPUTER? ( blackboard_items ^next_move COMPUTER ) --> ;Send agenda response ( MAKE status ^return_status ( send_agenda_response_ops5_shell GET_COMPUTER_MOVE_RHS 3 .01 99.9 ) ) ( HALT ) )