Commit 9cbc9185 authored by SOLIMAN Sylvain's avatar SOLIMAN Sylvain

double-signed edges for conflicting influences

parent 1bcf9c28
......@@ -127,6 +127,14 @@ create_cgraph(Id, Graph) :-
get_attribute(EdgeId, sign='+')
->
agset(GraphvizEdge, color, 'green4')
;
get_attribute(EdgeId, sign='±')
->
agset(GraphvizEdge, color, 'green4'),
atom_concat(EdgeName, '__neg', EdgeName2),
agedge(Graph, NodeA, NodeB, EdgeName2, true, GraphvizEdge2),
agset(GraphvizEdge2, arrowhead, 'tee'),
agset(GraphvizEdge2, color, 'red')
;
get_attribute(EdgeId, dir='none')
->
......
......@@ -123,7 +123,21 @@ influence_graph(GraphId) :-
add_vertex(GraphId, Input, InputId),
add_vertex(GraphId, Output, OutputId),
add_edge(GraphId, InputId, OutputId, EdgeId),
set_attribute(EdgeId, sign = Sign)
% graph structure only has one edge per pair source -> dest, so we
% handle incompatible arcs with a third kind of sign
(
get_attribute(EdgeId, sign = OldSign)
->
(
OldSign == Sign
->
true
;
set_attribute(EdgeId, sign = '±')
)
;
set_attribute(EdgeId, sign = Sign)
)
)
).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment