Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DSL pour Robotique en essaim
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Kylian Fontaine
DSL pour Robotique en essaim
Commits
a4c98492
Commit
a4c98492
authored
10 months ago
by
Kylian Fontaine
Browse files
Options
Downloads
Patches
Plain Diff
Verification graphe measure acyclique
parent
f21a2aee
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/ast.ml
+6
-3
6 additions, 3 deletions
lib/ast.ml
with
6 additions
and
3 deletions
lib/ast.ml
+
6
−
3
View file @
a4c98492
...
...
@@ -295,15 +295,17 @@ end
module
G
=
Graph
.
Imperative
.
Digraph
.
ConcreteLabeled
(
Node
)(
Edge
)
module
Topological
=
Graph
.
Topological
.
Make
(
G
)
module
D
=
Graph
.
Traverse
.
Dfs
(
G
)
type
edge
=
|
Nolab
of
(
expr
*
expr
)
(**[graph_from_edges el] creates a graph from a list of edges [el]
@param edge [list]
@return [G.t]*)
let
graph_from_edges
(
el
:
edge
list
)
=
let
g
=
G
.
create
()
in
let
nolab
=
fun
(
x
,
y
)
->
let
vx
=
G
.
V
.
create
x
in
...
...
@@ -315,7 +317,8 @@ let graph_from_edges (el : edge list)=
|
[]
->
()
|
(
Nolab
h
)
::
t
->
nolab
h
;
add_edge
t
in
add_edge
el
;
g
if
not
(
D
.
has_cycle
g
)
then
g
else
raise
(
Failure
(
"Graph is cyclic"
))
(**[png_from_graph g name] generates a png file of the graph [g]
@param g [G.t]
...
...
@@ -334,7 +337,7 @@ let png_from_graph g name=
let
oc
=
open_out
(
"./generate/"
^
name
^
"_measure.dot"
)
in
Printf
.
fprintf
oc
"%s
\n
"
dot
;
close_out
oc
;
ignore
(
Sys
.
command
(
"dot -Tpng
"
^
name
^
"
.dot -o ./generate/"
^
name
^
"_measure.png"
))
ignore
(
Sys
.
command
(
"dot -Tpng
./generate/"
^
name
^
"_measure
.dot -o ./generate/"
^
name
^
"_measure.png"
))
(**[assign_heigth g] returns the phase, phase weight association list. The phase weight is deduced from the order
topology of the phase
...
...
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