Changing the list of active brackets to a dictionary with the bracket_id as keys would make the code on some occasions more readable. For example this:
# pass information of job submission to Bracket Manager
for bracket in self.active_brackets:
if bracket.bracket_id == job_info['bracket_id']:
# registering is IMPORTANT for Bracket Manager to perform SH
bracket.register_job(job_info['budget'])
break
Changing the list of active brackets to a dictionary with the
bracket_id
as keys would make the code on some occasions more readable. For example this:Could then be rewritten as:
This would also have runtime advantages, however these are rather small, given that our
active_brackets
list is mostly small.To clean up the dictionary we can then simlpy iterate over the key-value pairs and delete the brackets, that are already done.