Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sasa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
verimag
synchrone
sasa
Commits
7edff769
Commit
7edff769
authored
6 years ago
by
erwan
Browse files
Options
Downloads
Patches
Plain Diff
New: add a --seed option
parent
66a23e9e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin/sasArg.ml
+7
-1
7 additions, 1 deletion
bin/sasArg.ml
bin/sasa.ml
+10
-3
10 additions, 3 deletions
bin/sasa.ml
test/bfs-spanning-tree/Makefile
+3
-2
3 additions, 2 deletions
test/bfs-spanning-tree/Makefile
with
20 additions
and
6 deletions
bin/sasArg.ml
+
7
−
1
View file @
7edff769
(* Time-stamp: <modified the 14/03/2019 (at 16:
1
5) by Erwan Jahier> *)
(* Time-stamp: <modified the 14/03/2019 (at 16:5
4
) by Erwan Jahier> *)
type
t
=
{
...
...
@@ -7,6 +7,7 @@ type t = {
mutable
verbose
:
int
;
mutable
demon
:
Demon
.
t
;
mutable
rif
:
bool
;
mutable
seed
:
int
;
mutable
ifi
:
bool
;
mutable
gen_lutin
:
bool
;
...
...
@@ -32,6 +33,7 @@ let (make_args : unit -> t) =
verbose
=
0
;
demon
=
Demon
.
Distributed
;
rif
=
false
;
seed
=
(
Random
.
self_init
()
;
Random
.
int
1073741823
);
ifi
=
false
;
gen_lutin
=
false
;
_args
=
[]
;
...
...
@@ -109,6 +111,10 @@ let (mkoptab : t -> unit) =
(
Arg
.
Unit
(
fun
()
->
args
.
rif
<-
true
))
[
"Follows RIF conventions"
];
mkopt
opt
[
"--seed"
;
"-seed"
]
(
Arg
.
Int
(
fun
i
->
args
.
seed
<-
i
))
[
"Set the pseudo-random generator seed of build-in demons"
];
mkopt
opt
~
hide
:
true
[
"--gen-lutin-demon"
;
"-gld"
]
(
Arg
.
Unit
(
fun
()
->
args
.
gen_lutin
<-
true
))
[
"Generate Lutin demons and exit"
];
...
...
This diff is collapsed.
Click to expand it.
bin/sasa.ml
+
10
−
3
View file @
7edff769
(* Time-stamp: <modified the 14/03/2019 (at 16:
06
) by Erwan Jahier> *)
(* Time-stamp: <modified the 14/03/2019 (at 16:
57
) by Erwan Jahier> *)
(* XXX Je pourrais utiliser Lwt pour rendre step non-bloquant, ce qui
permettrait d'accelerer la simu sur les machines qui ont plusieurs
...
...
@@ -158,8 +158,8 @@ let () =
let
nstr
=
String
.
concat
","
nstrl
in
try
Algo
.
verbose_level
:=
SasArg
.
args
.
verbose
;
Random
.
self_init
()
;
if
!
Algo
.
verbose_level
>
0
then
Printf
.
printf
"nodes: %s
\n
edges:
\n
"
nstr
;
Random
.
init
SasArg
.
args
.
seed
;
if
!
Algo
.
verbose_level
>
0
then
Printf
.
e
printf
"nodes: %s
\n
edges:
\n
"
nstr
;
let
e
=
Env
.
init
()
in
let
pl
=
List
.
map
(
Process
.
make
(
args
.
demon
=
Custom
))
nl
in
let
neighors
=
List
.
map
get_neighors
pl
in
...
...
@@ -179,6 +179,8 @@ let () =
exit
0
);
let
n
=
SasArg
.
args
.
length
in
if
SasArg
.
args
.
rif
then
(
if
SasArg
.
args
.
demon
<>
Demon
.
Custom
then
Printf
.
printf
"#seed %i
\n
"
SasArg
.
args
.
seed
;
Printf
.
printf
"#inputs %s
\n
"
(
if
SasArg
.
args
.
demon
=
Demon
.
Custom
then
(
let
f
p
=
List
.
map
...
...
@@ -189,6 +191,11 @@ let () =
)
else
""
);
Printf
.
printf
"#outputs %s
\n
"
(
StringOf
.
env_rif_decl
pl
);
flush
stdout
)
else
(
if
SasArg
.
args
.
demon
<>
Demon
.
Custom
then
(
Printf
.
printf
"The pseudo-random engine is used with seed %i
\n
"
SasArg
.
args
.
seed
;
flush
stdout
);
);
if
SasArg
.
args
.
ifi
then
(
List
.
iter
...
...
This diff is collapsed.
Click to expand it.
test/bfs-spanning-tree/Makefile
+
3
−
2
View file @
7edff769
# Time-stamp: <modified the 14/03/2019 (at 13:40) by Erwan Jahier>
# Time-stamp: <modified the 14/03/2019 (at 16:46) by Erwan Jahier>
test
:
test0 lurette0
test0
:
cmxs
$(
sasa
)
-l
200 fig5.1-noinit.dot
-sd
$(
sasa
)
-rif
-l
200 fig5.1-noinit.dot
-sd
cmxs
:
root.cmxs p.cmxs
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment