its not braking anymore

This commit is contained in:
2023-01-14 21:26:04 +01:00
parent 166c96e66d
commit fcd25276bb
4 changed files with 54 additions and 25 deletions
+10 -9
View File
@@ -107,8 +107,8 @@ class ExternalMarket(BaseComponent):
# NO-OP!
if action == 0:
pass
action-=1
continue
res_name=self.action_res_map[action]
# Build! (If you can.)
@@ -163,10 +163,11 @@ class ExternalMarket(BaseComponent):
# Mobile agents' build action is masked if they cannot build with their
# current location and/or endowment
for agent in self.world.agents:
mask=[]
for res in self.market_demand:
mask.append(self.agent_can_sell(agent,res))
masks[agent.idx] = mask
if agent.name in self.agent_subclasses:
mask=[]
for res in self.market_demand:
mask.append(self.agent_can_sell(agent,res))
masks[agent.idx] = mask
return masks
@@ -182,7 +183,7 @@ class ExternalMarket(BaseComponent):
where metric_value is a scalar.
"""
world = self.world
"""
build_stats = {a.idx: {"n_builds": 0} for a in world.agents}
for builds in self.builds:
for build in builds:
@@ -196,8 +197,8 @@ class ExternalMarket(BaseComponent):
num_houses = np.sum(world.maps.get("House") > 0)
out_dict["total_builds"] = num_houses
return out_dict
"""
return {}
def additional_reset_steps(self):
"""