mirror of
https://github.com/velocitatem/PHANTOM.git
synced 2026-05-31 08:33:36 +00:00
chore: bug fixes
This commit is contained in:
@@ -21,7 +21,7 @@ class MarketEngine():
|
|||||||
def act(self, prices):
|
def act(self, prices):
|
||||||
demand = generate_demand(prices, *self.demand)
|
demand = generate_demand(prices, *self.demand)
|
||||||
sample_n = lambda n, human: [sample_behavior(demand, human=human) for _ in range(n)]
|
sample_n = lambda n, human: [sample_behavior(demand, human=human) for _ in range(n)]
|
||||||
human_t, agent_t = sample_n(100, True), sample_n(100, False)
|
human_t, agent_t = sample_n(self.Nhumans, True), sample_n(self.Nagents, False)
|
||||||
trajectories = human_t + agent_t
|
trajectories = human_t + agent_t
|
||||||
demand_estimate = estimate_demand(trajectories)
|
demand_estimate = estimate_demand(trajectories)
|
||||||
return demand_estimate
|
return demand_estimate
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ def run_single(cfg: dict) -> dict:
|
|||||||
"id": cfg["id"],
|
"id": cfg["id"],
|
||||||
"config": cfg,
|
"config": cfg,
|
||||||
"total_reward": total_reward,
|
"total_reward": total_reward,
|
||||||
"avg_reward": total_reward / steps,
|
"avg_reward": total_reward / steps if steps > 0 else 0.0,
|
||||||
"steps": steps,
|
"steps": steps,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user