mirror of
https://github.com/velocitatem/PHANTOM.git
synced 2026-05-31 08:33:36 +00:00
chor> competitive wrapping
This commit is contained in:
@@ -60,7 +60,25 @@ class MarketEngine:
|
||||
]
|
||||
# store trajectories for agent probability calculation
|
||||
self.last_trajectories = human_t + agent_t
|
||||
return estimate_demand(self.last_trajectories, self.action_weights)
|
||||
|
||||
demand_proxy = estimate_demand(
|
||||
self.last_trajectories,
|
||||
self.action_weights,
|
||||
normalize=True,
|
||||
per_session=False,
|
||||
)
|
||||
raw_mix = ((1.0 - float(self.alpha)) * demand_h) + (
|
||||
float(self.alpha) * demand_a
|
||||
)
|
||||
total_raw_demand = float(np.sum(raw_mix))
|
||||
if not demand_proxy:
|
||||
return {i: float(raw_mix[i]) for i in range(len(prices))}
|
||||
if total_raw_demand <= 0.0:
|
||||
return {i: 0.0 for i in range(len(prices))}
|
||||
return {
|
||||
i: total_raw_demand * float(demand_proxy.get(i, 0.0)) / 100.0
|
||||
for i in range(len(prices))
|
||||
}
|
||||
|
||||
def measure(self):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user