This makes more sense in the morning.
authorSiraaj Khandkar <siraaj@khandkar.net>
Sun, 29 Sep 2013 15:44:42 +0000 (11:44 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Sun, 29 Sep 2013 15:44:42 +0000 (11:44 -0400)
polymorphism/001/src/polymorphism.ml

index aae480b..6fc0ba9 100644 (file)
@@ -290,9 +290,8 @@ module ForestFire : RULE = struct
   let f = 0.000001  (* Probability of spontaneous ignition *)
   let p = 0.1       (* Probability of spontaneous growth *)
 
-  let is_probable = function
-    | probability when (Random.float 1.0) <= probability -> true
-    | _ -> false
+  let is_probable p =
+    (Random.float 1.0) <= p
 
   let next state ~burning_neighbors =
     match state, burning_neighbors with
This page took 0.024207 seconds and 4 git commands to generate.