Commit f399592e authored by erwan's avatar erwan
Browse files

Merge branch 'master' into init-search

parents e2656645 ce76287f
Pipeline #95108 passed with stages
in 4 minutes and 59 seconds
......@@ -13,7 +13,7 @@ odoc:
dune build @doc
clean:
rm -f *.cmxs sasa *.cmi *.o *.cmx *.pdf
rm -f *.cmxs *.cmi *.o *.cmx *.pdf
rm -f lib/sasacore/sasaVersion.ml
dune clean
cd test; make clean
......
(lang dune 1.11)
(lang dune 2.0)
- [TL;DR](#org8fa27cc)
- [Topology](#org5e9e5fc)
- [Algorithms](#orgf2ed7c2)
- [Examples](#org36e35df)
- [Batch mode](#orgfbdc4f5)
- [Running batch simulations](#orgb148cef)
- [Running batch simulations with Built-in daemons](#org9015d05)
- [Running batch simulations with manual (a.k.a. custom) daemons](#org7eec4f0)
- [Running batch simulations with `lurette`](#orgc770ce0)
- [Viewing Results](#org77bb70c)
- [The `sasa` CLI](#org13e9147)
- [Interactive mode](#org64cd5de)
- [Example: use `rdbg` from the `test/alea-coloring/` directory](#org77bfd02)
- [The examples of test directory](#orgccecf21)
- [Running interactive sessions with `rdbg`](#org1d73d68)
- [Getting `rdbg` on-line help](#org6e2b752)
- [A `rdbg` `sasa` GUI](#orgaeb9370)
- [Useful Modules](#org1b0d22c)
- [Install](#orga6e17e7)
- [TL;DR](#org773be47)
- [Not strictly mandatory, but useful, third-party software](#orge1cefb0)
- [Install `sasa` via opam (version >= 2.\*)](#org799f08b)
- [Install `sasa` via `git`](#orgc6832ab)
- [Use `sasa` via docker](#org8fc4b64)
- [Use `sasa` via a Virtual Machine](#org0c0d7c2)
- [Screencasts](#org682fc05)
- [More](#org11d9306)
- [FAQ](#orgfc8c2b2)
- [Is there a FAQ?](#org72c0095)
- [I have a compilation error that I don't understand](#orge57b20e)
- [I have the error `Invalid_argument("compare: functional value")`](#orgcbfe32e)
<a id="org8fa27cc"></a>
- [TL;DR](#org1026a8e)
- [Topology](#orgb4df5b3)
- [Algorithms](#org6ade26f)
- [Examples](#org8d79f98)
- [Batch mode](#org056ba86)
- [Running batch simulations](#orgfab12e1)
- [Running batch simulations with Built-in daemons](#orgd805172)
- [Running batch simulations with manual (a.k.a. custom) daemons](#orgc83fe4f)
- [Running batch simulations with `lurette`](#orgae795ee)
- [Viewing Results](#orgb583f0d)
- [The `sasa` CLI](#org5680d70)
- [Interactive mode](#orgc9bd367)
- [Example: use `rdbg` from the `test/alea-coloring/` directory](#orgc697f02)
- [The examples of test directory](#orgf518876)
- [Running interactive sessions with `rdbg`](#orgf412858)
- [Getting `rdbg` on-line help](#org0106b12)
- [A `rdbg` `sasa` GUI](#org67d414e)
- [Useful Modules](#org3eee2b0)
- [Install](#org40175a6)
- [TL;DR](#org376c26e)
- [Not strictly mandatory, but useful, third-party software](#org85b4f8f)
- [Install `sasa` via opam (version >= 2.\*)](#org43104bf)
- [Install `sasa` via `git`](#org3d3734e)
- [Use `sasa` via docker](#org19e54d0)
- [Use `sasa` via a Virtual Machine](#orga15adfe)
- [Screencasts](#org137a3ee)
- [More](#orgb2b8f50)
- [FAQ](#org441d3ab)
- [Is there a FAQ?](#orgc933a8d)
- [I have a compilation error that I don't understand](#org51d450b)
- [I have the error `Invalid_argument("compare: functional value")`](#org823c711)
<a id="org1026a8e"></a>
# TL;DR
<a id="org46147ce"></a> SASA is a **Self-stabilizing Algorithms SimulAtor**, based on the so-called **Atomic State model** (ASM) introduced by <span class="underline">Dijkstra</span> in its seminal article on [Self-stabilizing distributed algorithms](http://www.cs.utexas.edu/~EWD/ewd04xx/EWD426.PDF). This model is also sometimes named "locally shared memory model with composite atomicity"
<a id="org0606401"></a> SASA is a **Self-stabilizing Algorithms SimulAtor**, based on the so-called **Atomic State model** (ASM) introduced by <span class="underline">Dijkstra</span> in its seminal article on [Self-stabilizing distributed algorithms](http://www.cs.utexas.edu/~EWD/ewd04xx/EWD426.PDF). This model is also sometimes named "locally shared memory model with composite atomicity"
Basically, one needs to provide:
......@@ -61,11 +61,11 @@ sasa ring.dot -l 4 # run a batch simulation for 4 steps
[![img](poster.png)](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/sasa/poster.pdf)
<a id="org5e9e5fc"></a>
<a id="orgb4df5b3"></a>
# Topology
<a id="org12b1a12"></a> <a id="orgbb48953"></a> The topology is given via `.dot` files, that should
<a id="org57040cd"></a> <a id="org3c6291f"></a> The topology is given via `.dot` files, that should
1. follow the [graphviz/dot format](https://en.wikipedia.org/wiki/DOT_(graph_description_language))
2. have nodes **labeled** by the `algo` field
......@@ -121,14 +121,14 @@ graph ring {
Such parameters can be retrieved in algorithms using the `Algo.get_graph_attribute : string -> string` function. For example, if you know the graph diameter, you can define it as a graph attribute (a `Algo.diameter: unit -> int` function is provided, but it can be expensive to use for large graphs).
Some tools are provided in the `sasa` [distributions](#org8f315c0) to generate such kinds of `dot` graphs: <https://verimag.gricad-pages.univ-grenoble-alpes.fr/vtt/articles/sasa-gg/>
Some tools are provided in the `sasa` [distributions](#org18f93ef) to generate such kinds of `dot` graphs: <https://verimag.gricad-pages.univ-grenoble-alpes.fr/vtt/articles/sasa-gg/>
<a id="orgf2ed7c2"></a>
<a id="org6ade26f"></a>
# Algorithms
<a id="org6eaf8cc"></a>
<a id="org1d03ff2"></a>
The following has been generated from [algo.mli](https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/sasa/blob/master/lib/algo/algo.mli)
......@@ -140,7 +140,7 @@ The following has been generated from [algo.mli](https://gricad-gitlab.univ-gren
</iframe>
<a id="org36e35df"></a>
<a id="org8d79f98"></a>
# Examples
......@@ -180,14 +180,14 @@ The `test` directory also contains sub-directories which gathers programs shared
- `test/*/my-rdbg-tuning.ml`: includes `test/my-rdbg-tuning.ml` and defines commands specific to the example of the directory. Indeed, `rdbg`, once launched, first tries to read the content of the file name `my-rdbg-tuning.ml` (if it exists).
<a id="orgfbdc4f5"></a>
<a id="org056ba86"></a>
# Batch mode
![img](./sasabatch.svg)
<a id="orgb148cef"></a>
<a id="orgfab12e1"></a>
## Running batch simulations
......@@ -231,7 +231,7 @@ All the CLI commands above can be run automatically using a `make` rule containe
nb: the simulation output (in the green frame) follows the [RIF](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v6/#outline-container-orga43b00b) conventions.
<a id="org9015d05"></a>
<a id="orgd805172"></a>
## Running batch simulations with Built-in daemons
......@@ -250,7 +250,7 @@ sasa -h | grep "\-daemon"
--greedy-daemon, -gd
<a id="org7eec4f0"></a>
<a id="orgc83fe4f"></a>
## Running batch simulations with manual (a.k.a. custom) daemons
......@@ -288,7 +288,7 @@ In order to enter such input more easily, one can use (requires [the lustre V4 t
Daemons can also by simulated by [`lutin`](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v6/#outline-container-sec-4) programs via the use of [`lurette`](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v6/#outline-container-sec-9) (for batch executions) or [`rdbg`](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v6/#outline-container-sec-10) (for interactive sessions).
<a id="orgc770ce0"></a>
<a id="orgae795ee"></a>
## Running batch simulations with `lurette`
......@@ -313,14 +313,14 @@ Note that for `lurette`, the role of the SUT (System Under Test) and the one of
For more information on this topic: <https://verimag.gricad-pages.univ-grenoble-alpes.fr/vtt/articles/sasa-daemons/>
<a id="org77bb70c"></a>
<a id="orgb583f0d"></a>
## Viewing Results
`sasa -rif` and `lurette` generates `.rif` files that can be viewed with `gnuplot-rif` or `sim2chro`; cf <http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/reactive-toolbox/>
<a id="org13e9147"></a>
<a id="org5680d70"></a>
## The `sasa` CLI
......@@ -389,11 +389,11 @@ More `sasa` options:
Display the version ocaml version sasa was compiled with and exit.
<a id="org64cd5de"></a>
<a id="orgc9bd367"></a>
# Interactive mode
<a id="org01b2fe8"></a> If you want to perform step-by-step simulations, you can use the `-custd` option. But if you want to perform step-by-step simulations without the burden of playing the role of the daemon, you can launch `sasa` under the control of [rdbg](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/rdbg/).
<a id="org9cddde9"></a> If you want to perform step-by-step simulations, you can use the `-custd` option. But if you want to perform step-by-step simulations without the burden of playing the role of the daemon, you can launch `sasa` under the control of [rdbg](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/rdbg/).
Another advantage of [rdbg](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/rdbg/) is its ability to display a graphical view of the current configuration during the simulation, to move step by step, or round by round, forward or backwards.
......@@ -402,7 +402,7 @@ cf <https://verimag.gricad-pages.univ-grenoble-alpes.fr/vtt/articles/rdbg-sasa/>
Before reading this section, please read at least the [Basic usage Section if the rdbg documentation](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/rdbg/README.html#outline-container-sec-3).
<a id="org77bfd02"></a>
<a id="orgc697f02"></a>
## Example: use `rdbg` from the `test/alea-coloring/` directory
......@@ -423,7 +423,7 @@ make rdbg
This make rule (defined in `Makefile` and `../Makefile.inc`)
1. generates the `ring.ml` file, that contains the registration code (that can indeed be generated by sasa, as explained in `algo.mli`).
2. launches `rdbg` with some arguments (`rdbg -o ring.rif -sut "sasa ring.dot --locally-central-daemon"`). `rdbg` then prompts the user to enter one of the following commands:
2. launches `rdbg` with some arguments (`rdbg --sasa -o ring.rif -sut "sasa ring.dot --locally-central-daemon"`). `rdbg` then prompts the user to enter one of the following commands:
Enter one of the following key (the first is the default one):
[] create a fresh session
......@@ -445,7 +445,7 @@ rdbg
[q] quit
<a id="orgccecf21"></a>
<a id="orgf518876"></a>
## The examples of test directory
......@@ -456,13 +456,13 @@ The [test](https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/sasa/t
- `test/*/my-rdbg-tuning.ml`: includes `test/my-rdbg-tuning.ml` and defines commands specific to the example of the directory. Indeed, `rdbg`, once launched, first tries to read the content of the file name `my-rdbg-tuning.ml` (it it exists).
<a id="org1d73d68"></a>
<a id="orgf412858"></a>
## Running interactive sessions with `rdbg`
1. type `rdbg`
2. press enter to load the defaut session (`rdbg-session.ml`). Then you can type:
3. `d` for displaying a (dynamic) dot graph with `dot`
3. `gv` (graph view) for displaying a (dynamic) dot graph with `dot`
4. or ALTERNATIVELY `ne` to use the `neato` layout engine (`tw`, `ci`, `fd`, `sf`, `pa`, `os` to use the `twopi`, `circo`, `fdp`, `sfd`, `patchwork`, `osage` layout engines respectively)
5. `s` to move one step forward
6. `sd` to move one step forward and call `d` (to update the graph display [])
......@@ -473,7 +473,7 @@ The [test](https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/sasa/t
All those commands are defined in (the common) [test/my-rdbg-tuning.ml](https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/sasa/tree/master/test/my-rdbg-tuning.ml) that is included in (locals) `test/*/my-rdbg-tuning.ml` that are included in (generated) `test/*/rdbg-session.ml` files. `my-rdbg-tuning.ml` contains straigthforward `ocaml` code that defines various `rdbg` shortcuts to ease the simulation of `sasa` systems. Feel free to tailor those command to yours needs by modyfying the local `my-rdbg-tuning.ml`!
<a id="org6e2b752"></a>
<a id="org0106b12"></a>
## Getting `rdbg` on-line help
......@@ -569,21 +569,21 @@ Here are 2 useful entry-points to rdbg on-line help:
(rdbg)
<a id="orgaeb9370"></a>
<a id="org67d414e"></a>
## A `rdbg` `sasa` GUI
To install it:
```sh
opam depext -y rdbgui4ocaml
opam depext -y rdbgui4ocaml -- useless with opam >= 2.1
opam install -y rdbgui4ocaml
```
To use it: <https://verimag.gricad-pages.univ-grenoble-alpes.fr/vtt/articles/rdbgui4sasa/>
<a id="org1b0d22c"></a>
<a id="org3eee2b0"></a>
## Useful Modules
......@@ -618,14 +618,14 @@ Some modules, used by the sasa core engine, can be useful from `rdbg`.
</iframe>
<a id="orga6e17e7"></a>
<a id="org40175a6"></a>
# Install
<a id="org8f315c0"></a> <a id="org43a1957"></a>
<a id="org18f93ef"></a> <a id="org9e48bc2"></a>
<a id="org773be47"></a>
<a id="org376c26e"></a>
## TL;DR
......@@ -656,7 +656,7 @@ opam install -y sasa
And optionally (to define test oracles in Lustre or daemons in Lutin):
```sh
opam depext -y rdbgui4sasa lutin
opam depext -y rdbgui4sasa lutin -- useless with opam >= 2.1
opam install -y rdbgui4sasa lutin lustre-v6
```
......@@ -667,8 +667,8 @@ mkdir ~/lv4 # for example
cd ~/lv4
wget http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v4/distrib/linux64/lustre-v4-III-e-linux64.tgz
tar xvzf lustre-v4-III-e-linux64.tgz
echo "LUSTRE_INSTALL=~/lv4/lustre-v4-III-e-linux64" >> ~/.bashrc # if you are using bash
echo "PATH=$LUSTRE_INSTALL/bin:$PATH" >> ~/.bashrc
echo "export LUSTRE_INSTALL=~/lv4/lustre-v4-III-e-linux64" >> ~/.bashrc # if you are using bash
echo "export PATH=$LUSTRE_INSTALL/bin:$PATH" >> ~/.bashrc
sudo apt install -y wish
```
......@@ -679,7 +679,7 @@ git clone https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/sasa.gi
```
<a id="orge1cefb0"></a>
<a id="org85b4f8f"></a>
## Not strictly mandatory, but useful, third-party software
......@@ -714,15 +714,15 @@ mkdir ~/lv4 # for example
cd ~/lv4
wget http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v4/distrib/linux64/lustre-v4-III-e-linux64.tgz
tar xvzf lustre-v4-III-e-linux64.tgz
echo "LUSTRE_INSTALL=~/lv4/lustre-v4-III-e-linux64" >> ~/.bashrc # if you are using bash
echo "PATH=$LUSTRE_INSTALL/bin:$PATH" >> ~/.bashrc
echo "export LUSTRE_INSTALL=~/lv4/lustre-v4-III-e-linux64" >> ~/.bashrc # if you are using bash
echo "export PATH=$LUSTRE_INSTALL/bin:$PATH" >> ~/.bashrc
sudo apt install -y wish
```
Otherwise: <http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v4/distrib/index.html>
<a id="org799f08b"></a>
<a id="org43104bf"></a>
## Install `sasa` via opam (version >= 2.\*)
......@@ -756,7 +756,7 @@ opam upgrade
```
<a id="orgc6832ab"></a>
<a id="org3d3734e"></a>
## Install `sasa` via `git`
......@@ -800,14 +800,14 @@ make test
One can also mimic the content of the `test` job in the project [.gitlab-ci.yml Gitlab CI script](https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/sasa/tree/master/.gitlab-ci.yml).
<a id="org8fc4b64"></a>
<a id="org19e54d0"></a>
## Use `sasa` via docker
cf the Docker Install section of the [Synchrone Reactive Tool Box](http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v6/#docker). This docker image contains all the tools mentioned in this section (`sasa`, `lustre`, `opam`, `ocaml`, emacs, graphviz, etc.).
<a id="org0c0d7c2"></a>
<a id="orga15adfe"></a>
## Use `sasa` via a Virtual Machine
......@@ -817,7 +817,7 @@ cf the Docker Install section of the [Synchrone Reactive Tool Box](http://www-ve
- passwd:sasa
<a id="org682fc05"></a>
<a id="org137a3ee"></a>
# Screencasts
......@@ -833,7 +833,7 @@ cf the Docker Install section of the [Synchrone Reactive Tool Box](http://www-ve
cf <http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/sasa/screencasts/>
<a id="org11d9306"></a>
<a id="orgb2b8f50"></a>
# More
......@@ -842,12 +842,12 @@ cf <http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/sasa/screencasts/>
- Tutorials: <https://verimag.gricad-pages.univ-grenoble-alpes.fr/vtt//tags/sasa/>
<a id="orgfc8c2b2"></a>
<a id="org441d3ab"></a>
# FAQ
<a id="org72c0095"></a>
<a id="orgc933a8d"></a>
## Is there a FAQ?
......@@ -856,7 +856,7 @@ Yes.
Beside, some tutorials are also available here: <https://verimag.gricad-pages.univ-grenoble-alpes.fr/vtt/tags/sasa/>
<a id="orge57b20e"></a>
<a id="org51d450b"></a>
## I have a compilation error that I don't understand
......@@ -866,8 +866,8 @@ Beside, some tutorials are also available here: <https://verimag.gricad-pages.un
- If the message is totally useless, please feel free to add an issue here <https://gricad-gitlab.univ-grenoble-alpes.fr/verimag/synchrone/sasa/issues>
<a id="orgcbfe32e"></a>
<a id="org823c711"></a>
## I have the error `Invalid_argument("compare: functional value")`
Most probably you a try to compare 2 `'s Algo.neighbor`. It's an abstract type, hence you cannot compare them, i.e., you cannot use `Stdlib.compare`, nor its twins (`<>`, `>`, `<`, etc.), nor functions that use them (`min`, `max`, `List.sort`, etc.). You should compare their `pid` instead (if the network is not anonymous).
Most probably you a try to compare 2 `'s Algo.neighbor`. It's an abstract type, hence you cannot compare them, i.e., you cannot use `Stdlib.compare`, nor its twins (`<>`, `>`, `<`, etc.), nor functions that use them (`min`, `max`, `List.sort`, etc.). You should compare their `pid` instead (if the network is not anonymous).
\ No newline at end of file
......@@ -530,7 +530,7 @@ make rdbg
This make rule (defined in =Makefile= and =../Makefile.inc=)
1. generates the =ring.ml= file, that contains the registration code
(that can indeed be generated by sasa, as explained in =algo.mli=).
2. launches =rdbg= with some arguments (=rdbg -o ring.rif -sut "sasa ring.dot --locally-central-daemon"=).
2. launches =rdbg= with some arguments (=rdbg --sasa -o ring.rif -sut "sasa ring.dot --locally-central-daemon"=).
=rdbg= then prompts the user to
enter one of the following commands:
......@@ -605,7 +605,7 @@ that take advantage of the versatility (programmability) of
1. type =rdbg=
2. press enter to load the defaut session (=rdbg-session.ml=).
Then you can type:
3. =d= for displaying a (dynamic) dot graph with =dot=
3. =gv= (graph view) for displaying a (dynamic) dot graph with =dot=
4. or ALTERNATIVELY =ne= to use the =neato= layout engine (=tw=, =ci=,
=fd=, =sf=, =pa=, =os= to use the =twopi=, =circo=, =fdp=, =sfd=,
=patchwork=, =osage= layout engines respectively)
......@@ -730,7 +730,7 @@ the dot_view command as follows:
To install it:
#+BEGIN_SRC sh :eval no
opam depext -y rdbgui4ocaml
opam depext -y rdbgui4ocaml -- useless with opam >= 2.1
opam install -y rdbgui4ocaml
#+END_SRC
......@@ -807,7 +807,7 @@ opam install -y sasa
And optionally (to define test oracles in Lustre or daemons in Lutin):
#+BEGIN_SRC sh :eval no
opam depext -y rdbgui4sasa lutin
opam depext -y rdbgui4sasa lutin -- useless with opam >= 2.1
opam install -y rdbgui4sasa lutin lustre-v6
#+END_SRC
......@@ -818,8 +818,8 @@ mkdir ~/lv4 # for example
cd ~/lv4
wget http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v4/distrib/linux64/lustre-v4-III-e-linux64.tgz
tar xvzf lustre-v4-III-e-linux64.tgz
echo "LUSTRE_INSTALL=~/lv4/lustre-v4-III-e-linux64" >> ~/.bashrc # if you are using bash
echo "PATH=$LUSTRE_INSTALL/bin:$PATH" >> ~/.bashrc
echo "export LUSTRE_INSTALL=~/lv4/lustre-v4-III-e-linux64" >> ~/.bashrc # if you are using bash
echo "export PATH=$LUSTRE_INSTALL/bin:$PATH" >> ~/.bashrc
sudo apt install -y wish
#+END_SRC
......@@ -866,8 +866,8 @@ mkdir ~/lv4 # for example
cd ~/lv4
wget http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v4/distrib/linux64/lustre-v4-III-e-linux64.tgz
tar xvzf lustre-v4-III-e-linux64.tgz
echo "LUSTRE_INSTALL=~/lv4/lustre-v4-III-e-linux64" >> ~/.bashrc # if you are using bash
echo "PATH=$LUSTRE_INSTALL/bin:$PATH" >> ~/.bashrc
echo "export LUSTRE_INSTALL=~/lv4/lustre-v4-III-e-linux64" >> ~/.bashrc # if you are using bash
echo "export PATH=$LUSTRE_INSTALL/bin:$PATH" >> ~/.bashrc
sudo apt install -y wish
#+END_SRC
Otherwise:
......
......@@ -147,8 +147,8 @@ let (make_do: string array -> 'v SimuState.t -> RdbgPlugin.t) =
(get_action_value sl_in) Step.f
in
(* 3: Do the steps *)
let st = Sasacore.Step.f pnal st in
sasa_config := st.config;
let nst = Sasacore.Step.f pnal st in
sasa_config := nst.config;
("silent", Data.B silent)::("legitimate", Data.B legit)::pot_sl @
(from_sasa_env st) @ (get_sl_out true pl enab_ll) @
(get_sl_out false pl activate_val)
......
(* Time-stamp: <modified the 19/09/2021 (at 23:06) by Erwan Jahier> *)
(* Time-stamp: <modified the 31/03/2022 (at 16:12) by Erwan Jahier> *)
(** The module is used by
- the main sasa simulation loop (in ../../src/sasaMain.ml)
......@@ -12,7 +12,7 @@
type 'v t = {
sasarg: SasArg.t;
network: 'v Process.t list;
neighbors: ('v Register.neighbor list) Map.Make(String).t; (* pid's neigbors *)
neighbors: ('v Register.neighbor list) Map.Make(String).t; (* pid's neighbors *)
config: 'v Env.t
}
......@@ -24,10 +24,10 @@ type 'v enable_processes =
val get_enable_processes: 'v t -> 'v enable_processes
(** update the config *)
(** [update_config e c] updates c using e *)
val update_config: 'v Env.t -> 'v t -> 'v t
(** Get pid's state and neigbors *)
(** Get pid's state and neighbors *)
val neigbors_of_pid : 'v t -> string -> 'v * ('v Register.neighbor * string) list
(* For SasaRun *)
......
......@@ -81,7 +81,7 @@ let rdbg_get (cmd: string): string =
| None -> assert false
(** Compte le nombre de noeuds *)
let rdbg_count_nodes (): int =
let _rdbg_count_nodes (): int =
let cmd = " List.length (List.filter (fun (n,v) -> String.length n > 5 && String.sub n 0 5 = \"Enab_\") !e.outputs);;" in
let res = rdbg_get cmd in
(* rdbg renvoie une réponse qui ressemble à "- : int = 7" *)
......@@ -186,8 +186,8 @@ let update_rdbg_hook node activate =
()
(* GTK3 *)
let locale = GtkMain.Main.init ()
let thread = GtkThread.start()
let _locale = GtkMain.Main.init ()
let _thread = GtkThread.start()
let main () =
let window = GWindow.window ~width:320 ~height:240
~title:"Daemon GUI"
......
......@@ -7,13 +7,13 @@ open UdgUtils
open Sasacore
exception Incorrect_attribute
(* exception Incorrect_attribute *)
let min_max = ref None
let connected = ref None
let cyclic = ref None
let tree = ref None
let height:int option ref = ref None
(* let height:int option ref = ref None *)
let generate_du_dur graph plan_udg t : unit =
if (t.dotUDG <> "") then (
......
......@@ -160,9 +160,11 @@ let to_pdf engine par_var only_parent rn g f e =
(fun n ->
let l = g.succ n.id in
List.mapi (fun i t ->
if is_parent "par" n.id i e then
if g.directed then
Printf.sprintf "%s -> %s" t n.id
else if is_parent "par" n.id i e then
Printf.sprintf "%s -> %s" n.id t
else if n.id < t then
else if n.id < t then (* to avoid duplication in undir graphs *)
Printf.sprintf "%s -- %s" n.id t
else
Printf.sprintf "%s -- %s" t n.id
......
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