Commit d58959be authored by erwan's avatar erwan
Browse files

Add the DTR experiment that is mentionned in Section 5 of the journal version

parent 84e5cfc1
Pipeline #48536 failed with stages
in 56 minutes and 25 seconds
......@@ -35,8 +35,8 @@ hugeER.dot:
BIGDOT=biggrid.dot bigER.dot
DOT=grid.dot ER.dot
BIGDOT=biggrid.dot bigER.dot ring10000.dot
DOT=grid.dot ER.dot
dot: $(DOT) $(BIGDOT)
grep is_connected=false *.dot && echo "One of the generated graph is not connected!"\
......@@ -53,8 +53,8 @@ BIGLOG=$(BIGDOT:%.dot=%.log)
# nb: It performs |DOT|x|TEST_DIRS| experiments
EXPE=$(TEST_DIRS:%=%.expe)
BIGEXPE=$(TEST_DIRS:%=%.bigexpe)
expe: $(EXPE)
bigexpe: $(BIGEXPE)
expe: $(EXPE) ring1000.log
bigexpe: $(BIGEXPE) ring10000.log
%.expe: $(DOT)
touch $@
......@@ -64,7 +64,11 @@ bigexpe: $(BIGEXPE)
touch $@
cd $* ; make N=10 $(BIGLOG)
ring1000.log:
cd dijkstra-ring ; rm -f $@ ; make N=1000 $@ ; cat $@ ; cp $@ ..
ring10000.log:
cd dijkstra-ring ; rm -f $@ ; make N=1000 $@ ; cat $@ ; cp $@ ..
########################################################################
DIR=results/`date +%Y-%m-%d_%H`
......
# Time-stamp: <modified the 03/09/2020 (at 10:52) by Erwan Jahier>
ring1000.dot:
gg ring -n 10001 -dir -o $@
gg-deco "1-:p.ml 0:root.ml" $@ -o $@
ring10000.dot:
gg ring -n 10000 -dir -o $@
gg-deco "1-:p.ml 0:root.ml" $@ -o $@
-include ../Makefile.inc
-include Makefile.untracked
clean: genclean
rm -f ring_oracle.lus ring.ml
open State
let potential = None
let fault = None
let (legitimate: t Algo.legitimate_fun) =
fun pidl get ->
(* only one node is enabled *)
let incr_token i pid =
let s, nl = get pid in
let have_token = (if s.root then Root.enable_f s nl else P.enable_f s nl) <> [] in
let ni = if have_token then i+1 else i in
ni
in
let token_nb = List.fold_left incr_token 0 pidl in
token_nb = 1
let legitimate = Some legitimate
(* let legitimate = None *)
(* Time-stamp: <modified the 01/09/2020 (at 17:18) by Erwan Jahier> *)
open Algo
let k = card()
open State
let (init_state: int -> string -> 's) =
fun _ _ ->
(* let k = (card() - 1) in *)
(* let _ = assert (k > 0) in *)
{ root = false ; v = Random.int k }
let (enable_f: 's -> 's neighbor list -> action list) =
fun e nl ->
let pred = match nl with [n] -> n | _ -> assert false in
if e.v <> (state pred).v then ["T"] else []
let (step_f : 's -> 's neighbor list -> action -> 's) =
fun e nl a ->
let pred = match nl with [n] -> n | _ -> assert false in
match a with
| _ -> { e with v = (state pred).v }
(* Time-stamp: <modified the 01/09/2020 (at 17:18) by Erwan Jahier> *)
open Algo
let k = card()
open State
let (init_state: int -> string -> 's) =
fun _n _ ->
(* let k = (card() - 1) in *)
(* let _ = assert (k > 0) in *)
{ root = true ; v = Random.int k }
let (enable_f: 's -> 's neighbor list -> action list) =
fun e nl ->
let pred = List.hd nl in
if e.v = (state pred).v then ["T"] else []
let (step_f : 's -> 's neighbor list -> action -> 's) =
fun e nl a ->
(* let k = (card() - 1) in *)
match a with
| _ -> { e with v = (e.v + 1) mod k }
type t = { root: bool ; v : int } (* semi-anonymous network: we know who is the root! *)
let to_string s = Printf.sprintf "c=%i" s.v
let (of_string: (string -> t) option) =
Some (fun s ->
Scanf.sscanf s "{root=%d;v=%d}" (fun i1 i2 -> { root = i1<>0; v = i2 } ))
let copy x = x
let actions = ["T"]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment