Energy quantity representation by the TariffMarket and AccountingService

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Energy quantity representation by the TariffMarket and AccountingService

While working on the DistributionUtilityService today I noticed a discrepancy in how energy is represented in the TariffMarket.  In TariffTransactions energy consumed/produced is stored in kWh whereas in MarketTransactions energy is stored in MWh.  This can be an issue when doing calculations that require the use of both of these objects.  

For example, to compute the overall net balance of the market the DU calls two functions: AccountingService.getCurrentMarketPosition(broker) that references a broker's MarketPosition which, in turn, references MarketTransactions (MWh) and AccountingService.getCurrentNetLoad(broker) which references all pending TariffTransactions (kWh).

I posed this question to John tonight and felt it would be worth bringing to everyone else's attention as well:

On Apr 3 2011, John Collins wrote:
>This issue needs to be clearly covered in the game specification.

>The reason for the difference is that energy markets trade in megawatt-hours, while retail energy is
>sold in kilowatt-hours. This appears to be the case in every market we know about. So we think it
>makes sense to represent trades and market positions in mWh, and customer sales (tariff energy
>usage) in kWh. That means it is exactly the DU that must do the conversion. The DU should say that
>clearly in its documentation. Of course, brokers will also need to worry about this, because they need
>to convert their energy usage statistics in kWh to predictions in mWh in order to buy/sell the correct
>amounts of power. It would be pretty bad if they were off by 3 orders of magnitude.