{% load otree %}

  You are a supplier who provides products to two retailers, retailer A and retailer B. Each retailer makes an order decision after observing his own demand realization, receives products from you, and sells them in a separate independent market.

  The products ordered by retailers are the main products for them. Therefore, if they receive too little products than the quantities they order, they will lose opportunities to sell their main products and encounter financial losses.

  There are 30 selling periods in total. In each period, you have a fixed capacity of 100 units of product, i.e. the maximum number of products that you can allocate to the retailers is 100 units. Note that your supply capacity is fixed due to unavoidable restrictions and it is not possible to expand the capacity even when the sum of orders is higher than the capacity. In each period, you first receive orders from the retailers and provide products to them at a wholesale price of 1 token per unit. Your profit is then calculated as


profit (tokens) = wholesale price × the total number of products allocated to retailers


Your task is to make decisions about how to allocate limited capacity among the two retailers in response to their order quantities.

Your allocation decision needs to satisfy the following rules:

1. The sum of allocations to the retailers should be equal or less than your capacity (100 products). Even when the sum of retailer’s orders exceeds 100 products, you can allocate only up to your limited capacity 100 products.

2. A retailer will not receive products more than the quantity he orders. For example, if a retailer orders 50 products, you cannot allocate more than 50 products to this retailer. Also, he cannot return any products that he has ordered. For example, if a retailer orders 50 products, he has to accept all 50 products that are allocated to him.