I'm trying to write down the properties and procedures in the Tariff
market from the participant's standpoint. So far, I have written
sections on representation and lifecycle. I'm going to need Prashant's
help in describing Customer behaviors in the Tariff market.
Please look through this and see whether there are any surprises or
One thing that's clear is that we will have to represent Subscriptions
separately from Tariffs in the server.
Rather than use the discussion page at www.powertac.org/wiki, I'll use Nabble because I'm more confident folks will see it.
We need to think a bit about how to handle subscriptions to tariffs that have minimum durations (see the Tariff and Subscription lifecycle section for the background). I'm concerned about a proliferation of subscriptions, which will complicate life for the Accounting Service, and for Customer models.
Here's a proposal:
- A single Subscription can have multiple Expiration records, each of which has a population value (number of households) and a contract-end date, just in case the Tariff has a minimum duration.
- When a Customer model first assigns a portion of its population to a Tariff, a Subscription is created assigning the appropriate portion of the population to the tariff. If the tariff has a minimum duration, then also an Expiration record is created.
- When a Customer model assigns additional population to a Tariff, they are added to the Subscription, and if necessary a new Expiration record is created. There are three cases: (a) the Tariff does not have a minimum duration (or it's zero), in which case no Expiration record is needed; (b) there is already an Expiration record for this subscription with the correct end date, because it was created today; or (c) all the existing Expiration records were created before today, in which case a new record must be created.
- When a Customer model decides that some existing subscribers to a Tariff wish to switch to a different Tariff, we'll assume they are ones whose minimum duration has already passed; in fact, we remove population from the subscription, and from Expiration records in order of expiration date.
- If we run out of Expiration records with expiration dates in the past, then we remove population from the oldest remaining Expiration records, and pay the necessary early-withdrawal fees.
The result of this is that the Customer's evaluation of the goodness of a Tariff will depend on the number of households that can withdraw from existing Tariffs without penalty. It might be helpful to keep a count of the number of "free agent" customers in the Subscription record, and update it appropriately, when customers switch, and when expiration dates pass.