Virtual U.org
Get Personal Training on VU Today
    
Top shadow
 
 register/help
User Name:

Password:

Oinvest.h Source File
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

Oinvest.h

Go to the documentation of this file.
00001 //Filename    : OINVEST.H
00002 //Description : Athletics Office Class Declaration
00003 //Owner           : Kevin(chwg)
00004 
00005 #ifndef __OINVESTMENT_H
00006 #define __OINVESTMENT_H
00007 
00008 #include <GAMEDEF.H>                              //### fred
00009 #include <OHISTORY.H>                             //### fred 1023
00010 
00011 //------- define constants for the special 3 yrs projected graph on screen ------//
00012 enum {
00013     P_HISTORY_YEAR_COUNT = 8,
00014     P_HISTORY_PROJECTED_YEAR_COUNT = 2,             // this, next and second next year
00015     P_HISTORY_PASSED_YEAR_COUNT = P_HISTORY_YEAR_COUNT - P_HISTORY_PROJECTED_YEAR_COUNT,
00016 
00017     P_THIS_YEAR = P_HISTORY_PASSED_YEAR_COUNT - 1,
00018     P_NEXT_YEAR,
00019     P_2ND_NEXT_YEAR,
00020 };
00021 
00022 enum {
00023     PROJECTION_TYPE_COUNT=3,
00024 
00025     PROJECTED_VALUE = 0,
00026     PROJECTED_MIN_VALUE,
00027     PROJECTED_MAX_VALUE,
00028 };
00029 
00030 enum {
00031     ASSET_TYPE_COUNT = 3,
00032 
00033     AS_LC_STOCK=0,                                  // large-cap
00034     AS_SC_STOCK,                                    // small-cap
00035     AS_BONDS,
00036 };
00037 
00038 //----------------------//
00039 
00041 struct AssetItem {
00042     int allocation_percent;                         // 33%
00043     float return_mean;                              // 0.33
00044     float return_deviation;                         // 0.33
00045 };
00046 
00047 //----------- Define class Investment --------------//
00048 //
00052 class Investment {
00053 
00054 public:
00055     Investment();
00056     ~Investment();
00057     void init();
00058     void deinit();
00059     void report(int);
00060     int detect();
00061     int detect2();
00062 
00063     //####### fred 981022 #########//
00064     char current_mode;
00065     int     write_file(File* filePtr);
00066     int     read_file(File* filePtr);
00067 
00068     //--------------------------------------//
00069     // simulation-related vars and methods
00070 
00071 public:
00072     //-------- for screen "overview1" ----------//
00073 
00074     AssetItem asset_array[ASSET_TYPE_COUNT];
00075 
00076     //### begin zhoubin 02/28/99
00077     float spinner_var1;
00078     //### end zhoubin 02/28/99
00079     float endowment_performance_history[HISTORY_MONTH_COUNT];
00080     float s_n_p_history[HISTORY_MONTH_COUNT];
00081 
00082     //-------- for screen "overview2" ----------//
00083 
00084     // number of valid entries = min(P_HISTORY_YEAR_COUNT, info.year_passed+3);
00085     int endowment_spending_history[PROJECTION_TYPE_COUNT][P_HISTORY_YEAR_COUNT];
00086     float equilibrium_payout_rate;
00087 
00088     // "Degree of smoothing for endowment payout":
00089     // no smoothing
00090     // 3-year smoothing
00091     // 5-year smoothing
00092     char  degree_smoothing_for_endowment_payout;  // INPUT_LOW, INPUT_MEDIUM, INPUT_HIGH
00093 
00094     //-------- not for interface ----------//
00095 
00096     float smoothed_endowment_value;
00097     float endowment_change_year_to_date;          // 990527
00098 
00099 #if(GAME_VERSION>=200)
00100     float smoothed_quasi_endowment_value;
00101 #endif
00102 
00103     // ##### Begin Marco ##### //
00104 #if(GAME_VERSION>=200)
00105     //  AssetItem       initial_asset_array[ASSET_TYPE_COUNT];
00106     int initial_asset_array0_allocation_percent;
00107     int initial_asset_array1_allocation_percent;
00108     int initial_asset_array2_allocation_percent;
00109     float initial_endowment_performance;
00110 #endif
00111     // ##### End Marco ##### //
00112 
00113 private:
00114     float asset_covariance_array[ASSET_TYPE_COUNT][ASSET_TYPE_COUNT];
00115 
00116     HistoryData expected_real_return;             // 99%
00117     float endowment_growthrate_deviation;         // 0.99 (99%)
00118     float endowment_ratio;
00119 
00120 public:
00121     float expected_real_annual_return_rate;       // 99%                        // nominal total return = inflation plus real return
00122 
00123     void  init_data();
00124     void  next_day();
00125     void  calc_smoothed_endowment_value();
00126 
00127     // ##### Begin Marco ##### //
00128 #if(GAME_VERSION>=200)
00129     void  save_initial_data();
00130 #endif
00131     // ##### End Marco ##### //
00132     //------------------------------------------//
00133 
00134 private:
00135     void  calc_endowment_growth();
00136     void  calc_equilibrium_payout_rate();
00137     void  update_history_sub();
00138     void  update_history(char updateFlag=UPDATE_ALL);
00139     //####### fred 981022 #########//
00140 };
00141 
00142 extern Investment investment_office;
00143 
00144 //-------------------------------------------------//
00145 #endif

Generated on Fri Aug 23 01:38:00 2002 for VirtualU by doxygen1.2.17