Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DowntownOffices model fails to subdivide consumption #1008

Closed
jecollins opened this issue Feb 19, 2019 · 4 comments
Closed

DowntownOffices model fails to subdivide consumption #1008

jecollins opened this issue Feb 19, 2019 · 4 comments

Comments

@jecollins
Copy link
Member

When a multi-unit customer model subscribes to multiple tariffs, the subscriptions keep track of the population subscribed to a given tariff. The consumption and production numbers are supposed to be subdivided in some reasonably realistic way between the subscribed tariffs. In game 298 of the 2018 finals, DowntownOffices appears to get this wrong. Here's the relevant part of the log, filtered to include only TariffTransactions involving DowntownOffices, customer ID 3357:

1091251:org.powertac.common.TariffTransaction::466208::new::4725::565::CONSUME::300768030::3357::30::-9495.76::1655.8084249240574::false
1091251:org.powertac.common.TariffTransaction::466209::new::4725::565::PERIODIC::300768030::3357::30::0.0::1.1875::false
1091529:org.powertac.common.TariffTransaction::467053::new::4725::565::WITHDRAW::300768030::3357::1::0.0::-0.0::false
1091529:org.powertac.common.TariffSubscription::467054::new::3357::300769504
1091529:org.powertac.common.TariffTransaction::467056::new::4725::565::SIGNUP::300769504::3357::1::0.0::-0.0::false
1096375:org.powertac.common.TariffTransaction::468606::new::4725::566::CONSUME::300768030::3357::29::-9151.87::1595.8431394443137::false
1096375:org.powertac.common.TariffTransaction::468607::new::4725::566::PERIODIC::300768030::3357::29::0.0::1.1479166666666665::false
1096375:org.powertac.common.TariffTransaction::468610::new::4725::566::CONSUME::300769504::3357::1::-9151.87::2745.561::false
1096375:org.powertac.common.TariffTransaction::468611::new::4725::566::PERIODIC::300769504::3357::1::0.0::0.03958333333333333::false
1101272:org.powertac.common.TariffTransaction::470828::new::4725::567::CONSUME::300768030::3357::29::-8448.51::1473.195830144733::false
1101272:org.powertac.common.TariffTransaction::470829::new::4725::567::PERIODIC::300768030::3357::29::0.0::1.1479166666666665::false
1101272:org.powertac.common.TariffTransaction::470832::new::4725::567::CONSUME::300769504::3357::1::-8448.51::2534.553::false
1101272:org.powertac.common.TariffTransaction::470833::new::4725::567::PERIODIC::300769504::3357::1::0.0::0.03958333333333333::false

Note that the kWh quantities are identical in the transactions for tariff 300768030 and 300769504. One represents a population of 1, while the other represents a population of 29.

This appears to be the cause of extreme capacity assessments in several games in the 2018 competition.

@jecollins
Copy link
Member Author

It seems the code that is supposed to adjust capacity for population was commented out for this model. In DefaultCapacityOriginator.useCapacity(), we see this:

    // moved up one level
    //adjustedCapacity =
    //    adjustCapacityForSubscription(timeslot, adjustedCapacity, subscription);

But this statement appears in 'AdaptiveCapacityOriginator.useCapacity()', not commented out.

This change was made as part of #863, apparently by me. Reasoning is not (yet) clear.

@jecollins
Copy link
Member Author

Two models, WindmillCoOp and HextraChemical, are configured with bundles having count=1 and population>1, and INDIVIDUAL capacityStructures. The model setup for these cases should have created a CapacityOriginator for each member of the population, and was only creating one. A careful look at the WindmillCoOp test case should have shown the disconnect between the expected energy production for a population of 3 in the test case, and the distribution for per-instance production in the config.

Apparently, the hack needed to make these cases work at all broke some of the POPULATION models, specifically those, like DowntownOffices, that don't use the AdaptiveCapacityOriginator. A proposed fix is committed on branch i1008.

@jecollins
Copy link
Member Author

Examination of factored-customer config files shows that DowntownOffices is the only population model that would have been affected by this bug, and that is what we see in the 2018 tournament results.

@jecollins
Copy link
Member Author

Updated configuration to handle the case of population > count for INDIVIDUAL models, restored correct distribution of capacity among subscriptions for non-INDIVIDUAL models, added new test case that failed with the original code, ran full system tests. Updates merged into master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant