system := { schooltypes : list of schooltype; }; schooltype := { schools : list of school; }; school := { lteacher : list of teacher := updateref(lteacher_1,friend(teacher.position)); sexratio : real /* sex=0: male, sex=1: female! */ := haselements(lteacher.sex,1) / length(lteacher); sexlist : list of real := append(sexlist_1, sexratio); prob1 : real := ny * exp(kappa * sexratio_1); }; teacher := { position : list of school; sex : int; age : int := age_1 + 1; duration : int := (normal(1,15,5) if sex else normal(1,30,5)) if count = 1 else duration_1 - 1; cond : int := 1 if (duration_1 = 1) || (age_1 >= 64) else 0; death : list of teacher := delete(self(teacher), self(teacher) if cond_2 else []); new : list of teacher := copy(self(teacher), cond_1, [age_1 :: uniform(1,25,30), cond_1 :: 0, cond_2 :: 0, sex :: 1 if prob(1,position.prob1_1) else 0, duration_1 :: normal(2,15,5) if sex else normal(2,30,5) ]); };