powertac / powertac-server

Power TAC simulation server
www.powertac.org
Apache License 2.0
45 stars 35 forks source link

Tariff eval fails with TOU tariff having identical hourly rates #1146

Open jecollins opened 1 year ago

jecollins commented 1 year ago

In the 2022 qualifying round, we have seen ERROR messages in some of the server trace logs. This appears to be caused by a broker issuing a TOU tariff with identical rates for each hour. The broker issuing such a tarriff in at least a few of these games was Mertacor (see games 4 and 5, for example).

Analysis of the game logs indicates that the only impact of this error is that evaluation of the offending tariff by ColdStorage instances fails, but this does not appear to affect other tariffs or other brokers. I have not yet found a case of this with customer models other than ColdStorage, but it's possible. It's caused by computing the price range for the tariff, and then dividing by that value. This causes a divide-by-zero error, of course.

jecollins commented 1 year ago

The problem in this case is in ColdStorage.heuristicTouProfile().