Skip to content

Commit

Permalink
fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
James Fox committed Oct 9, 2022
1 parent b866f45 commit e01d2e6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pycid/core/macid.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from pgmpy.factors.discrete import TabularCPD

from pycid.core.cpd import DecisionDomain, StochasticFunctionCPD
from pycid.core.macid_base import MACIDBase
from pycid.core.macid_base import AgentLabel, MACIDBase
from pycid.core.relevance_graph import CondensedRelevanceGraph
from pycid.export.gambit import behavior_to_cpd, macid_to_efg, pygambit_ne_solver

Expand Down Expand Up @@ -47,7 +47,7 @@ def get_ne(self, solver: Optional[str] = None) -> List[List[StochasticFunctionCP
"""
return self.get_ne_in_sg(solver=solver)

def create_subgame(self, active_subgame_decs) -> MACID:
def create_subgame(self, active_subgame_decs: Iterable[str]) -> MACID:
"""
Return a full subgame from the full macid with the active_subgame_decs active as decisions in this subgame.
"""
Expand All @@ -60,15 +60,15 @@ def create_subgame(self, active_subgame_decs) -> MACID:
edges_sg = [pair for pair in self.edges if pair[1] in r_nodes_plus_decs]
# sg_nodes = set([node for pair in edges_sg for node in pair])
# finds the decision_agents mapping in this subgame
sg_agents_decs = {}
sg_agents_decs: Dict[AgentLabel, List[str]] = {}
for node in active_subgame_decs:
agent = self.decision_agent[node]
if agent in sg_agents_decs:
sg_agents_decs[agent].append(node)
else:
sg_agents_decs[agent] = [node]
# finds the utilities_agents mapping in this subgame
sg_agents_utils = {}
sg_agents_utils: Dict[AgentLabel, List[str]] = {}
for node in set(r_nodes).intersection(set(self.utilities)):
agent = self.utility_agent[node]
if agent in sg_agents_utils:
Expand Down

0 comments on commit e01d2e6

Please sign in to comment.