Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
VIGNET Pierre
cadbiom
Commits
0b6c50d3
Commit
0b6c50d3
authored
Oct 26, 2018
by
VIGNET Pierre
Browse files
solutions_2_graph: add doc; rename sub functions
parent
e797db74
Changes
3
Hide whitespace changes
Inline
Side-by-side
command_line/cadbiom_cmd/cadbiom_cmd.py
View file @
0b6c50d3
...
...
@@ -58,7 +58,11 @@ def launch_sort(args):
def
solutions_2_graph
(
args
):
"""Parse a complete solution file and make a representation of trajectories.
"""Create GraphML formated files containing a representation of the
trajectories for every solution in complete MAC files (*cam_complete files).
This is a function to visualize paths taken by the solver from the boundaries
to the entities of interest.
"""
# Module import
...
...
command_line/cadbiom_cmd/solution_repr.py
View file @
0b6c50d3
...
...
@@ -196,7 +196,7 @@ def draw_graph(output_dir, solution, solution_index, G,
plt
.
show
()
def
process
_solutions
(
output_dir
,
sol_steps
,
transitions
):
def
convert
_solution
_file_to_graph
s
(
output_dir
,
sol_steps
,
transitions
):
"""Build a graph based on the given solution
Each solution is composed of a set of frontier places and steps,
...
...
@@ -336,7 +336,7 @@ def solutions_2_graph(output_dir, model_file, solution_path):
if
os
.
path
.
isfile
(
solution_path
):
# The given path is a solution file
process
_solutions
(
convert
_solution
_file_to_graph
s
(
output_dir
,
load_solutions
(
solution_path
),
model_transitions
...
...
@@ -351,7 +351,7 @@ def solutions_2_graph(output_dir, model_file, solution_path):
for
file_number
,
solution_path
in
\
enumerate
(
glob
.
glob
(
solution_path
+
'*cam_complete.txt'
),
1
):
process
_solutions
(
convert
_solution
_file_to_graph
s
(
output_dir
,
load_solutions
(
solution_path
),
model_transitions
...
...
command_line/cadbiom_cmd/solution_sort.py
View file @
0b6c50d3
...
...
@@ -111,6 +111,13 @@ def sort_solutions(path):
def
solutions_2_json
(
output_dir
,
model_file
,
solution_path
,
conditions
=
True
):
"""Entry point for solutions_2_json
Create a JSON formated file containing all data from complete MAC files
(*cam_complete files). The file will contain frontier places/boundaries
and decompiled steps with their respective events for each solution.
This is a function to quickly search all transition attributes involved
in a solution.
This functions tests if the given path is a directory or a file.
:param output_dir: Output path.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment