(module Life : Automaton);
(module Wireworld : Automaton);
(module Brain : Automaton);
- (module Cont : Automaton);
(module Maze : Automaton);
]
+++ /dev/null
-(* Copyright 2024 Amélia COUTARD <https://www.ameliathe1st.gay>.
- *
- * This file from the program cells is free software: you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License along
- * with this program. If not, see <https://www.gnu.org/licenses/>.
- *)
-
-let name = "Automate continu random"
-
-type t = float
-
-type 'a neighbours = 'a list
-
-let neighbours = [(0, 0); (-1, 0); (0, -1); (0, 1); (1, 0)]
-
-let map = List.map
-
-let fold_left = List.fold_left
-
-let iter = List.iter
-
-let transition l = List.fold_left ( +. ) 0. l /. 5.
-
-let default = 0.
-
-let prev c = c -. 1.
-
-let next c = c +. 1.
-
-let color c =
- let v =
- (if c > 0. then (512. /. (1. +. Float.exp (-.c))) -. 256. else (512. /. (1. +. Float.exp c)) -. 256.)
- |> int_of_float
- |> char_of_int
- in
- if c > 0. then (v, '\x00', '\x00') else ('\x00', '\x00', v)
-
-let of_string = float_of_string
-
-let to_string = string_of_float