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
565c9b7d
Commit
565c9b7d
authored
2 years ago
by
Jaime Arias
Browse files
Options
Downloads
Patches
Plain Diff
some refactor
parent
56595a15
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.cpp
+11
-12
11 additions, 12 deletions
src/main.cpp
with
11 additions
and
12 deletions
src/main.cpp
+
11
−
12
View file @
565c9b7d
...
...
@@ -88,9 +88,6 @@ void print_output(const net& model, MDGraph& g,
const
map
<
int
,
int
>&
obs_transitions
,
const
paths_t
&
obs_paths
,
const
paths_t
&
abstract_paths
,
float
elapsed_time
,
const
string
&
output_file
)
{
// save observable paths in the folder
save_observable_paths
(
obs_paths
,
output_file
);
// print SOG information
g
.
printCompleteInformation
();
cout
<<
"
\n
# transition: "
<<
model
.
transitions
.
size
()
<<
endl
;
...
...
@@ -104,6 +101,9 @@ void print_output(const net& model, MDGraph& g,
// print consumed time
cout
<<
"
\n
Time for computing all the paths: "
<<
elapsed_time
<<
" seconds"
<<
endl
;
// save observable paths in the folder
save_observable_paths
(
obs_paths
,
output_file
);
}
/**
...
...
@@ -191,14 +191,15 @@ void find_observable_transitions(net& model, map<int, int>& obs_trans,
void
compute_abstract_paths
(
const
string
&
net_file
,
int
bound
,
const
string
&
transitions_file
,
const
string
&
output_folder
)
{
MDGraph
g
;
paths_t
obs_paths
;
paths_t
abstract_paths
;
set
<
int
>
unobs_trans
;
map
<
int
,
int
>
obs_trans
;
net
model
=
load_net
(
net_file
);
double
d
=
getTime
();
// find observable transitions
set
<
int
>
unobs_trans
;
map
<
int
,
int
>
obs_trans
;
// if a path with transitions is not given, then we apply the algorithm to
// find the needed observable transitions to cover all the behaviors
if
(
transitions_file
==
""
)
{
...
...
@@ -209,26 +210,24 @@ void compute_abstract_paths(const string& net_file, int bound,
// build the SOG
cout
<<
"Building SOG ..."
;
MDGraph
g
;
RdPBDD
SOG
(
model
,
obs_trans
,
unobs_trans
,
bound
);
cout
<<
" done"
<<
endl
;
// compute the observable paths
paths_t
obs_paths
=
SOG
.
chem_obs
(
g
,
obs_trans
);
obs_paths
=
SOG
.
chem_obs
(
g
,
obs_trans
);
// add abstract paths
paths_t
abstract_paths
;
for
(
auto
path
:
obs_paths
)
{
abstract_paths
.
insert
(
SOG
.
chem_abs
(
path
,
g
));
}
// time for generating the paths
float
tps
=
getTime
()
-
d
;
float
elapsed_time
=
getTime
()
-
d
;
// print output
string
model_name
=
get_model_name
(
net_file
);
string
output_file
=
output_folder
+
"/no_optimal_"
+
model_name
+
".txt"
;
print_output
(
model
,
g
,
obs_trans
,
obs_paths
,
abstract_paths
,
tps
,
print_output
(
model
,
g
,
obs_trans
,
obs_paths
,
abstract_paths
,
elapsed_time
,
output_file
);
}
...
...
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