Time constraints: classes, subjects, groups, classrooms and grid

Time constraints tell the solver which slots to avoid or to favor. The same editor is used for a teacher's availability and for the constraints carried by a class, a subject, a group, a classroom or the grid itself. Each surface only exposes the levels that make sense for it.

For the details of the teacher case (entry by the teacher, sharing link, validation), see Teacher availability.

The four levels

A slot is painted with one of these levels, each identified by a color:

Color Level Effect on generation
Black Unavailable Hard constraint: the solver never places a lesson there
🔴 Red Undesired Strong soft constraint: the solver avoids it as much as possible
🟠 Orange Slightly disliked Light soft constraint: avoided if everything else allows it
🟢 Green Preferred Positive preference: the solver favors this slot

An unpainted slot is neutral. The Eraser clears a painted level and returns it to neutral.

Who carries which levels

Not all entities give access to all four levels:

  • Teacher — Unavailable, Undesired, Preferred (black, red, green). This is their availability.
  • Class (Class time constraints), subject (), classroom (Availability) — Unavailable and Undesired (black, red). They describe the slots where you do not want — or would rather not have — the class working / the subject placed / the classroom used.
  • Group (Availability) — the same black and red levels, a Premium feature (see below).
  • Time grid (the site) — the only surface that offers the orange level (Slightly disliked). See below.

Access is always through the small clock shown on the entity (on each class, each subject of the class, each classroom…). The clock takes on a color when constraints are already entered.

Constraints set on the grid

On a site's grid, you paint the global constraints directly, valid for the whole school:

  • painting a slot black closes it for everyone — this is how a slot is banned globally (Wednesday afternoon, a break, a meeting slot…).

Soft grid constraints: with Premium, the grid also accepts red and orange constraints — slots to avoid without closing them.

With Premium, the grid additionally accepts soft constraints: red (Undesired) and orange (Slightly disliked), to discourage a slot without closing it.

See Time grid, time slots and durations for the structure of the grid (slots, durations, breaks).

The constraint editor

The editor is shared by all entities, and everything is done by clicking.

First choose a level in the top bar (the levels offered depend on the entity). It becomes the active "brush" and applies to every slot you touch:

  • Click a cell to paint that single slot; click then drag across several cells to paint them in one gesture.
  • Click a day header to paint the whole column (the entire day); click an hour header to paint the whole row (that slot on every day). This is the fastest way to cover large areas.
  • The Eraser is a brush like any other: select it, then click or drag to return to neutral.

Typical week and calendar view

For a weekly or cyclic timetable, constraints are entered on a typical week.

Calendar view of constraints: in calendar mode, constraints are entered and reviewed by week, by month or over the whole year, in addition to the typical week.

For a calendar-type timetable (Premium), a navigation bar lets you switch between weeks, months, whole year and typical week: you enter dated constraints, and you can also declare a recurring constraint on the typical week. The date windows additionally restrict the periods when certain lessons can be scheduled.

On the typical week, each slot consolidates the constraints of all the matching dates in the period (every Monday at 8:00, for example). When these dates diverge, the slot displays a proportional color band — the width of each color reflects the number of days concerned — and its tooltip gives the count per level (how many days unavailable, undesired, etc.). Clicking this slot forces the chosen level on all these dates at once: this is the generic way to decide for the whole typical day.

Additional options

Hour caps: with Premium, a class or group constraint can cap the number of lesson hours per day (and per week in calendar mode).

Below the editor, a class or group constraint can carry caps (Premium):

  • Maximum number of lesson hours in a day — in HH:MM format;
  • Maximum number of lesson hours in a week — in calendar mode.

The solver respects these caps as optimization constraints.

On the teacher side, a free comment lets them share a remark about their availability (travel, a specific constraint).

Inheritance between levels

Constraint inheritance: a group inherits the constraints of its class and its parent groups; an “Allowed lessons” level locally lifts this inheritance.

A group inherits the constraints of its class and of its parent groups (see Group hierarchy). When a slot must be locally allowed despite an inherited constraint, the Allowed lessons level neutralizes the inherited constraint without changing the source.

Effect on generation

Black constraints are blocking: a lesson will never be placed on an unavailable slot. The red and orange levels are penalties the solver tries to minimize; green is a bonus. If the constraints make a lesson impossible to place, the generation reports it — see Diagnosing a failed generation.

See also