Changes between Version 23 and Version 24 of Clojure Client Tutorial
- Timestamp:
- Aug 4, 2011 3:22:15 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Clojure Client Tutorial
v23 v24 75 75 76 76 {{{ 77 client.core=> (run-ioquake "/ home/vax7/u21/kedwar10/Projects/Quagents/quagents/ioquake3/build/release-linux-i386/ioquake3.i386" "firstroom")77 client.core=> (run-ioquake "/full/path/to/ioquake3.i386" "firstroom") 78 78 #<UNIXProcess java.lang.UNIXProcess@2a5ab9> 79 79 }}} … … 362 362 :Bob 363 363 client.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)> 365 365 client.core=> (def q1 (future (explore-maze :Bob))) 366 366 #'client.core/q1 … … 377 377 378 378 {{{ 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))) 379 client.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))) 380 387 #'client.core/get-location-of 381 388 client.core=> (get-location-of :Joe) … … 398 405 Recall 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. 399 406 400 401 402 403 407 ---- 404 408