Skip to content
Snippets Groups Projects
Commit 27f447d9 authored by erwan's avatar erwan
Browse files

Enhance doc

parent 99bab12b
No related branches found
No related tags found
No related merge requests found
- [Dot files](#orgb64a426) - [Dot files](#org6667d72)
- [Algorithms](#orgcbdd346) - [Algorithms](#org32323ab)
- [Installation (not yet working)](#org5811f90) - [Simulation](#org0285ecd)
- [Installation (not yet working)](#orge431269)
Basically, one needs to provide Basically, one needs to provide
...@@ -8,14 +9,14 @@ Basically, one needs to provide ...@@ -8,14 +9,14 @@ Basically, one needs to provide
2. the algorithms mentionned in the dot file 2. the algorithms mentionned in the dot file
<a id="orgb64a426"></a> <a id="org6667d72"></a>
# Dot files # Dot files
Dot files should Dot files should
- follow the graphviz/dot format (cf <https://en.wikipedia.org/wiki/DOT_(graph_description_language)>). 1. follow the [graphviz/dot format](https://en.wikipedia.org/wiki/DOT_(graph_description_language)).
- contain nodes labelled by the `algo` field 2. contain nodes labelled by the `algo` field
```dot ```dot
graph ring { graph ring {
...@@ -32,7 +33,7 @@ graph ring { ...@@ -32,7 +33,7 @@ graph ring {
``` ```
<a id="orgcbdd346"></a> <a id="org32323ab"></a>
# Algorithms # Algorithms
...@@ -42,26 +43,34 @@ Those algorithms must provide: ...@@ -42,26 +43,34 @@ Those algorithms must provide:
2. an `enable` fonction that says which actions are enabled (i.e., that can be activated) 2. an `enable` fonction that says which actions are enabled (i.e., that can be activated)
3. a `step` function that executes enabled actions 3. a `step` function that executes enabled actions
More precisely, each algorithm should provide 3 functions More precisely, each algorithm should provide 3 functions that must be registred with:
- `reg_vars` - `reg_vars`
- `reg_enable` - `reg_enable`
- `reg_step` - `reg_step`
which profile is defined in <../lib/algo/algo.mli> which profiles is defined in <../lib/algo/algo.mli>
Each algorithm must then register them (using `reg_vars`, `reg_enable`, and `reg_step` respectively).
Algorithms must then be compiled with `ocamlopt -shared` to produce the cmxs files mentionned in the dot. Algorithms must then be compiled with `ocamlopt -shared` to produce the cmxs files mentionned in the dot.
```sh ```sh
ocamlopt -shared -I +sasa algo.ml -o algo.cmxs ocamlopt -shared -I +sasa some_algo.ml -o some_algo.cmxs
``` ```
Some examples can be found in the <./test/> directory. Some examples can be found in the <./test/> directory.
<a id="org5811f90"></a> <a id="org0285ecd"></a>
# Simulation
```sh
sasa some_topo.dot
sasa --help
```
<a id="orge431269"></a>
# Installation (not yet working) # Installation (not yet working)
......
...@@ -8,9 +8,8 @@ Basically, one needs to provide ...@@ -8,9 +8,8 @@ Basically, one needs to provide
* Dot files * Dot files
Dot files should Dot files should
- follow the graphviz/dot format (cf 1. follow the [[https://en.wikipedia.org/wiki/DOT_(graph_description_language)][graphviz/dot format]].
https://en.wikipedia.org/wiki/DOT_(graph_description_language)). 2. contain nodes labelled by the =algo= field
- contain nodes labelled by the =algo= field
#+BEGIN_SRC dot #+BEGIN_SRC dot
graph ring { graph ring {
...@@ -34,23 +33,29 @@ Those algorithms must provide: ...@@ -34,23 +33,29 @@ Those algorithms must provide:
2. an =enable= fonction that says which actions are enabled (i.e., that can be activated) 2. an =enable= fonction that says which actions are enabled (i.e., that can be activated)
3. a =step= function that executes enabled actions 3. a =step= function that executes enabled actions
More precisely, each algorithm should provide 3 functions More precisely, each algorithm should provide 3 functions that must
be registred with:
- =reg_vars= - =reg_vars=
- =reg_enable= - =reg_enable=
- =reg_step= - =reg_step=
which profile is defined in file:../lib/algo/algo.mli
Each algorithm must then register them (using =reg_vars=, =reg_enable=, which profiles is defined in [[file:../lib/algo/algo.mli]]
and =reg_step= respectively).
Algorithms must then be compiled with =ocamlopt -shared= to produce Algorithms must then be compiled with =ocamlopt -shared= to produce
the cmxs files mentionned in the dot. the cmxs files mentionned in the dot.
#+BEGIN_SRC sh #+BEGIN_SRC sh
ocamlopt -shared -I +sasa algo.ml -o algo.cmxs ocamlopt -shared -I +sasa some_algo.ml -o some_algo.cmxs
#+END_SRC #+END_SRC
Some examples can be found in the file:./test/ directory. Some examples can be found in the [[file:./test/]] directory.
* Simulation
#+BEGIN_SRC sh
sasa some_topo.dot
sasa --help
#+END_SRC
* Installation (not yet working) * Installation (not yet working)
......
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