00001
00002
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
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 {
00028 UG_TRADITION, UG_NONTRADITION, MASTER, DOCTOR, DISTANCE_LEARN
00029 };
00030
00031 enum {
00032 DEGREE_TYPE_COUNT = 3,
00033
00034 BACHELOR_DEGREE = 0,
00035 MASTER_DEGREE,
00036 DOCTOR_DEGREE,
00037 };
00038
00039 enum {
00040 MAX_STUDENT_LEVEL_N_TOTAL = MAX_STUDENT_LEVEL+1,
00041 MAX_STUDENT_LEVEL_TOTAL = MAX_STUDENT_LEVEL,
00042 };
00043
00044
00045 enum {
00046 MASTER_ARRAY_SIZE = MASTER + 1
00047 };
00048
00049 enum {
00050 SL_UG, SL_MASTER, SL_DOCTOR, SL_DISTANCE_LEARN
00051 };
00052
00053 enum {
00054 UPPER_DIVISION=1, LOWER_DIVISION
00055 };
00056
00057
00058
00059 enum {
00060 BACHELOR_YEAR_COUNT = 4,
00061 MASTER_YEAR_COUNT = 1,
00062 DOCTOR_YEAR_COUNT = 2
00063 };
00064
00065
00066 enum {
00067 TALENT_INCOME_VAR_COUNT = 4,
00068 TALENT_VAR_COUNT = 3,
00069
00070 ACADEMIC = 0, EXTRA_CURRI, ATHLETIC, INCOME,
00071 };
00072
00073
00074 static inline bool is_nontradition_ug_group(char sl) {
00075 return sl == UG_NONTRADITION || sl == DISTANCE_LEARN;
00076 }
00077
00078
00079 static inline bool is_ug_group(char sl) {
00080 return sl == UG_TRADITION || sl == UG_NONTRADITION || sl == DISTANCE_LEARN;
00081 }
00082
00083
00084
00090 class Student {
00091 public:
00092
00093
00094 #if(GAME_VERSION>=200)
00095 char audit_flag;
00096 int file_course_id;
00097 int old_student_recno;
00098 #endif
00099
00100
00101 int student_recno;
00102
00103 short department_recno;
00104
00105 char student_level;
00106 char gender_ethnic_group;
00107 char student_segment;
00108
00109 int date_admitted;
00110 int year_admitted();
00111
00112
00113
00114 char year_in_program;
00115
00116 int division_status() { return year_in_program<=2 ? UPPER_DIVISION : LOWER_DIVISION; }
00117 float academic_achievement;
00118 int financial_aid;
00119
00120
00121 float initializationValueAC_LIBRARIES;
00122 float initializationValueAC_ATHLETICS;
00123
00124
00125
00126 char course_per_trimester[TRIMESTER_PER_YEAR];
00127
00128 char total_course_all;
00129 char total_elective_course_this_year;
00130
00131
00132 char course_taken_array[MAX_DEPARTMENT][MAX_COURSE_DEPTH_WITHOUT_GR];
00133 char course_taking_array[MAX_DEPARTMENT];
00134
00135
00136 char failed_course_count;
00137 char course_denials_this_trimester;
00138 char course_failures_this_trimester;
00139
00140
00141 char off_quarter;
00142
00143
00144
00145
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
00158 char reaction_summer_course, reaction_summer_course_last;
00159
00160 float probability_change_major;
00161 float multiplier_on_dropout_prob;
00162
00163
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);
00184
00185 private:
00186
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
00213
00214 int think_graduate();
00215
00216 int think_dropout();
00217 int think_change_major(char courseCompleted=0);
00218 void think_summer_course();
00219
00220
00221
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
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
00273
00274 void select_course(int ignoreFaculty=0);
00275
00276
00277
00278 public:
00279
00280
00281
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
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
00297
00298 char talent_academic_all[DEGREE_TYPE_COUNT][HISTORY_MONTH_COUNT];
00299 char performance_academic_ug[HISTORY_MONTH_COUNT];
00300
00301
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
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
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;
00335 #endif
00336 int cur_master_degree;
00337 int cur_doctor_degree;
00338
00339 #if(GAME_VERSION>=200)
00340 int last_year_degree[4];
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
00354 #if(GAME_VERSION>=200)
00355 void save_initial_data();
00356 #endif
00357
00358
00359
00360 };
00361
00362
00363 #endif