8 double initial_balance,
9 std::string routing_tag,
12 std::move(routing_tag), initial_balance,
15 , last_interest_time_(0.0) {
virtual void on_income(const IncomeEvent &event)
Called when an income event is routed to this account.
void reset() override
Reset model to initial state (for replay)
void deposit(SimTime time, double amount, const std::string &reason)
Deposit funds into the account.
void emit(SimTime time, Args &&... args)
double balance() const
Get current balance.
virtual void on_expense(const ExpenseEvent &event)
Called when an expense event is routed to this account.
void initialize(EventBus &bus) override
Event emitted when an expense occurs.
Event emitted when income is received.
void reset() override
Reset model to initial state (for replay)
void initialize(EventBus &bus) override
void on_income(const IncomeEvent &event) override
Called when an income event is routed to this account.
void accrue_interest_up_to(SimTime time)
SimTime last_interest_time_
void on_expense(const ExpenseEvent &event) override
Called when an expense event is routed to this account.
SavingsAccount(std::string id, std::string name, double apy, double initial_balance=0.0, std::string routing_tag="savings", Schedule schedule=make_savings_schedule())
void update(SimTime time) override
double SimTime
Represents a point in simulation time (continuous, in days)