Customer start of timeslot - Pyosch/powertac-server GitHub Wiki

up
The primary task of each customer model is to run its simulation model once per timeslot, generating power consumption and production quantities. We assume this process is initiated by the CompetitionController, most likely using a thread pool to enable parallel execution of multiple Customer models. If we wait for the Customer to be queried, that necessarily serializes Customer activities, or else requires more complex synchronization.

Gather inputs

  1. Prior to the beginning of a timeslot, each Broker will have updated any variable rates in each of its Tariffs that is currently offered or subscribed.
  2. During the previous timeslot, any balancing actions taken by the DistributionUtility (reducing interruptible loads, for example) will have been recorded.

Therefore, before running its model, each Customer model must retrieve

  1. From each of its TariffSubscriptions,
    1. Price data from its variable-rate Tariffs.
    2. Results of balancing actions taken during the previous timeslot (for example, if a heater load was interrupted during the previous hour, demand during the current hour might increase to make up the lost heat).
  2. Weather data from the Weather Service (current weather is updated every hour, while a 48-hour forecast is updated every 24 hours).

Use or produce power

With this data in hand, a Customer model will run its model (the results might vary by TariffSubscription because of different prices and balancing actions) and call the usePower() method on each of its TariffSubscription instances. The result will be a set of TariffTransaction instances (one from each TariffSubscription) for the current timeslot. The Accounting Service will later retrieve these TariffTransaction instances from the database.

⚠️ **GitHub.com Fallback** ⚠️