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

Get `e_overestim` from graph property

Instead of reading it from standard input.
parent d37f8e24
No related branches found
No related tags found
No related merge requests found
......@@ -5,12 +5,14 @@
<!-- property keys -->
<key id="key0" for="edge" attr.name="cost_function" attr.type="float" />
<key id="key1" for="graph" attr.name="e_overestim" attr.type="int" />
<key id="key3" for="node" attr.name="inst_eddies" attr.type="vector_int" />
<key id="key6" for="node" attr.name="name" attr.type="string" />
<graph id="G" edgedefault="directed" parse.nodeids="canonical" parse.edgeids="canonical" parse.order="nodesfirst">
<!-- graph properties -->
<data key="key1">10</data>
<!-- vertices -->
<node id="n0">
......
......@@ -74,16 +74,14 @@
"command": [
"$src_dir/Trajectories/trajectories.py",
"$tests_old_dir/Cost_functions/segments_cost_functions.graphml"
],
"input": "10"
]
},
"Greece_trajectories": {
"description": "A larger case than Trajectories.",
"command": [
"$src_dir/Trajectories/trajectories.py",
"$tests_old_dir/Greece_cost_function/segments_cost_functions.graphml"
],
"input": "7"
]
},
"Draw_segments":
{
......@@ -125,8 +123,7 @@
"$src_dir/Trajectories/trajectories.py",
"$src_dir/Trajectories/Tests/segments_cost.graphml"
],
"description": "A toy case of division followed by fusion.",
"input": "10"
"description": "A toy case of division followed by fusion."
},
"Test_order_edges":
{
......@@ -135,7 +132,6 @@
"$src_dir/Trajectories/trajectories.py",
"$src_dir/Trajectories/Tests/example_2.graphml"
],
"description": "A toy case to test the algorithm in trajectories.py, specifically to test the order in which edges are processed.",
"input": "10"
"description": "A toy case to test the algorithm in trajectories.py, specifically to test the order in which edges are processed."
}
}
......@@ -83,8 +83,6 @@ def assign_traj_edge(source, target, traj_prop, ind_traj, g, traj_segm,
if len(sys.argv) != 2: sys.exit("Required argument: input-graph")
g = graph_tool.load_graph(sys.argv[1])
e_overestim = input("Enter e_overestim: ")
e_overestim = int(e_overestim)
traj_prop = g.new_vertex_property('int', val = - 1)
# Trajectory index to which a segment belongs. - 1 means the segment
......@@ -101,7 +99,7 @@ my_subgraphs = {}
if "cost_function" in g.edge_properties:
for v in g.vertices():
date_index = report_graph.node_to_date_eddy(int(g.vp.name[v]),
e_overestim,
g.gp.e_overestim,
only_date = True)
if date_index in my_subgraphs:
......
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