Skip to content

Commit

Permalink
Correct size versus iprofile index for manual dispatch fuel cell and …
Browse files Browse the repository at this point in the history
…grid discharge arrays
  • Loading branch information
brtietz committed Dec 12, 2023
1 parent 75b4b17 commit d7cdb55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shared/lib_battery_dispatch_manual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ void dispatch_manual_t::prepareDispatch(size_t hour_of_year, size_t )
m_batteryPower->canGridCharge = _gridcharge_array[iprofile - 1];
m_batteryPower->canClipCharge = _can_clip_charge;

if (iprofile < _fuelcellcharge_array.size()) {
if (iprofile <= _fuelcellcharge_array.size()) {
m_batteryPower->canFuelCellCharge = _fuelcellcharge_array[iprofile - 1];
}

if (iprofile < _discharge_grid_array.size()) {
if (iprofile <= _discharge_grid_array.size()) {
m_batteryPower->canDischargeToGrid = _discharge_grid_array[iprofile - 1];
}

Expand Down

0 comments on commit d7cdb55

Please sign in to comment.