Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sogMBT
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
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
4a6aed5f
Commit
4a6aed5f
authored
4 months ago
by
Jaime Arias
Browse files
Options
Downloads
Patches
Plain Diff
refactor: rename GONodes by states
parent
b870bc84
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sog.cpp
+8
-8
8 additions, 8 deletions
src/sog.cpp
src/sog.hpp
+33
-9
33 additions, 9 deletions
src/sog.hpp
with
41 additions
and
17 deletions
src/sog.cpp
+
8
−
8
View file @
4a6aed5f
...
...
@@ -5,12 +5,12 @@
bdd
*
tab
;
void
SOG
::
set_initial_state
(
Aggregate
*
s
)
{
current_state
=
initial_state
=
s
;
void
SOG
::
set_initial_state
(
Aggregate
*
s
tate
)
{
current_state
=
initial_state
=
s
tate
;
}
Aggregate
*
SOG
::
FindState
(
const
Aggregate
*
s
)
const
{
for
(
auto
*
GONode
:
GONod
es
)
{
for
(
auto
*
GONode
:
stat
es
)
{
if
(
s
->
state
.
id
()
==
GONode
->
state
.
id
())
{
return
GONode
;
}
...
...
@@ -20,7 +20,7 @@ Aggregate *SOG::FindState(const Aggregate *s) const {
void
SOG
::
InsertState
(
Aggregate
*
s
)
{
s
->
visited
=
false
;
this
->
GONod
es
.
push_back
(
s
);
this
->
stat
es
.
push_back
(
s
);
nb_states
++
;
}
...
...
@@ -46,7 +46,7 @@ void SOG::PrintCompleteInformation() {
std
::
cout
<<
"
\n\n
GRAPH SIZE :"
;
std
::
cout
<<
"
\n\t
NB MARKING : "
<<
nb_marking
;
std
::
cout
<<
"
\n\t
NB NODES : "
<<
nb_states
;
std
::
cout
<<
"
\n\t
NB ARCS : "
<<
nb_
arc
s
<<
"
\n
"
;
std
::
cout
<<
"
\n\t
NB ARCS : "
<<
nb_
edge
s
<<
"
\n
"
;
tab
=
new
bdd
[
static_cast
<
int
>
(
nb_states
)];
...
...
@@ -97,10 +97,10 @@ void SOG::GenerateReachabilityGraphDotfile(const std::string &filename) const {
return
;
}
std
::
cout
<<
"le graph contient : "
<<
GONod
es
.
size
()
<<
'\n'
;
std
::
cout
<<
"le graph contient : "
<<
stat
es
.
size
()
<<
'\n'
;
file
<<
"digraph reachab_graph {"
<<
'\n'
;
for
(
const
auto
*
GONode
:
GONod
es
)
{
for
(
const
auto
*
GONode
:
stat
es
)
{
for
(
const
auto
&
edge
:
GONode
->
successors
)
{
file
<<
"ag_"
<<
GONode
->
state
.
id
()
<<
" -> "
<<
"ag_"
<<
edge
.
first
->
state
.
id
()
<<
" [ label =
\"
t"
...
...
@@ -147,5 +147,5 @@ void SOG::PrintPredecessors(const Aggregate *s) const {
}
void
SOG
::
IncrementNbArcs
()
{
nb_
arc
s
++
;
nb_
edge
s
++
;
}
This diff is collapsed.
Click to expand it.
src/sog.hpp
+
33
−
9
View file @
4a6aed5f
...
...
@@ -5,19 +5,49 @@
#include
"aggregate.hpp"
// definition of types
typedef
std
::
vector
<
Aggregate
*>
Aggregates
;
class
SOG
{
public:
/**
* Constructor
*/
SOG
()
=
default
;
Aggregates
GONodes
;
/**
* Destructor
*/
~
SOG
()
=
default
;
/**
* States of the graph
*/
Aggregates
states
;
/**
* Initial state of the graph
*/
Aggregate
*
initial_state
{
nullptr
};
Aggregate
*
current_state
{
nullptr
};
/**
* Number of states of the graph
*/
size_t
nb_states
{
0
};
/**
* Number of edges of the graph
*/
size_t
nb_edges
{
0
};
Aggregate
*
current_state
{
nullptr
};
double
nb_marking
{
0
};
size_t
nb_arcs
{
0
};
/**
* Set the initial state of this graph
* @param state the initial state
*/
void
set_initial_state
(
Aggregate
*
state
);
/**
* Find a state
...
...
@@ -65,12 +95,6 @@ class SOG {
*/
void
InsertState
(
Aggregate
*
s
);
/**
* Set the initial state of this graph
* @param s
*/
void
set_initial_state
(
Aggregate
*
s
);
/**
* Print the information of the graph
*/
...
...
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