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

Password:

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

Ostudent.h

Go to the documentation of this file.
00001 //Filename    : OStudent.h
00002 //Description : Student Class Declaration
00003 
00004 #ifndef __OSTUDENT_H
00005 #define __OSTUDENT_H
00006 
00007 #ifndef __GAMEDEF_H
00008 #include <GAMEDEF.H>
00009 #endif
00010 
00011 #ifndef __ODYNARRB_H
00012 #include <ODYNARRB.H>
00013 #endif
00014 
00015 #ifndef __OCOURSE_H
00016 #include <OCOURSE.H>
00017 #endif
00018 
00019 #include <GAMEDEF.H>
00020 
00021 //----------- Define constant ----------//
00022 
00023 #define MAX_STUDENT_LEVEL   5
00024 #define MAX_STUDENT_LEVEL_INI 4                   // for student database init; see student_par spreadsheet 4: ug, master and distance learn // 0107
00025 #define MAX_GRADUATE_YEARS    8                   // for calc transistion probabilities for student techdoc 3.3, section 4.2
00026 
00027 enum {                                            // student_level
00028     UG_TRADITION, UG_NONTRADITION, MASTER, DOCTOR, DISTANCE_LEARN
00029 };
00030 
00031 enum {
00032     DEGREE_TYPE_COUNT = 3,                          // for interface Student: Activities
00033 
00034     BACHELOR_DEGREE = 0,                            // sl-1 only
00035     MASTER_DEGREE,                                  // sl-3
00036     DOCTOR_DEGREE,                                  // sl-4
00037 };
00038 
00039 enum {
00040     MAX_STUDENT_LEVEL_N_TOTAL = MAX_STUDENT_LEVEL+1,
00041     MAX_STUDENT_LEVEL_TOTAL = MAX_STUDENT_LEVEL,
00042 };
00043 //##### fred 0928 #####//
00044 
00045 enum {                                            // for array with data of UG_TRADITION, UG_NONTRADITION, MASTER
00046     MASTER_ARRAY_SIZE = MASTER + 1
00047 };
00048 
00049 enum {                                            // student_level, for student database init; see student_par spreadsheet
00050     SL_UG, SL_MASTER, SL_DOCTOR, SL_DISTANCE_LEARN
00051 };
00052 
00053 enum {                                            // division_status
00054     UPPER_DIVISION=1, LOWER_DIVISION
00055 };
00056 
00057 //---- Define the normal number of years for different degree types ----//
00058 
00059 enum {
00060     BACHELOR_YEAR_COUNT = 4,
00061     MASTER_YEAR_COUNT = 1,
00062     DOCTOR_YEAR_COUNT = 2
00063 };
00064 
00065 //------ constants for for Oenroll.h -------//
00066 enum {
00067     TALENT_INCOME_VAR_COUNT = 4,
00068     TALENT_VAR_COUNT = 3,                           // not include INCOME
00069 
00070     ACADEMIC = 0, EXTRA_CURRI, ATHLETIC, INCOME,
00071 };
00072 
00073 //--------- Define static function -------//
00074 static inline bool is_nontradition_ug_group(char sl) {
00075     return sl == UG_NONTRADITION || sl == DISTANCE_LEARN;
00076 }
00077 
00078 //--------- Define static function -------//
00079 static inline bool is_ug_group(char sl) {
00080     return sl == UG_TRADITION || sl == UG_NONTRADITION || sl == DISTANCE_LEARN;
00081 }
00082 
00083 //--------- Define class Student -------//
00084 
00090 class Student {
00091 public:
00092     //--- vars that will remain constant once initialized ---//
00093 
00094 #if(GAME_VERSION>=200)
00095     char  audit_flag;
00096     int file_course_id;
00097     int old_student_recno;
00098 #endif
00099 
00100     //  short   student_recno;
00101     int student_recno;                            //## chea 141099
00102 
00103     short department_recno;                       // this means major field of the student
00104 
00105     char  student_level;
00106     char  gender_ethnic_group;
00107     char  student_segment;                        //#### fred 0917//
00108 
00109     int date_admitted;
00110     int   year_admitted();
00111 
00112     //------- vars that will change over time ------//
00113 
00114     char  year_in_program;
00115 
00116     int   division_status()     { return year_in_program<=2 ? UPPER_DIVISION : LOWER_DIVISION; }
00117     float academic_achievement;                   // a percentage: 0 to 100
00118     int financial_aid;
00119 
00120     // FOR DESIGN1028_RESPONSE_FUNC.TXT
00121     float initializationValueAC_LIBRARIES;        // ## CHWG290699      //func 29
00122     float initializationValueAC_ATHLETICS;        //func 30
00123     //------- vars pertaining to courses ------//
00124 
00125     // the number of courses the student has to take in each trimester in a year, this array is set based on the summer teaching policy, the total of the values in the array should be 8 (STD_COURSES_PER_TRIMESTER*2)
00126     char  course_per_trimester[TRIMESTER_PER_YEAR];
00127 
00128     char  total_course_all;                       // this is the total of all elements in course_to_take_array[]
00129     char  total_elective_course_this_year;        // total number of elective courses taken and to take this school year
00130 
00131     // courses taken before, taking now and will be taking next trimester
00132     char  course_taken_array[MAX_DEPARTMENT][MAX_COURSE_DEPTH_WITHOUT_GR];
00133     char  course_taking_array[MAX_DEPARTMENT];    // courses taking this trimester, taking now and will be taking next trimester
00134 
00135     //##### begin fred 980915 #####//
00136     char  failed_course_count;                    // accumulated value from year 1 till graduate
00137     char  course_denials_this_trimester;
00138     char  course_failures_this_trimester;
00139     //##### end fred 980915 #####//
00140 
00141     char  off_quarter;                            // = AUTUMN, WINTER or SUMMER
00142 
00143     //---- talent and satisfaction/performance indices ----//
00144 
00145     //##### begin fred 980917 #####//
00146 
00147     char  talent_academic;
00148     char  talent_extracurricular;
00149     char  talent_athletics;
00150 
00151     char  satisfaction_academic;
00152     char  satisfaction_student_life;
00153     char  satisfaction_athletics;
00154     char  satisfaction_overall;
00155     char  faculty_workweek;
00156 
00157     // for calc satisfaction_overall
00158     char  reaction_summer_course, reaction_summer_course_last;
00159 
00160     float probability_change_major;
00161     float multiplier_on_dropout_prob;
00162 
00163     //--- extra effect for chance card ---//
00164 
00165     float extra_effect_satisfaction_academic;
00166 
00167     //-----------------------------------------//
00168 
00169 public:
00170     void  init(char studentLevel, char yearInProgram, char genderEthnicGroup, char stuSeg, char major, int finAid, float* talentArr);
00171 
00172     int write_file(File* filePtr);
00173     int read_file(File* filePtr);
00174 
00175     void  next_day();
00176     void  next_trimester();
00177 #if(GAME_VERSION>=200)
00178     void  select_course(int ignoreFaculty=0, int initPrevYear=0);
00179 #else
00180     void  select_course(int ignoreFaculty=0);
00181 #endif
00182 
00183     int  change_major(int couCompleted);          //## chea 170699
00184 
00185 private:
00186     //------ functions for assigning courses -------//
00187 
00188 #if(GAME_VERSION>=200)
00189     int   select_course2(int& isRequiredCourse, int ignoreFaculty, int initPrevYear );
00190 
00191     int   assign_course(int selectedCourseDept, int selectedCourseDepth,
00192                         int selectedCourseFocus, int selectedTeachingMethod,
00193                         int isRequiredCourse, int ignoreFaculty, int initPrevYear );
00194 #else
00195     int   select_course2(int& isRequiredCourse, int ignoreFaculty);
00196 
00197     int   assign_course(int selectedCourseDept, int selectedCourseDepth,
00198                         int selectedCourseFocus, int selectedTeachingMethod,
00199                         int isRequiredCourse, int ignoreFaculty);
00200 #endif
00201 
00202     int   get_available_faculty(int departmentRecno);
00203     int select_required_course(int &selectedCourseDept, int& selectedCourseDepth, int &selectedCourseFocus);
00204     void  select_elective_course(int &selectedCourseDept, int& selectedCourseDepth, int &selectedCourseFocus);
00205     int   select_teaching_method(int selectedCourseDept);
00206 
00207     int   study_course(int studyDeptRecno);
00208 
00209     int   total_course_taken_dept(int departmentRecno);
00210     int has_selected_all_course();
00211 
00212     //--------- other functions --------//
00213 
00214     int   think_graduate();
00215     //##### begin fred 980915 #####//
00216     int think_dropout();
00217     int think_change_major(char courseCompleted=0);
00218     void  think_summer_course();
00219     //##### end fred 980915 #####//
00220 
00221     //------ functions for performance indicators -------//
00222 public:
00223     void  update_history(char update_flag);
00224     void  calc_satisfaction_academic();
00225 
00226 private:
00227     void  calc_satisfaction_student_life();
00228     void  calc_satisfaction_athletics();
00229     void  calc_satisfaction_overall();
00230     void  calc_faculty_workweek();
00231 
00232     void  calc_probability_change_major();
00233     void  calc_multiplier_on_dropout_prob();
00234 };
00235 
00236 //----------- Define class StudentArray -----//
00237 
00241 class StudentArray : public DynArrayB {
00242 public:
00243     int     department_recno;
00244     int     student_count;
00245 
00246     //------------------------------------------//
00247 
00248 public:
00249     StudentArray();
00250     ~StudentArray();
00251 
00252     int     write_file(File* filePtr);
00253     int     read_file(File* filePtr);
00254 
00255     int       add(char studentLevel, char yearInProgram, char genderEthnicGroup, char stuSeg, char major, int finAid, float* talentArr);
00256 
00257     void      del(int recNo);
00258 
00259     void      next_day();
00260     void      next_trimester();
00261 
00262     void      init_course(int processYearInProgram);
00263 
00264     int     is_deleted(int recNo);
00265 
00266 #ifdef DEBUG
00267     Student*  operator[](int recNo);
00268 #else
00269     Student*  operator[](int recNo) { return (Student*) get(recNo); }
00270 #endif
00271 
00272     //---- functions for course selection ---//
00273 
00274     void      select_course(int ignoreFaculty=0);
00275 
00276     //##### begin fred 980921 #####//
00277     //----- for performance indicator -----//
00278 public:
00279     //----------------//
00280 
00281     // ##### Begin MArco ##### //
00282 #if(GAME_VERSION>=200)
00283     char  initial_talent_academic_all[DEGREE_TYPE_COUNT][HISTORY_MONTH_COUNT];
00284     char  initial_performance_academic_ug[HISTORY_MONTH_COUNT];
00285 
00286     int initial_bachelor_degree[HISTORY_YEAR_COUNT];
00287     int initial_master_degree[HISTORY_YEAR_COUNT];
00288     int initial_doctor_degree[HISTORY_YEAR_COUNT];
00289 
00290     float initial_fake_disp_time_to_degree[DEGREE_TYPE_COUNT][HISTORY_YEAR_COUNT];
00291     //  float   initial_fake_disp_time_to_degree[HISTORY_YEAR_COUNT];           //NEW
00292 
00293     float initial_time_to_degree[DEGREE_TYPE_COUNT][HISTORY_YEAR_COUNT];
00294     float initial_dropout_rate[DEGREE_TYPE_COUNT][HISTORY_YEAR_COUNT];
00295 #endif
00296     // ##### End MArco ##### //
00297     // student summary for sl1-5
00298     char  talent_academic_all[DEGREE_TYPE_COUNT][HISTORY_MONTH_COUNT];
00299     char  performance_academic_ug[HISTORY_MONTH_COUNT];
00300 
00301     // student summary for sl1
00302     char  talent_academic[HISTORY_MONTH_COUNT];
00303     char  talent_extracurricular[HISTORY_MONTH_COUNT];
00304     char  talent_athletics[HISTORY_MONTH_COUNT];
00305 
00306     char  satisfaction_academic[HISTORY_MONTH_COUNT];
00307     char  satisfaction_student_life[HISTORY_MONTH_COUNT];
00308     char  satisfaction_athletics[HISTORY_MONTH_COUNT];
00309     // for ultimate score
00310     char  satisfaction_overall[HISTORY_MONTH_COUNT];
00311 
00312     //----------------//
00313     float time_to_degree[DEGREE_TYPE_COUNT][HISTORY_YEAR_COUNT];
00314     float dropout_rate[DEGREE_TYPE_COUNT][HISTORY_YEAR_COUNT];
00315 
00316     // special case handling: fake_disp_time_to_degree() for smoothing graph
00317     float fake_disp_time_to_degree[DEGREE_TYPE_COUNT][HISTORY_YEAR_COUNT];
00318 
00319     //----------------//
00320     int bachelor_degree[HISTORY_YEAR_COUNT];
00321 #if(GAME_VERSION>=200)
00322     int non_ug_bachelor_degree[HISTORY_YEAR_COUNT];
00323 #endif
00324     int master_degree[HISTORY_YEAR_COUNT];
00325     int doctor_degree[HISTORY_YEAR_COUNT];
00326 
00327     //----------------//
00328     int time_to_degree_cumm[DEGREE_TYPE_COUNT];
00329     int cur_dropout[DEGREE_TYPE_COUNT];
00330     float ave_entering_class[DEGREE_TYPE_COUNT];
00331 
00332     int cur_bachelor_degree;
00333 #if(GAME_VERSION>=200)
00334     int cur_non_ug_bachelor_degree;               // store the graduations for nontraditional ug
00335 #endif
00336     int cur_master_degree;
00337     int cur_doctor_degree;
00338 
00339 #if(GAME_VERSION>=200)
00340     int last_year_degree[4];                      // for year end report student turnover
00341     int last_year_dropout[4];
00342 #endif
00343 
00344     int ave_time_to_graduation_for_ug;
00345 
00346     char  ave_satisfaction_student_life[MAX_STUDENT_LEVEL];
00347 
00348 public:
00349     void  update_history(char update_flag);
00350     void  calc_student_performance();
00351     void  calc_degree_awarded();
00352 
00353     // ##### Begin MArco ##### //
00354 #if(GAME_VERSION>=200)
00355     void  save_initial_data();
00356 #endif
00357     // ##### End MArco ##### //
00358     //--------------//
00359     //##### end fred 980921 #####//
00360 };
00361 
00362 //----------------------------------------//
00363 #endif

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