File: landmark.el.html

*Note: This package has now moved to elpa.gnu.org.*

To try this, just type: M-x landmark-test-run

Landmark is a relatively non-participatory game in which a robot attempts to maneuver towards a tree at the center of the window based on unique olfactory cues from each of the 4 directions. If the smell of the tree increases, then the weights in the robot's brain are adjusted to encourage this odor-driven behavior in the future. If the smell of the tree decreases, the robots weights are adjusted to discourage that odor-driven behavior.

In laymen's terms, the search space is initially flat. The point of training is to "turn up the edges of the search space" so that the robot rolls toward the center.

Further, do not become alarmed if the robot appears to oscillate back and forth between two or a few positions. This simply means it is currently caught in a local minimum and is doing its best to work its way out.

The version of this program as described has a small problem. a move in a net direction can produce gross credit assignment. for example, if moving south will produce positive payoff, then, if in a single move, one moves east,west and south, then both east and west will be improved when they shouldn't

The source code was developed as part of a course on Brain Theory and Neural Networks at the University of Southern California. The original problem description and solution appeared in 1981 in the paper "Landmark Learning: An Illustration of Associative Search" authored by Andrew G. Barto and Richard S. Sutton and published to Biological Cybernetics.

Many thanks to Yuri Pryadkin <yuri@rana.usc.edu> for this concise problem description.

;_* Require

Defined variables (53)

landmark-8-directionsThe full 8 possible directions.
landmark-boardVector recording the actual state of the Landmark board.
landmark-board-heightNumber of lines on the Landmark board.
landmark-board-widthNumber of columns on the Landmark board.
landmark-boundThe maximum that w0j may be.
landmark-cA factor applied to modulate the increase in wij.
landmark-c-naughtA factor applied to modulate the increase in w0j.
landmark-cxThis is the x coordinate of the center of the board.
landmark-cyThis is the y coordinate of the center of the board.
landmark-debugIf non-nil, debugging is printed.
landmark-directionsThe cardinal directions.
landmark-draw-limitAfter how many moves will Emacs offer a draw?
landmark-emacs-is-computingNon-nil if Emacs is in the middle of a computation.
landmark-emacs-played-firstNon-nil if Emacs played first.
landmark-emacs-wonFor making font-lock use the winner’s face for the line.
landmark-ewUsed when doing something relative to the east and west axes.
landmark-font-lock-keywordsFont lock rules for Landmark.
landmark-game-historyA record of all moves that have been played during current game.
landmark-game-in-progressNon-nil if a game is in progress.
landmark-human-refused-drawNon-nil if Human refused Emacs offer of a draw.
landmark-human-took-backNon-nil if Human took back a move during the game.
landmark-losing-thresholdThreshold score beyond which a human move is winning.
landmark-mThis is the x dimension of the playing board.
landmark-max-stall-timeThe maximum number of cycles that the robot can remain stuck in a place.
landmark-mode-abbrev-tableAbbrev table for ‘landmark-mode’.
landmark-mode-hookIf non-nil, its value is called on entry to Landmark mode.
landmark-mode-mapLocal keymap to use in Landmark mode.
landmark-mode-syntax-tableSyntax table for ‘landmark-mode’.
landmark-nThis is the y dimension of the playing board.
landmark-nil-scoreScore of an empty qtuple.
landmark-no-payoffThe amount of simulation cycles that have occurred with no movement.
landmark-nsUsed when doing something relative to the north and south axes.
landmark-number-of-drawsNumber of games already drawn in this session.
landmark-number-of-emacs-winsNumber of games Emacs won in this session.
landmark-number-of-human-movesNumber of moves already played by human in current game.
landmark-number-of-human-winsNumber of games you won in this session.
landmark-number-of-movesNumber of moves already played in current game.
landmark-number-of-trialsThe number of times that landmark has been run.
landmark-nvarNot used.
landmark-one-moment-pleaseIf non-nil, print "One moment please" when a new board is generated.
landmark-output-movesIf non-nil, output number of moves so far on a move-by-move basis.
landmark-saved-board-heightRecorded value of previous board height.
landmark-saved-board-widthRecorded value of previous board width.
landmark-saved-score-tableRecorded initial value of previous score table.
landmark-score-tableVector recording the actual score of the free squares.
landmark-score-trans-tableVector associating qtuple contents to their score.
landmark-square-heightVertical spacing between squares on the Landmark board.
landmark-square-widthHorizontal spacing between squares on the Landmark board.
landmark-sum-of-movesThe total number of moves made in all games.
landmark-vector-lengthLength of landmark-board vector.
landmark-winning-thresholdThreshold score beyond which an Emacs move is winning.
landmark-x-offsetNumber of columns between the Landmark board and the side of the window.
landmark-y-offsetNumber of lines between the Landmark board and the top of the window.

Defined functions (69)

landmark(PARG)
landmark--distance(X X0 Y Y0)
landmark-beginning-of-line()
landmark-calc-distance-of-robot-from(DIRECTION)
landmark-calc-smell-internal(SYM)
landmark-check-filled-qtuple(SQUARE VALUE DX DY)
landmark-click(CLICK)
landmark-confidence-for(TARGET-DIRECTION)
landmark-crash-game()
landmark-cross-qtuple(SQUARE1 SQUARE2 DX DY)
landmark-display-statistics()
landmark-emacs-plays()
landmark-end-of-line()
landmark-f(X)
landmark-find-filled-qtuple(SQUARE VALUE)
landmark-fix-weights-for(DIRECTION)
landmark-goto-square(INDEX)
landmark-goto-xy(X Y)
landmark-human-plays()
landmark-human-resigns()
landmark-human-takes-back()
landmark-index-to-x(INDEX)
landmark-index-to-y(INDEX)
landmark-init(AUTO-START SAVE-WEIGHTS)
landmark-init-board()
landmark-init-display(N M)
landmark-init-score-table()
landmark-init-square-score(I J)
landmark-max-height()
landmark-max-width()
landmark-mode()
landmark-mouse-play(CLICK)
landmark-move-down()
landmark-move-ne()
landmark-move-nw()
landmark-move-se()
landmark-move-sw()
landmark-move-up()
landmark-nb-qtuples(I J)
landmark-nslify-wts-int(DIRECTION)
landmark-offer-a-draw()
landmark-play-move(SQUARE VAL &optional DONT-UPDATE-SCORE)
landmark-plot-internal(SYM)
landmark-plot-square(SQUARE VALUE)
landmark-point-square()
landmark-point-y()
landmark-print-distance-int(DIRECTION)
landmark-print-moves(MOVES)
landmark-print-smell-int(DIRECTION)
landmark-print-w0-int(DIRECTION)
landmark-print-wts-int(DIRECTION)
landmark-print-y-s-noise-int(DIRECTION)
landmark-prompt-for-move()
landmark-prompt-for-other-game()
landmark-randomize-weights-for(DIRECTION)
landmark-repeat()
landmark-start-game(N M)
landmark-start-robot()
landmark-strongest-square()
landmark-switch-to-window()
landmark-take-back()
landmark-terminate-game(RESULT)
landmark-test-run()
landmark-update-naught-weights(DIRECTION)
landmark-update-normal-weights(DIRECTION)
landmark-update-score-in-direction(LEFT RIGHT SQUARE DX DY DVAL)
landmark-update-score-table(SQUARE DVAL)
landmark-xy-to-index(X Y)
landmark-y(DIRECTION)

Defined faces (2)

landmark-font-lock-face-OFace to use for Emacs's O.
landmark-font-lock-face-XFace to use for your X.