Switch Subscription - Pyosch/powertac-server GitHub Wiki
up
A customer model wishes to switch some portion of its population from tariff A to tariff B.
- Customer wakes up periodically (nominally every six hours) and evaluates the available tariff offerings, comparing them with its current subscriptions. The current offerings are retrieved from the database; no other interaction is required to trigger this activity. Because there could be many tariff offerings that do not apply (production tariffs for a customer that is only a consumer, for example), the customer should run its own query to find applicable tariffs.
- We assume that customer keeps its own list of its subscriptions.
Remark CF: I think dropping this assumption and providing customers this via the accounting service makes life easier for customer model developers
Remark JEC: This is clearly out-of-scope for Accounting, because tariff terms (time-of-use or dynamic prices) can affect energy consumption and production. So customers need their own lists of subscriptions in order to run their models. The ideal location for this behavior is an abstract customer. - Customer compares available, applicable tariffs to its own set of subscriptions, and may decide to switch some portion of its population from one subscription to another. It does this by calling unsubscribe() on the existing subscription, and calling subscribe() on the other tariff.
- The tariff (not the customer) receiving the new subscription is responsible for preparing a TariffDoSubscribeCmd to reflect the new subscriptions, and a the tariff losing subscriptions is responsible for preparing a matching TariffDoUnsubscribeCmd to reflect the dropped subscriptions. These will presumably be routed to the respective brokers.