Skip to content

Commit

Permalink
Update src/storage.cc
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Wilson <[email protected]>
  • Loading branch information
nuclearkatie and gonuke authored Nov 28, 2023
1 parent d0644c7 commit 7a5b93b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/storage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,12 @@ void Storage::Tock() {
std::vector<double>::iterator result;
result = std::max_element(in_commod_prefs.begin(), in_commod_prefs.end());
int maxindx = std::distance(in_commod_prefs.begin(), result);

double demand = 0;
if (manager()->context()->time() % (active_buying + dormant_buying) < active_buying) {
cyclus::toolkit::RecordTimeSeries<double>("demand"+in_commods[maxindx], this,
current_capacity());
demand = current_capacity());
}
else {
cyclus::toolkit::RecordTimeSeries<double>("demand"+in_commods[maxindx], this, 0);
}

cyclus::toolkit::RecordTimeSeries<double>("demand"+in_commods[maxindx], this, demand);

// Multiple commodity tracking is not supported, user can only
// provide one value for out_commods, despite it being a vector of strings.
Expand Down

0 comments on commit 7a5b93b

Please sign in to comment.