Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 308cb6f6 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

[lib] DimacsFrontierSol: Fix security cast for hash() (the concerned attr has changed)

parent d8697793
No related branches found
No related tags found
No related merge requests found
......@@ -670,9 +670,7 @@ class DimacsFrontierSol(object):
"""
# Frontier places
# /!\ Most of the time spent in the constructor is due to this line
# Already a frozenset but this attribute must be immutable for __hash__,
# cast is a security.
self.frontier_values = frozenset(raw_sol.frontier_pos_and_neg_values)
self.frontier_values = raw_sol.frontier_pos_and_neg_values
# Activated input/events (clocks)
# Callable of raw_sol method (avoid to store raw_sol in this object)
......@@ -687,7 +685,11 @@ class DimacsFrontierSol(object):
# - by FrontierSolution.from_dimacs_front_sol()
# - to accelerate the call of self.nb_activated_frontiers
# - as a criterion of uniqueness, to do set operations
self.activated_frontier_values = raw_sol.extract_activated_frontier_values()
# Already a frozenset but this attribute must be immutable for __hash__,
# cast is a security.
self.activated_frontier_values = frozenset(
raw_sol.extract_activated_frontier_values()
)
# Pre-compute nb of activated frontiers in the current solution
# PS: use numpy to accelerate this ? The cast is costly...
......
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