🍋 Lemonade Stand 🍋

Challenge Information

Everything you need to know about playing the Lemonade Stand Game

Game Overview

The Lemonade Stand Game is a simulation where players compete to run the most successful lemonade stand. Each day, players make decisions about:

  • How many lemons to buy
  • How much lemonade to prepare
  • What price to charge per cup
  • How much to spend on advertising

Players can compete against each other or against AI opponents. The game runs for a specified number of days, and the player with the most cash at the end wins.

AI Function Requirements

Function Signature
def your_ai_name(player_state, game_state, prices, previous_info):
    # Your logic here...
    return {
        'lemons_bought': 0,      # Integer: Number of lemons to buy
        'lemonade_prepared': 0,  # Integer: Number of cups to prepare
        'price_per_cup': 1.00,   # Float: Price to charge per cup
        'advertising_spend': 0   # Integer: Amount to spend on advertising
    }
Input Parameters
Parameter Type Description
player_state dict
  • cash (Decimal): Current cash balance
  • lemons (int): Current lemon inventory
game_state dict
  • current_round (int): Current round number
  • total_rounds (int): Total number of rounds in the game
  • weather (str): Current weather type (e.g., 'Sunny', 'Cloudy', 'Heatwave')
prices dict
  • lemon (Decimal): Current price per lemon
previous_info dict or None
  • None on round 1
  • Contains previous round's information including:
    • round_number: Previous round number
    • total_potential_customers: Total customers available last round
    • your_sales: Cups you sold last round
    • your_decision: Your previous decisions
    • all_players_decisions: All players' previous decisions

Game Parameters

Basic Settings
  • Game Length: 5-365 days
  • Starting Cash: $10-$500
  • Base Lemon Price: $0.01-$10.00 (fluctuates daily with ±20% random variation)
  • Base Customers Per Player: 5-50 per day (randomly selected each day with ±25% variation)
Customer Behaviour
  • Price Sensitivity (0.0-1.0):
    • Higher values make customers more likely to choose lower prices.
    • Lower values make customers less price-conscious.
    • Applied as a multiplier to price comparisons between stands.
  • Sign Sensitivity (0.0-1.0):
    • Higher values make advertising more effective.
    • Lower values reduce the impact of advertising.
    • Applied as a multiplier to advertising effects.
How Customers Choose a Stand
  • Each stand is assigned an attractiveness score based on:
    • Price: Lower prices increase attractiveness (weighted by price sensitivity).
    • Advertising: More advertising increases attractiveness (weighted by sign sensitivity, relative to total advertising spend).
  • For each customer, a stand is chosen at random, with the probability proportional to each stand's attractiveness score.
  • If a stand runs out of stock, it is removed from the pool for the rest of the day.
  • There are no individual customer types or budgets; all customers use the same market-wide sensitivities.
  • Note: This is a weighted random choice, not a Boltzmann/softmax function.
Weather Effects
  • Each weather type has:
    • Customer Modifier: Multiplies base customer count (0.1-3.0).
    • Likelihood: Relative chance of occurring (1-10).
  • Weather is randomly selected each day based on likelihoods.
  • Customer count is multiplied by the weather's modifier.
Events
  • Events can occur randomly each day based on their chance (0-50%).
  • Each event has:
    • Chance: Daily probability of occurring.
    • Duration: How long the event lasts (1-10 days).
    • Effects: Can modify prices, customer behaviour, etc.
  • Only one event can be active at a time.
  • Events affecting ingredients modify prices by their multiplier (0.1-10.0).
Daily Simulation Process
  1. Weather is randomly selected based on likelihoods.
  2. Base customer count is calculated and modified by weather.
  3. Event chance is checked and applied if triggered.
  4. Each customer:
    • Evaluates all stands based on price and advertising (using market-wide sensitivities).
    • Chooses a stand at random, weighted by each stand's attractiveness score.
    • If their chosen stand is out of stock, they do not buy.
  5. Results are calculated and stored for the next day.