Skip to content
Snippets Groups Projects
Commit 742afb88 authored by erwan's avatar erwan
Browse files

chore: refactor dijkstra implementation

parent ac3a428f
No related branches found
No related tags found
No related merge requests found
(* Time-stamp: <modified the 05/03/2020 (at 21:31) by Erwan Jahier> *) (* Time-stamp: <modified the 23/06/2020 (at 13:57) by Erwan Jahier> *)
open Algo open Algo
...@@ -12,12 +12,12 @@ let (init_state: int -> string -> 's) = ...@@ -12,12 +12,12 @@ let (init_state: int -> string -> 's) =
let (enable_f: 's -> 's neighbor list -> action list) = let (enable_f: 's -> 's neighbor list -> action list) =
fun e nl -> fun e nl ->
let pred = List.hd nl in let pred = match nl with [n] -> n | _ -> assert false in
if e <> state pred then ["T"] else [] if e <> state pred then ["T"] else []
let (step_f : 's -> 's neighbor list -> action -> 's) = let (step_f : 's -> 's neighbor list -> action -> 's) =
fun e nl a -> fun e nl a ->
let pred = List.hd nl in let pred = match nl with [n] -> n | _ -> assert false in
match a with match a with
| _ -> state pred | _ -> state pred
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment