Advertisement
Guest User

Untitled

a guest
Oct 16th, 2013
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 1.10 KB | None | 0 0
  1. module plus.models.common;
  2. import std.datetime;
  3.  
  4. enum InterpolationType {
  5.   Linear,
  6.   Step,
  7.   Cubic
  8. }
  9. enum PaymentFrequencyType {
  10.   Monthly,
  11.   Annual,
  12.   Semiannual,
  13.   Once
  14. }
  15. struct DateRange {
  16.   Date start;
  17.   Date end;
  18. }
  19.  
  20. struct DateValue {
  21.   Date date;
  22.   double value = 0.0;
  23. }
  24.  
  25. struct AcquiredRetired {
  26.   Date acquired;
  27.   Date retired;
  28. }
  29.  
  30. struct Point {
  31.   double x = 0.0;
  32.   double y = 0.0;
  33. }
  34.  
  35. struct QuantityBin {
  36.   InterpolationType interpolationType;
  37.   immutable(Point)[] data;
  38. }
  39.  
  40. struct RateCurve {
  41.   immutable(DateValue)[] curveData;
  42. }
  43.  
  44. struct CFlowSequenceSpec {
  45.   Date startDate;
  46.   Date endDate;
  47.   PaymentFrequencyType paymentFrequencyType;
  48.   double value = 0.0;
  49.   double growthRate = 0.0;
  50.   RateCurve growthCurve;
  51. }
  52.  
  53.  
  54. struct FlowSpec {
  55.   string descr;
  56.   string source;
  57.   CFlowSequenceSpec cFlowSequenceSpec;
  58. }
  59.  
  60. struct IncomeSpec {
  61.   string incomeType;
  62.   FlowSpec flowSpec;
  63. }
  64.  
  65. struct ExpenseSpec {
  66.   string expenseType;
  67.   FlowSpec flowSpec;
  68. }
  69.  
  70. struct FlowModel {
  71.   IncomeSpec[string] incomeModel;
  72.   ExpenseSpec[string] expenseModel;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement