Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
wvpm committed Feb 11, 2025
1 parent ec59873 commit a5ba7f7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/openvic-simulation/pop/Pop.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "utility/Logger.hpp"
#include "utility/Utility.hpp"
#define KEEP_DO_FOR_ALL_TYPES_OF_INCOME
#define KEEP_DO_FOR_ALL_TYPES_OF_EXPENSES
#define KEEP_DO_FOR_ALL_NEED_CATEGORIES
Expand Down Expand Up @@ -355,6 +357,12 @@ void Pop::pop_tick() {

for (auto [good_definition, money_to_spend] : money_to_spend_per_good) {
const fixed_point_t max_quantity_to_buy = max_quantity_to_buy_per_good[good_definition];

if (OV_unlikely(max_quantity_to_buy <= fixed_point_t::_0())) {
Logger::error("Aborted placing buy order for ",*good_definition," of max_quantity_to_buy 0.");
continue;
}

market_instance.place_buy_up_to_order({
*good_definition,
max_quantity_to_buy,
Expand Down

0 comments on commit a5ba7f7

Please sign in to comment.