state.ml 586 Bytes
Newer Older
1
2
3
(* Automatically generated by /home/jahier/.opam/4.10.0/bin/sasa version "4.2.1-3-g3be9fa3" ("3be9fa3")*)
(* on crevetete the 25/6/2020 at 16:35:34*)
(*sasa -reg ring.dot*)
4
5

type t = int 
6
let to_string = Printf.sprintf "c=%i"
7
8
let of_string = Some int_of_string
let copy = fun x -> x
9
let actions = ["conflict"]
10

11
12
13
14
15
open Algo
let pf pidl get =
  let clash = ref 0 in
  let color pid = (get pid).next in
  List.iter (fun pid ->
16
      List.iter (fun n -> if state n = color pid then incr clash) (get pid).neighbors)
17
18
19
20
      pidl;
  float_of_int !clash

let potential = Some pf
21
let fault = None