package Ġonline . st unden plan er . solver . score Calculator . schedule Calcul ators Ċ Ċ import Ġonline . st unden plan er . domain .* Ċ import Ġonline . st unden plan er . solver . score Calculator . Schedule Calculator Ċ import Ġonline . st unden plan er . solver . score Calculator . entity Calcul ators . Teacher Score Calculator Ċ Ċ class ĠTe acher Schedule Calculator ĊĠ Ġ: ĠSchedule Calculator < Teacher , ĠDay Calculator < Teacher Score Calculator >>() Ġ{ ĊĠ Ġprivate Ġvar Ġhard Score : ĠInt Ġ= Ġ 0 ĊĊĠ Ġprivate Ġlateinit Ġvar Ġta ught Occ urrences Of Subject s Per Teacher : ĠMap < Course , ĠMap < Subject , ĠMutable Map < Teacher , ĠMutable List < L ecture >? >>> ĊĊĠ Ġoverride Ġfun Ġreset Working Solution ( school Schedule : ĠSchool Schedule ) Ġ{ ĊĠĠĠ Ġta ught Occ urrences Of Subject s Per Teacher Ġ= Ġschool Schedule . courses ĊĠĠĠĠĠ Ġ. associate Ġ{ Ġcourse Ġ-> ĊĠĠĠĠĠĠĠ Ġcourse Ġto Ġschool Schedule . subjects ĊĠĠĠĠĠĠĠĠĠ Ġ. associate Ġ{ Ġsubject Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsubject Ġto Ġmutable Map Of < Teacher , ĠMutable List < L ecture > ?> () ĊĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġhard Score Ġ= Ġ 0 ĊĊĠĠĠ Ġall Schedules Ġ= Ġschool Schedule . te achers ĊĠĠĠĠĠ Ġ. associate Ġ{ ĊĠĠĠĠĠĠĠ Ġit Ġto ĠDay Calculator ({ Ġday Ġ-> ĠTe acher Score Calculator ( day ) Ġ}) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġall Schedules . values . forEach Ġ{ Ġit . reset Working Solution ( school Schedule ) Ġ} ĊĠĠĠ Ġschool Schedule . lect ures . forEach Ġ{ Ġinsert ( it ) Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġinsert ( lecture : ĠL ecture ) Ġ{ ĊĠĠĠ Ġif Ġ(! move Sc orable ( lecture )) Ġreturn ĊĠĠĠ Ġall Schedules [ lecture . teacher ] !!. insert ( lecture ) ĊĊĠĠĠ Ġinsert Move ( lecture ) ĊĠĠĠ Ġhard Score Ġ+= Ġcalculate Hard Score After Move ( lecture ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġinsert Move ( lecture : ĠL ecture ) Ġ{ ĊĠĠĠ Ġval Ġcourse Ġ= Ġlect ure . course ĊĠĠĠ Ġval Ġsubject Ġ= Ġlect ure . subject ĊĠĠĠ Ġval Ġteacher Ġ= Ġlect ure . teacher !! ĊĊĠĠĠ Ġval Ġte aching Te achers Ġ= Ġta ught Occ urrences Of Subject s Per Teacher [ course ] ! ![ subject ] !! ĊĠĠĠ Ġif Ġ( te aching Te achers [ teacher ] Ġ== Ġnull ) Ġte aching Te achers [ teacher ] Ġ= Ġmutable ListOf () ĊĠĠĠ Ġte aching Te achers [ teacher ] !!. add ( lecture ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġre tract ( lecture : ĠL ecture ) Ġ{ ĊĠĠĠ Ġif Ġ(! move Sc orable ( lecture )) Ġreturn ĊĠĠĠ Ġall Schedules [ lecture . teacher ] !!. re tract ( lecture ) ĊĊĠĠĠ Ġhard Score Ġ-= Ġcalculate Hard Score After Move ( lecture ) ĊĠĠĠ Ġre tract Move ( lecture ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġre tract Move ( lecture : ĠL ecture ) Ġ{ ĊĠĠĠ Ġval Ġcourse Ġ= Ġlect ure . course ĊĠĠĠ Ġval Ġsubject Ġ= Ġlect ure . subject ĊĠĠĠ Ġval Ġteacher Ġ= Ġlect ure . teacher !! ĊĊĠĠĠ Ġval Ġte aching Te achers Ġ= Ġta ught Occ urrences Of Subject s Per Teacher [ course ] ! ![ subject ] !! ĊĠĠĠ Ġval Ġta ught L ect ures Ġ= Ġte aching Te achers [ teacher ] !! ĊĠĠĠ Ġta ught L ect ures . remove ( lecture ) ĊĠĠĠ Ġif Ġ( ta ught L ect ures . size Ġ== Ġ 0 ) Ġte aching Te achers . remove ( teacher ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġmove Sc orable ( lecture : ĠL ecture ): ĠBoolean Ġ{ ĊĠĠĠ Ġreturn Ġlect ure . teacher Ġ!= Ġnull Ġ&& Ġlect ure . period Ġ!= Ġnull ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġcalculate Hard Score After Move ( lecture : ĠL ecture ): ĠInt Ġ{ ĊĠĠĠ Ġreturn Ġdifferent Te achers Pen alty ( lecture ) ĊĠ Ġ} ĊĊĠ Ġ/** Hard : ĊĠĠ Ġ* ĠA Ġteacher Ġshould Ġte ach Ġall Ġoccurrences Ġof Ġa Ġsubject ĊĠĠ Ġ*/ ĊĠ Ġprivate Ġfun Ġdifferent Te achers Pen alty ( lecture : ĠL ecture ): ĠInt Ġ{ ĊĠĠĠ Ġval Ġcourse Ġ= Ġlect ure . course ĊĠĠĠ Ġval Ġsubject Ġ= Ġlect ure . subject ĊĠĠĠ Ġval Ġte aching Te achers Ġ= Ġta ught Occ urrences Of Subject s Per Teacher [ course ] ! ![ subject ] !! ĊĠĠĠ Ġreturn Ġ 1 Ġ- Ġte aching Te achers . size ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġcalculate Hard Score (): ĠInt Ġ{ ĊĠĠĠ Ġreturn Ġsuper . calculate Hard Score () Ġ+ Ġhard Score ĊĠ Ġ} Ċ }