Newer
Older
(* Time-stamp: <modified the 09/03/2019 (at 12:47) by Erwan Jahier> *)
(* This is algo 5.3 in the book *)
open Algo
let vars = ["d",It]
let d=10
let (init_vars: neighbor list -> local_env) =
fun _nl ->
function _ -> I (Random.int d)
let (enable_f:neighbor list -> local_env -> action list) =
fun nl e ->
if (e "d") <> I 0 then ["CD"] else []
let (step_f : neighbor list -> local_env -> action -> local_env) =
fun nl e ->
function | _ -> (function "d" -> I 0 | _ -> assert false)