Skip to content

Commit

Permalink
Incorporate Raustad suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonGlazer committed Aug 20, 2019
1 parent 1097a54 commit 73bad95
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
1 change: 1 addition & 0 deletions src/EnergyPlus/EconomicLifeCycleCost.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1508,6 +1508,7 @@ namespace EconomicLifeCycleCost {
for (nUsePriceEsc = 1; nUsePriceEsc <= numUsePriceEscalation; ++nUsePriceEsc) {
if (UsePriceEscalation(nUsePriceEsc).resource - ResourceTypeInitialOffset == curResource) {
found = nUsePriceEsc;
break;
}
}
if (found > 0) {
Expand Down
42 changes: 21 additions & 21 deletions tst/EnergyPlus/unit/EconomicLifeCycleCost.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,10 @@ TEST_F(EnergyPlusFixture, EconomicLifeCycleCost_ComputeEscalatedEnergyCosts)
CashFlow(1).Resource = 1001;
CashFlow(1).yrAmount.allocate(lengthStudyYears);
CashFlow(1).yrAmount(1) = 100;
CashFlow(1).yrAmount(2) = 100;
CashFlow(1).yrAmount(3) = 100;
CashFlow(1).yrAmount(4) = 100;
CashFlow(1).yrAmount(5) = 100;
CashFlow(1).yrAmount(2) = 110;
CashFlow(1).yrAmount(3) = 120;
CashFlow(1).yrAmount(4) = 130;
CashFlow(1).yrAmount(5) = 140;

numResourcesUsed = 1;

Expand All @@ -445,16 +445,16 @@ TEST_F(EnergyPlusFixture, EconomicLifeCycleCost_ComputeEscalatedEnergyCosts)

ComputeEscalatedEnergyCosts();
EXPECT_NEAR(EscalatedEnergy(1, 1), 100., 0.001);
EXPECT_NEAR(EscalatedEnergy(2, 1), 100., 0.001);
EXPECT_NEAR(EscalatedEnergy(3, 1), 100., 0.001);
EXPECT_NEAR(EscalatedEnergy(4, 1), 100., 0.001);
EXPECT_NEAR(EscalatedEnergy(5, 1), 100., 0.001);
EXPECT_NEAR(EscalatedEnergy(2, 1), 110., 0.001);
EXPECT_NEAR(EscalatedEnergy(3, 1), 120., 0.001);
EXPECT_NEAR(EscalatedEnergy(4, 1), 130., 0.001);
EXPECT_NEAR(EscalatedEnergy(5, 1), 140., 0.001);

EXPECT_NEAR(EscalatedTotEnergy(1), 100., 0.001);
EXPECT_NEAR(EscalatedTotEnergy(2), 100., 0.001);
EXPECT_NEAR(EscalatedTotEnergy(3), 100., 0.001);
EXPECT_NEAR(EscalatedTotEnergy(4), 100., 0.001);
EXPECT_NEAR(EscalatedTotEnergy(5), 100., 0.001);
EXPECT_NEAR(EscalatedTotEnergy(2), 110., 0.001);
EXPECT_NEAR(EscalatedTotEnergy(3), 120., 0.001);
EXPECT_NEAR(EscalatedTotEnergy(4), 130., 0.001);
EXPECT_NEAR(EscalatedTotEnergy(5), 140., 0.001);

numUsePriceEscalation = 1;
UsePriceEscalation.allocate(numUsePriceEscalation);
Expand All @@ -470,17 +470,17 @@ TEST_F(EnergyPlusFixture, EconomicLifeCycleCost_ComputeEscalatedEnergyCosts)
EscalatedTotEnergy = 0.0;

ComputeEscalatedEnergyCosts();
EXPECT_NEAR(EscalatedEnergy(1, 1), 103., 0.001);
EXPECT_NEAR(EscalatedEnergy(2, 1), 105., 0.001);
EXPECT_NEAR(EscalatedEnergy(3, 1), 107., 0.001);
EXPECT_NEAR(EscalatedEnergy(4, 1), 111., 0.001);
EXPECT_NEAR(EscalatedEnergy(5, 1), 115., 0.001);
EXPECT_NEAR(EscalatedEnergy(1, 1), 103.0, 0.001);
EXPECT_NEAR(EscalatedEnergy(2, 1), 115.5, 0.001);
EXPECT_NEAR(EscalatedEnergy(3, 1), 128.4, 0.001);
EXPECT_NEAR(EscalatedEnergy(4, 1), 144.3, 0.001);
EXPECT_NEAR(EscalatedEnergy(5, 1), 161.0, 0.001);

EXPECT_NEAR(EscalatedTotEnergy(1), 103., 0.001);
EXPECT_NEAR(EscalatedTotEnergy(2), 105., 0.001);
EXPECT_NEAR(EscalatedTotEnergy(3), 107., 0.001);
EXPECT_NEAR(EscalatedTotEnergy(4), 111., 0.001);
EXPECT_NEAR(EscalatedTotEnergy(5), 115., 0.001);
EXPECT_NEAR(EscalatedTotEnergy(2), 115.5, 0.001);
EXPECT_NEAR(EscalatedTotEnergy(3), 128.4, 0.001);
EXPECT_NEAR(EscalatedTotEnergy(4), 144.3, 0.001);
EXPECT_NEAR(EscalatedTotEnergy(5), 161.0, 0.001);

}

Expand Down

7 comments on commit 73bad95

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-MacOS-10.13-clang: OK (2457 of 2469 tests passed, 20 test warnings)

Messages:\n

  • 12 tests had: ERR diffs.
  • 20 tests had: EIO diffs.
  • 11 tests had: Table big diffs.
  • 2 tests had: ESO big diffs.
  • 1 test had: ESO small diffs.
  • 1 test had: Table small diffs.

Failures:\n

regression Test Summary

  • Passed: 652
  • Failed: 12

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-Linux-Ubuntu-18.04-gcc-7.4: OK (2497 of 2509 tests passed, 20 test warnings)

Messages:\n

  • 20 tests had: EIO diffs.
  • 11 tests had: Table big diffs.
  • 12 tests had: ERR diffs.
  • 2 tests had: ESO big diffs.
  • 1 test had: ESO small diffs.
  • 1 test had: Table small diffs.

Failures:\n

regression Test Summary

  • Passed: 672
  • Failed: 12

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-Linux-Ubuntu-18.04-cppcheck: OK (0 of 0 tests passed, 0 test warnings)

Build Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-Linux-Ubuntu-18.04-custom_check: OK (9 of 9 tests passed, 0 test warnings)

Build Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-UnitTestsCoverage-Debug: OK (1139 of 1139 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-IntegrationCoverage-Debug: OK (669 of 669 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FixLCC_Escalataion_6144 (JasonGlazer) - Win64-Windows-10-VisualStudio-16: OK (2457 of 2469 tests passed, 20 test warnings)

Messages:\n

  • 12 tests had: ERR diffs.
  • 20 tests had: EIO diffs.
  • 11 tests had: Table big diffs.
  • 2 tests had: ESO big diffs.
  • 1 test had: ESO small diffs.
  • 1 test had: Table small diffs.

Failures:\n

regression Test Summary

  • Passed: 652
  • Failed: 12

Build Badge Test Badge

Please sign in to comment.