Jump to content

a little markov game


Recommended Posts

;;; little markov-game:

;;; gen-markov => analyze the output => produce new rules => gen-markov
;;; make x-times the list-plot and you will see how the system most of the times
;;; comes to a "constant STATE"

(defun self-analyzing/generating-markov (transitions size generations)
  (loop repeat generations
    with list = (gen-markov-from-transitions 
                 transitions
                 :size size :start 1)
    
    append (setq list (gen-markov-from-transitions 
                       (gen-markov-transitions list)
                       :size size :start (car (last list))))))

;;; a "neutral table with 4 values"
(setf transition-table
	      '((1 (1 1) (2 1) (3 1) (4 1))
                (2 (1 1) (2 1) (3 1) (4 1))
                (3 (1 1) (2 1) (3 1) (4 1))
                (3 (1 1) (2 1) (3 1) (4 1))
                (4 (1 1) (2 1) (3 1) (4 1))))


;;; evaluate a few times and have a look on the output
(list-plot 
 (self-analyzing/generating-markov transition-table 20 20) 
 :point-radius 0 :style :fill)

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy