Length of times array to generate.
Core implementation of setRandomSchedule, error checks are supposed to be already done when invoking it.
Array of projected AcademicSubjects retrieved from the db.
Sets subjects
to be a random matrix of AcademicSubjectDoc.name.
Generates at max Const.MaxSubjectTimesPerWeek entries of subject per week.
Does not corrupt state in case of an error. Does not write any changes to
the database. As it is a subdocument, it will be saved only with its
parent document.
Returns an AcademicSubjectDoc.name[], that denotes the list of today's subjets in schedule.
Generated using TypeDoc
Returns a number[] of
subjectsAmount
length and its sum in an object. This array defines the number of times each subject appears in the schedule.E.g. if subjects: ['Math', 'English', 'Programming'], then
subjectsAmount
=== subjects.length === 3, and this function returns { timesSum: 5, timesPerWeek: [1, 2, 2] } timesPerWeek numbers are genrated randomly according to some restrictions. Returned data means, that 'Math' appears 1 time in a week schedule and 'English' and 'Propgramming' appear 2 times in the schedule.