Changes between Version 23 and Version 24 of Clojure Client Tutorial


Ignore:
Timestamp:
Aug 4, 2011 3:22:15 PM (13 years ago)
Author:
kedwar10
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Clojure Client Tutorial

    v23 v24  
    7575
    7676{{{
    77 client.core=> (run-ioquake "/home/vax7/u21/kedwar10/Projects/Quagents/quagents/ioquake3/build/release-linux-i386/ioquake3.i386" "firstroom")
     77client.core=> (run-ioquake "/full/path/to/ioquake3.i386" "firstroom")
    7878#<UNIXProcess java.lang.UNIXProcess@2a5ab9>
    7979}}}
     
    362362:Bob
    363363client.core=>(make-gui) ; the quagents use a value iteration to calculate the best policy; brightness denotes higher utility                           
    364 #<JFrame javax.swing.JFrame[frame0,0,0,510x530,layout=java.awt.BorderLayout,title=Quagent Utility Map,resizable,normal,defaultCloseOperation=EXIT_ON_CLOSE,rootPane=javax.swing.JRootPane[,5,25,500x500,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]>
     364#<JFrame javax.swing.JFrame (output truncated)>
    365365client.core=> (def q1 (future (explore-maze :Bob)))
    366366#'client.core/q1
     
    377377
    378378{{{
    379 client.core=> (defn get-location-of [quagent] (client->server send-and-watch quagent :now :current-location nil (fn [k r o n](println "old val " o " new val " n)))
     379client.core=> (defn get-location-of [quagent]
     380                (client->server send-and-watch
     381                                quagent
     382                                :now
     383                                :current-location
     384                                nil
     385                                (fn [k r o n]
     386                                 (println "old val " o " new val " n)))
    380387#'client.core/get-location-of
    381388client.core=> (get-location-of :Joe)                                                                                                                               
     
    398405Recall that "send-and-watch" can also accept a function to control the combination of previous and current replies as well, so the watcher function argument "o" is not limited to just being a vector of replies.
    399406
    400 
    401 
    402 
    403407----
    404408