Skip to content

Commit

Permalink
consider both adversary profile and operation chain when creating lis…
Browse files Browse the repository at this point in the history
…t of all possible agent abilities
  • Loading branch information
bleepbop committed Sep 25, 2023
1 parent d2d5566 commit 78c3dc7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/objects/c_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,13 @@ async def _unfinished_links_for_agent(self, paw):
return [link for link in self.chain if link.paw == paw and not link.finish and not link.can_ignore()]

async def _get_all_possible_abilities_by_agent(self, data_svc):
abilities_by_agent = {a.paw: {'all_abilities': []} for a in self.agents}
abilities = {'all_abilities': [ab for ab_id in self.adversary.atomic_ordering
for ab in await data_svc.locate('abilities', match=dict(ability_id=ab_id))]}
abilities_by_agent = {a.paw: abilities for a in self.agents}
for link in self.chain:
matching_abilities = await data_svc.locate('abilities', match=dict(ability_id=link.ability.ability_id))
abilities_by_agent[link.paw]['all_abilities'].extend(matching_abilities)
if link.ability.ability_id not in self.adversary.atomic_ordering:
matching_abilities = await data_svc.locate('abilities', match=dict(ability_id=link.ability.ability_id))
abilities_by_agent[link.paw]['all_abilities'].extend(matching_abilities)
return abilities_by_agent

def _check_reason_skipped(self, agent, ability, op_facts, state, agent_executors, agent_ran):
Expand Down

0 comments on commit 78c3dc7

Please sign in to comment.