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
47e9c3fd
Commit
47e9c3fd
authored
2 months ago
by
Jaime Arias
Browse files
Options
Downloads
Patches
Plain Diff
feat: save generated sog at the end of the pipeline
parent
e8c4d60a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#9284
passed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.cpp
+15
-8
15 additions, 8 deletions
src/main.cpp
with
15 additions
and
8 deletions
src/main.cpp
+
15
−
8
View file @
47e9c3fd
...
...
@@ -38,7 +38,7 @@ bool ValidTransitionName(const std::string& str) {
* @param obs_paths Set of observable paths
*/
void
SaveObservablePaths
(
const
Paths
&
obs_paths
,
const
string
&
output_file
)
{
cout
<<
"
\n
Saving results in
"
<<
output_file
<<
'\n'
;
cout
<<
"
\n
Saving results in "
<<
output_file
<<
'\n'
;
ofstream
my_file
(
output_file
);
my_file
<<
"# paths: "
<<
obs_paths
.
size
()
<<
'\n'
;
...
...
@@ -88,11 +88,12 @@ void PrintStats(const Paths& abstract_paths) {
* @param obs_transitions observable transitions
* @param obs_paths set of observable paths
* @param abstract_paths set of abstract paths
* @param output_file file where the information will be saved
* @param output_file
_prefix
file where the information will be saved
*/
void
PrintOutput
(
const
net
&
model
,
SOG
&
sog
,
const
map
<
int
,
int
>&
obs_transitions
,
const
Paths
&
obs_paths
,
const
Paths
&
abstract_paths
,
const
string
&
output_file
)
{
const
Paths
&
abstract_paths
,
const
string
&
output_file_prefix
)
{
// print SOG information
sog
.
PrintCompleteInformation
();
cout
<<
"
\n
# transition: "
<<
model
.
transitions
.
size
()
<<
'\n'
;
...
...
@@ -103,7 +104,12 @@ void PrintOutput(const net& model, SOG& sog,
PrintStats
(
abstract_paths
);
// save observable paths in the folder
SaveObservablePaths
(
obs_paths
,
output_file
);
SaveObservablePaths
(
obs_paths
,
output_file_prefix
+
"_obs_paths.txt"
);
// save generate SOG
const
string
sog_file
=
output_file_prefix
+
"_sog.dot"
;
cout
<<
"Saving generated SOG in "
<<
sog_file
<<
'\n'
;
sog
.
ExportGraphToDotFile
(
sog_file
);
}
/**
...
...
@@ -193,7 +199,8 @@ void FindObservableTransitions(net& model, map<int, int>& obs_trans,
*/
void
ComputeAbstractPaths
(
const
string
&
net_file
,
int
bound
,
const
string
&
transitions_file
,
const
string
&
output_folder
)
{
const
string
&
output_folder
,
const
bool
save_sog
=
false
)
{
SOG
sog
;
Paths
obs_paths
;
Paths
abstract_paths
;
...
...
@@ -234,7 +241,6 @@ void ComputeAbstractPaths(const string& net_file, int bound,
auto
paths_time
=
GetTime
()
-
start_paths_time
;
cout
<<
" done
\n
Time for computing observable paths: "
<<
paths_time
<<
" seconds
\n
"
;
sog
.
ExportGraphToDotFile
(
"./sog.dot"
);
// add abstract paths
cout
<<
"
\n
Computing abstract paths ..."
;
...
...
@@ -252,8 +258,9 @@ void ComputeAbstractPaths(const string& net_file, int bound,
// print output
string
model_name
=
GetModelName
(
net_file
);
string
output_file
=
output_folder
+
"/obs_paths_"
+
model_name
+
".txt"
;
PrintOutput
(
model
,
sog
,
obs_trans
,
obs_paths
,
abstract_paths
,
output_file
);
string
output_file_prefix
=
output_folder
+
"/"
+
model_name
;
PrintOutput
(
model
,
sog
,
obs_trans
,
obs_paths
,
abstract_paths
,
output_file_prefix
);
}
/******************************************************************************
...
...
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