Skip to content
Snippets Groups Projects
Commit 211b152a authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Ignore properties of input graph

We want to be able to re-compute the cost, starting from the output of
a previous run of `cost_function.py`, when we have discarded the input
file of the previous run.
parent 8bf3b9e4
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
"""This script takes the graph of segments without cost and computes
the cost applied to edges.
"""This script takes a graph of segments and computes the cost applied
to edges.
Input:
-- the graph of segments without cost;
-- the graph of segments;
-- the SHPC.
Output: the graph of segments with cost.
The inst_eddies property of vertices is not modified by this
script. All the content of the input graph is part of the output graph
so the input file may be removed, if desired, after running this
script.
script. The cost is an internal property of the output graph. This
internal property is created if it was not already in the input
graph. The cost is overwritten if it was already in the input graph.
"""
......@@ -217,7 +217,18 @@ delta_r_std = 8.6953e3 # in m
# Load the graph_tool file:
print("Loading graph...")
g = graph_tool.load_graph(args.input_segments)
g = graph_tool.load_graph(
args.input_segments,
ignore_vp=[
"pos_first",
"pos_last",
"first_av_rad",
"first_av_ros",
"last_av_rad",
"last_av_ros",
],
ignore_ep=["cost_function"],
)
print("Loading done...")
print("Input graph:")
print("Number of vertices:", g.num_vertices())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment