#!/usr/bin/env perl # schedule -- resolve scheduling constraints # # Originally by Alan Donovan # Cleaned up and extended by Michael Ernst # These days, creating a Doodle survey (http://www.doodle.com/) may be more # convenient. # Given a set of scheduling constraints (times that are impossible, and # times that are undesirable), this script outputs times that are possible, # and times that are desirable. # # The input is a file consisting of one line per individual. Each line # consists of three whitespace-separated parts: a name, a list of # impossible times, and a list of undesirable times. Each list of times is # a comma-separated set of ranges, in standard MIT format. # # For instance, the input file might look like: # mernst TR12:30-3,R4-5,W9-5 MR12-1 # notearly MTWRF9-10 # cpacheco MW1-4 TR9:30-11 # awilliam T11-4,W11:30-1:30,R11-3,R4-5,F10-12 M11-12,F12-4:30 # smcc R1-2,R4-5 # jhp MW9:30-11,F2-3 # akiezun TR11:00-3,F10-12:30 # artzi TR10-17,F10-12 # pgbovine MWF1-4,T4:30-5:30,R1-2 # galen F12:30-1:30 # tschantz MW10:30-4,F10-11 # chenx05 M12-5,TR9:30-11,TR12-1,TR2-5:30,W1-3,F11-3 # mao F9-5 # Typical instruction message: # # Please send me a message containing a one-line expression of your # schedule constraints, in the form of # # username impossible_times undesirable_times # # The times are comma-separated lists of time ranges (with no internal # space). A time range is a sequence of days (a subset of MTWRF; "Th" is # acceptable as a substitute for "R") and a range of hours. If your # impossible or undesirable times are empty, use just a comma for that # constraint. For example, one possible set of constraints is # # mernst MTWR9:30-11,M11-12 MR12-1,W9-5 # # Remember that you don't need to include any meetings with other members # of the group, or the reading group. # FILE FORMAT # The meaning of each line is: USERNAME, CANNOT, PREFERNOT # Comments begin with "#"; blanks and comments are skipped. # Whitespace is explicit, and only permitted where '_' appears. # line ::= _ _ # # name ::= identifier # # times_opt ::= ";" # | # # times ::= ";" # | # # dayspec ::= # # days ::= # | # # day ::= "M" | "T" | "W" | "R" | "F" | "S" | "Su" # # hourspec ::= "," # | # # range ::=