Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sogMBT
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
PMC-SOG
sogMBT
Commits
5a26bbc0
Commit
5a26bbc0
authored
2 months ago
by
Jaime Arias
Browse files
Options
Downloads
Patches
Plain Diff
refactor: ExportGraphToDotFile
parent
c12aa8a1
No related branches found
No related tags found
No related merge requests found
Pipeline
#9267
failed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sog.cpp
+7
-6
7 additions, 6 deletions
src/sog.cpp
src/sog.hpp
+3
-3
3 additions, 3 deletions
src/sog.hpp
with
10 additions
and
9 deletions
src/sog.cpp
+
7
−
6
View file @
5a26bbc0
...
...
@@ -3,6 +3,7 @@
#include
<fstream>
// Table with the BDD nodes of the graph
bdd
*
bdd_tab
;
void
SOG
::
set_initial_state
(
Aggregate
*
state
)
{
...
...
@@ -85,9 +86,9 @@ void SOG::PrintGraph(Aggregate *state, size_t counter) {
}
}
void
SOG
::
GenerateReachability
GraphDot
f
ile
(
const
std
::
string
&
filename
)
const
{
void
SOG
::
Export
Graph
To
Dot
F
ile
(
const
std
::
string
&
filename
)
const
{
// Open file for writing
std
::
ofstream
file
(
"./result/"
+
filename
+
".dot"
);
std
::
ofstream
file
(
filename
+
".dot"
);
// Check if the file opened successfully
if
(
!
file
.
is_open
())
{
...
...
@@ -95,12 +96,12 @@ void SOG::GenerateReachabilityGraphDotfile(const std::string &filename) const {
return
;
}
std
::
cout
<<
"
l
e graph cont
ient
: "
<<
states
.
size
()
<<
'
\n'
;
std
::
cout
<<
"
th
e graph cont
ains
: "
<<
nb_
states
<<
'
states
\
n
'
;
file
<<
"digraph reachab_graph {"
<<
'\n'
;
for
(
const
auto
*
GONode
:
states
)
{
for
(
const
auto
&
edge
:
GONode
->
successors
)
{
file
<<
"ag_"
<<
GONode
->
state
.
id
()
<<
" -> "
for
(
const
auto
*
aggr
:
states
)
{
for
(
const
auto
&
edge
:
aggr
->
successors
)
{
file
<<
"ag_"
<<
aggr
->
state
.
id
()
<<
" -> "
<<
"ag_"
<<
edge
.
state
->
state
.
id
()
<<
" [ label =
\"
t"
<<
edge
.
transition
+
1
<<
"
\"
]"
<<
'\n'
;
}
...
...
This diff is collapsed.
Click to expand it.
src/sog.hpp
+
3
−
3
View file @
5a26bbc0
...
...
@@ -110,10 +110,10 @@ class SOG {
void
PrintGraph
(
Aggregate
*
state
,
size_t
counter
);
/**
*
Print reachability
graph
using
graphviz
notation
* @param filename
*
Export
graph
to
graphviz
file
* @param filename
the name of the file
*/
void
GenerateReachability
GraphDot
f
ile
(
const
std
::
string
&
filename
)
const
;
void
Export
Graph
To
Dot
F
ile
(
const
std
::
string
&
filename
)
const
;
};
#endif // SOG_H_
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