Skip to content

Commit

Permalink
fix constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
yilinxia committed Apr 12, 2024
1 parent c5d4d8e commit 32ba496
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def generate_dot_string(
style = 'dashed'
label = ''
else:

grounded_edge_color = get_color('yellow', color_blind_mode)
if from_argument_extension_state == 'accepted' and \
to_argument_extension_state == 'defeated':
Expand All @@ -122,6 +123,7 @@ def generate_dot_string(
to_argument_extension_state == 'undefined':
full_color = get_color('dark-yellow', color_blind_mode)
else:
# constraint = True
extension_edge_color = get_color('black', color_blind_mode)
full_color = \
f'{extension_edge_color}'
Expand All @@ -142,7 +144,15 @@ def generate_dot_string(
edge = f'"{attack.from_argument.name}" -> ' \
f'"{attack.to_argument.name}"\n'
dot_string += " "+edge



number_by_argument = {k: v for k, v in number_by_argument.items() if v != '∞'}
min_state_nodes = [node for node, value in number_by_argument.items() if value == min(number_by_argument.values())]
max_state_nodes = [node for node, value in number_by_argument.items() if value == max(number_by_argument.values())]

min_rank_string = f"{{rank = min {' '.join(min_state_nodes)}}}"
max_rank_string = f"{{rank = max {' '.join(max_state_nodes)}}}"
dot_string += f" {min_rank_string}\n {max_rank_string}\n"
dot_string += "}"
return dot_string

Expand Down

0 comments on commit 32ba496

Please sign in to comment.