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

Password:

ODEPTRES.H Source File
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

ODEPTRES.H

Go to the documentation of this file.
00001 //Filename    : ODEPTRES.H
00002 //Description : Department Class Declaration
00003 
00004 #ifndef __ODEPTRES_H
00005 #define __ODEPTRES_H
00006 
00007 #include <OFIELD.H>
00008 #include <OFACULTY.H>
00009 #include <OSTUDENT.H>
00010 #include <ODEPTGEN.H>
00011 
00012 //------ School type for faculty departure and promotion probability -----//
00013 
00014 #define  DEPARTMENT_TYPE_COUNT  28                // the total number of types of departments
00015 
00016 #define PROB_SCHOOL_TYPE_COUNT  3                 // in opschool.h enum { LOCAL, REGIONAL, NATIONAL };
00017 
00018 // 1 for own deparment
00019 #define COURSE_GAME_FIELD_COUNT   GAME_FIELD_COUNT + 1
00020 
00021 //------ Define struct DepartmentRec -------//
00022 
00024 struct DepartmentRec {
00025     enum { NAME_LEN=26 };
00026 
00027     char  name[NAME_LEN];
00028     char  field_code[9];
00029     char  total_courses_taught[9];
00030     char  max_dl_class_size[9];                     //1102 add this?
00031 
00032     //---- multipliers & talent indices -----//
00033 
00034     char  salary_multiplier[9];
00035     char  teaching_load_multiplier[9];
00036     char  research_per_faculty_multiplier[9];
00037     char  female_multiplier[9];
00038     char  minority_multiplier[9];
00039     char  talent_teaching[9];
00040     char  talent_scholarship[9];
00041     char  talent_research[9];
00042 
00043     char  percent_faculty_pi[9];
00044     char  research_project_size[9];
00045 
00046     char  doctoral_graduation_rate_multiplier[9];
00047     char  doctoral_time_to_dropout_multiplier[9];
00048     char  doctoral_time_to_degree_multiplier[9];
00049     char  graduate_tuition_rate_multiplier[9];
00050 
00051     //-------- templates -------//
00052 
00053     char  template_rank_and_age[9];
00054     char  template_gender_ethnic[9];
00055     char  template_salary[9];
00056     char  template_talent[9];
00057     char  template_course_load[9];                  // Normal teaching load
00058 
00059     char  faculty_discretionary_time[9];
00060     char  course_type[9];
00061     char  base_fac_discretionary_time[9];
00062 };
00063 
00064 // for dept2.dbf
00066 struct DepartmentRec2 {
00067     enum { NAME_LEN=25 };
00068 
00069     char  name[NAME_LEN];
00070     char  iped_field[20];
00071     char  field_fraction_pct_sl1n2[10];
00072     char  field_fraction_pct_sl3[9];
00073     char  field_fraction_pct_sl4[9];
00074     char  field_fraction_pct_sl5[9];
00075 };
00076 
00077 // for facility.dbf
00079 struct DepartmentRec3 {
00080     char  replacement_cost[9];
00081     char  normal_onm_cost[9];
00082     char  months_to_construct[9];
00083 
00084     char  sf_per_course_enrollment[9];
00085     char  sf_per_faculty[9];
00086     char  sf_per_research_dollar[9];
00087     char  sf_per_dollar_of_central_exp[9];
00088     char  fixed_sf_per_dept[9];
00089 };
00090 
00091 // for elecpref.dbf
00093 struct ElecPrefRec {
00094     char  pref[DEPARTMENT_TYPE_COUNT][9];           // 0.999 => 99.9%
00095 };
00096 
00097 //------ Define struct DepartmentFacultyRec -------//
00098 
00100 struct DepartmentFacultyRec {
00101     char trans_prob[PROB_SCHOOL_TYPE_COUNT][9];
00102 };
00103 
00104 //------ Define struct DepartmentFacultyRec -------//
00105 
00107 struct DepartmentCourseRec {
00108     char  required[COURSE_GAME_FIELD_COUNT][9];
00109 };
00110 
00112 struct DepartmentUGCourseRec : DepartmentCourseRec {
00113     char  elective[BACHELOR_YEAR_COUNT][9];
00114 };
00115 
00117 struct DepartmentMasterCourseRec : DepartmentCourseRec {
00118     //char      elective[9];            // master program only has one year
00119 };
00120 
00121 //----------- Define class GeneralDepartmentInfo ---------------//
00122 //
00123 // "extract the same fields from DepartmentInfo for general education
00124 // can be a base class of DepartmentInfo if necessary
00125 //
00129 struct GeneralDepartmentInfo {
00130     //----- curriculum requirment vars -------//
00131 
00132     char bachelor_depth1[COURSE_GAME_FIELD_COUNT];  // bachelor_depth1[0] --> own department
00133     char bachelor_depth2[COURSE_GAME_FIELD_COUNT];  // each element contains the number of courses a student must take in a department
00134     char bachelor_depth3[COURSE_GAME_FIELD_COUNT];
00135 
00136                                                   // it contain the number courses a student must take over the years
00137     char  bachelor_elective_year_count[BACHELOR_YEAR_COUNT];
00138     // the total of preference weight across all department is 100, it is
00139     float bachelor_elective_course_pref[DEPARTMENT_TYPE_COUNT];
00140     float total_bachelor_elective_course_pref;      // the total of pref weights for existing departments
00141 
00142   //----- for facility office
00143   //
00144   // sf: square foot
00145 
00146   // Parameters for replacement and normal operations and maintenance cost
00147     int replacement_cost;                           // unit:    $ per sf                (not $000)
00148     float cost_growth, cost_growth_last2;           //## fred // 1026 for calc time variation // 0.99%
00149     float normal_onm_cost;                          // unit: $ per sf    (not $000)
00150     char  months_to_construct;
00151 
00152   // Parameters for calculating normal square footage
00153     float sf_per_course_enrollment_in_seminars;
00154     float sf_per_course_enrollment_in_general_courses;
00155     float sf_per_course_enrollment_in_lecture_courses;
00156 
00157     float sf_per_faculty;
00158     float sf_per_research_dollar;                   // per thousand dollars
00159     float sf_per_dollar_of_central_exp;             // per thousand dollars
00160     float fixed_sf_per_dept;
00161 
00162     // initermediate variables; not from db!!!
00163     int normal_sf, actual_sf;
00164     int projected_actual_sf;
00165     // $000
00166     float actual_new_debt, required_draw_on_capital_reserve, invest_close_gap, additional_debt;
00167 };
00168 
00169 //----- Define struct DepartmentInfo -------//
00170 
00174 struct DepartmentInfo : public GeneralDepartmentInfo {
00175     // fred 0620:  enum { NAME_LEN=50 };
00176     enum { NAME_LEN=40 };
00177 
00178     char  name[NAME_LEN+1];
00179     short field_id;
00180 
00181     // short total_courses_taught;      // 0406 it's a place holder in excel file
00182     short max_dl_class_size;                        // 1102
00183 
00184     //------ multipliers ------//
00185 
00186     float salary_multiplier;
00187     float teaching_load_multiplier;
00188     float research_per_faculty_multiplier;
00189     float female_multiplier;
00190     float minority_multiplier;
00191 
00192     //------ multipliers 0616 fred; for init student database ------//
00193 
00194     float doctoral_grad_rate_multiplier;
00195     float doctoral_time_to_dropout_multiplier;
00196     float doctoral_time_to_degree_multiplier;
00197     float graduate_tuition_rate_multiplier;
00198 
00199     //---- faculyt parameter-----//
00200 
00201     char  talent_teaching;
00202     char  talent_scholarship;
00203     char  talent_research;
00204 
00205     char  percent_pi_faculty;                       // 1117     // 99->99%
00206     int normal_research_project_size;
00207 
00208     //-------- templates -------//
00209 
00210     char  template_rank_and_age[1];
00211     char  template_gender_ethnic[1];
00212     char  template_salary[1];
00213     char  template_talent[1];
00214     char  template_course_load[1];
00215 
00216     char  template_discretionary_time[1];           //1116
00217 
00218     char  template_course_type[2];                  //1105
00219 
00220     char  base_fac_discretionary_time[1];           //1119
00221 
00222     //----- for database dept2 -----//
00223 
00224     char  iped_field;
00225     float field_fraction_pct[4];
00226 
00227     //----- for generate_student database -----//
00228 
00229     float doctor_dropout_trans_prob[MAX_GRADUATE_YEARS];
00230     float doctor_graduate_trans_prob[MAX_GRADUATE_YEARS];
00231 
00232     float doctor_year_in_program_pct[MAX_GRADUATE_YEARS+1];
00233     float student_major_pref[MAX_STUDENT_LEVEL_INI];
00234 
00235     //------ faculty promotion and departure probability ------//
00236 
00237     // 0.99->99%
00238     float faculty_departure_probability[FACULTY_RANK_LEVEL_COUNT][PROB_SCHOOL_TYPE_COUNT];
00239     float associate_professor_promotion_probability[PROB_SCHOOL_TYPE_COUNT];
00240     float assistant_professor_promotion_probability[PROB_SCHOOL_TYPE_COUNT];
00241 
00242     //------ required and elective courses tables ------//
00243 
00244     char master_depth3[COURSE_GAME_FIELD_COUNT];
00245     char master_graduate[COURSE_GAME_FIELD_COUNT];
00246     char master_elective_year_count;                // it contain the number courses a student must take over the years, master program only has one year
00247 
00248     // the total of preference weight across all department is 100, it is
00249     float master_elective_course_pref[DEPARTMENT_TYPE_COUNT];
00250     float total_master_elective_course_pref;
00251 
00252     char doctor_graduate[COURSE_GAME_FIELD_COUNT];
00253 
00254 public:
00255     //---- functions for generating student ----//
00256 
00257     void  generate_student_transition_prob_n_year_in_program_doctor();
00258     void  generate_student_major_preference();
00259 };
00260 
00261 //----------- Define class DepartmentRes ---------------//
00262 
00264 class DepartmentRes {
00265 public:
00266     char            init_flag;
00267 
00268     short           department_count;
00269     DepartmentInfo*   info_array;
00270 
00271     DepartmentInfo    general_dept_info;          // = general_education_department, although we just need GeneralDepartmentInfo, we still use DepartmentInfo for ease of programming
00272     GeneralDepartment general_dept;               // year 1 ug student without major
00273 
00274 public:
00275     DepartmentRes();
00276     ~DepartmentRes();
00277 
00278     void        init();
00279     void        deinit();
00280 
00281     int         write_file(File*);
00282     int         read_file(File*);
00283 
00284     void        calc_total_elective_course_pref();// this function should be called whenever a department is added or deleted, it updates adjusted_elective_course_rpef
00285 
00286     int     get_prob_school_type();
00287 
00288     DepartmentInfo*   operator[](int departmentId);
00289 
00290 private:
00291     void        load_info();
00292     void      load_faculty_info();
00293     void      load_faculty_info_sub(float trans_prob[PROB_SCHOOL_TYPE_COUNT], DepartmentFacultyRec *deptRec);
00294     void      load_course_info();
00295     void      load_course_info_sub(char required[COURSE_GAME_FIELD_COUNT], DepartmentCourseRec *deptRec);
00296     void      load_elective_course_pref();
00297     void      init_facility_info();
00298 };
00299 
00300 extern DepartmentRes department_res;
00301 
00302 //---------------------------------------------//
00303 #endif

Generated on Fri Aug 23 01:37:25 2002 for VirtualU by doxygen1.2.17