FinanceSim 0.1.0
Financial Simulation Library
Loading...
Searching...
No Matches
career_job.cpp
Go to the documentation of this file.
2#include "core/event.hpp"
3
4namespace financesim {
5
6namespace {
7 // Semi-monthly payment interval: ~15.22 days (365 / 24 payments)
8 constexpr double SEMI_MONTHLY_DAYS = 365.0 / 24.0;
9}
10
11CareerJob::CareerJob(std::string id, std::string name, double annual_salary, SimTime start_day)
12 : IncomeBase(std::move(id), std::move(name),
13 Schedule{start_day, -1.0, SEMI_MONTHLY_DAYS, ExecutionTiming::EndOfPeriod})
14 , annual_salary_(annual_salary)
15 , payment_amount_(annual_salary / 24.0)
16{
17}
18
22
26
27} // namespace financesim
void update(SimTime time) override
CareerJob(std::string id, std::string name, double annual_salary, SimTime start_day=0.0)
Construct a CareerJob model.
void reset() override
Reset model to initial state (for replay)
void emit(SimTime time, Args &&... args)
void reset() override
Reset model to initial state (for replay)
double SimTime
Represents a point in simulation time (continuous, in days)
Definition time.hpp:6
ExecutionTiming
Configuration for when a model executes within its period.
Definition time.hpp:9