Changes between Version 71 and Version 72 of Clojure Client Tutorial


Ignore:
Timestamp:
Aug 23, 2011 2:40:37 PM (13 years ago)
Author:
kedwar10
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Clojure Client Tutorial

    v71 v72  
    542542=== Cave explorer ===
    543543
    544 Value iteration for movement planning.  Collaborative exploration.
     544The movement planner included in the Clojure client is a basic maze explorer that uses value iteration to compute the next move. Cells that have been previously explored are given a reward of -0.04 and unexplored cells have a reward of 1.0. 
     545
     546Although this example was meant to showcase the ways in which Clojure's support for concurrency and parallelism could represent collaborative planning, unfortunately the incorrect type was used to store the shared data, and as a result the program is not thread-safe (though still completes with high probability).  The problem arises in the value iteration algorithm, where the the function "max" is applied to a list that occasionally contains a nil value, which causes an exception (note that this exception doesn't show if the quagent is being run inside of a future and not a regular thread).  This probably occurs because updates to the shared data structure are not coordinated, and as a result, if one quagent is looking up value that another has yet to write, then a nil value will be returned.  This problem could be solved by using refs instead of atoms, since they can be coordinated without the possibility of race conditions.
    545547
    546548=== Rovers ===