hpi-epic/pricing_competition_simulation

Handling of price_if_smaller_else()

Closed this issue · 0 comments

def price_if_smaller_else(price, price_smaller, else_min, prices_comp, c):
    return(price if min(prices_comp[comp] for comp in range(numberPlayers) if comp!=c)< price_smaller else round(min([max(else_min, prices_comp[company]-0.5) for company in range(numberPlayers) if company != c]),2))

First, this is a function that's part of the shared dictionaries S1-S3. So we'll might want to create a very simple module to include in each notebook, that contains such shared methods.

But more importantly: Tom, please rewrite for better readability. It's a mess. :)