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

NPE in household-customer #649

Closed
govertbuijs opened this issue Dec 3, 2012 · 5 comments
Closed

NPE in household-customer #649

govertbuijs opened this issue Dec 3, 2012 · 5 comments
Assignees
Milestone

Comments

@govertbuijs
Copy link
Member

java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
at java.util.Vector.get(Vector.java:694)
at org.powertac.householdcustomer.customers.Village.logitPossibilityEstimation(Village.java:2352)
at org.powertac.householdcustomer.customers.Village.possibilityEvaluationNewTariffs(Village.java:2142)
at org.powertac.householdcustomer.HouseholdCustomerService.publishNewTariffs(HouseholdCustomerService.java:392)
at org.powertac.tariffmarket.TariffMarketService.publishTariffs(TariffMarketService.java:592)
at org.powertac.tariffmarket.TariffMarketService.activate(TariffMarketService.java:568)
at org.powertac.server.CompetitionControlService.step(CompetitionControlService.java:725)
at org.powertac.server.CompetitionControlService.access$600(CompetitionControlService.java:83)
at org.powertac.server.CompetitionControlService$SimRunner.run(CompetitionControlService.java:1027)

@chrysopoulos18
Copy link
Contributor

I will look into it.

@ghost ghost assigned chrysopoulos18 Dec 11, 2012
@chrysopoulos18
Copy link
Contributor

This is fixed.

@jecollins
Copy link
Member

Either it's not fixed, or there is another array out of bounds problem. But now it appears to be (more) repeatable. Here's the backtrace from the test report:

java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
        at java.util.Vector.get(Vector.java:694)
        at org.powertac.householdcustomer.customers.Village.logitPossibilityEstimation(Village.java:2354)
        at org.powertac.householdcustomer.customers.Village.possibilityEvaluationNewTariffs(Village.java:2143)
        at org.powertac.householdcustomer.HouseholdCustomerService.publishNewTariffs(HouseholdCustomerService.java:392)

and here's the debug log from the test at the point of failure:

51152 DEBUG customers.Village: Variable Dominant Cost Summary: -4.28715E7
51152 DEBUG customers.Village: Variable Cost Summary: -1.26331E8
51152 DEBUG customers.Village: Minimum Duration: 7.0
51152 DEBUG customers.Village: Cost Variable: 4.2110333333333336E7 Cost Fixed: 142.857142857142
86
51152 DEBUG customers.Village: Estimation for 0: 117.90879047619048
51152 DEBUG customers.Village: Cost variable: 5895.439523809524
51152 DEBUG customers.Village: Summary of Estimation: Infinity
51152 DEBUG customers.Village: Estimation for 1: -0.08422066666666667
51152 DEBUG customers.Village: Cost variable: -4.211033333333333
51152 DEBUG customers.Village: Summary of Estimation: Infinity
51152 DEBUG customers.Village: Estimation for 2: -42.11047619047619
51152 DEBUG customers.Village: Cost variable: -2105.5238095238096
51152 DEBUG customers.Village: Summary of Estimation: Infinity
51152 DEBUG customers.Village: Randomizer Vector: []
51152 DEBUG customers.Village: Possibility Vector: [0, 0, 0]

@chrysopoulos18
Copy link
Contributor

As I said in my mail, the TariffHelper is returning positive values when the tariff is variable. When it is fixed, it returns negative numbers.

When I change the positive returns of variable tariffs then everything works correctly.

@jecollins
Copy link
Member

It seems to have been a problem in the test case, not in the customer model itself. Looks like this is solved.

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

No branches or pull requests

3 participants