============================================================ S P E C I F I C A T I O N O F D E F A U L T R U L E S ============================================================ This file describes the use of "default rules," which specify default values of room properties, request weights, preference weights, event properties, and preference functions. They enable the system to make reasonable guesses about unspecified resources and preferences. --------------------------- Specification of room rules --------------------------- A default rule for determining room properties consists of five parts: name, priority, applicability conditions, variables, and default values. -= Name =- The name of a rule is an alphanumeric string, which must be different from the names of all other rules. -= Priority =- The priority of a rule is a natural number between 0 and 1000, which shows its "importance" and helps to resolve conflicts; a greater number means higher importance. -= Applicability conditions =- These conditions determine when the system uses the rule. They include a list of room types, as well as a list of room properties and respective value sets. A value set may be "Known," "Unknown," or a list of nonoverlapping intervals. For example, suppose that we have a rule for classrooms and conference rooms, and that it is applicable when the room size is at least 1000 square feet, the capacity is known, and the maximal number of demo stations is unknown. Then, the applicability condition is as follows: Room types: Classroom, Conference-Room Properties: Size: [1000..100000] Capacity: Known Stations: Unknown -= Variables =- The list of variables includes the names of the known room properties used in computing default values. Each of these properties must be specified as either "Known" or a list of intervals in applicability conditions. For example, if we compute the defaults based on the room size and capacity, then the variables include Size and Capacity. -= Default values =- The default values is a list of room properties and related defaults. Each element includes a property name and its default value, which may be a specific value or PUD. The rule must not specify defaults for any properties used in the rule's conditions; also, different elements of the list must refer to different properties. The rule may also have "Unknown" default values, in addition to specific values and PUDs, but these "Unknown" values are not actual defaults. They indicate that the related default values should be learned, and they are not used until the system learns these values. The rule application never leads to setting any property to "Unknown." If a default is a specific value, it may be either an integer constant or a linear combination of properties listed as variables. For instance, suppose that the default number of projectors is 2, and the default Reception-Capacity is half of the regular capacity. Then, we specify these defaults as follows: Projectors: 2 Reception-Capacity: 0.5 * Capacity If a default is a PUD, we represent it as a list of intervals, where each interval includes a probability, lower-end value, and upper-end value. The probability of an interval is a real-valued constant, and the sum of these probabilities must be 1.0. Each lower-end and upper-end value may be either an integer constant or a linear combination of properties listed as variables. For example, suppose that 70% of rooms allow the square arrangement of tables, and the related capacity is usually between 0.25 and 0.5 of the regular capacity, plus 0.1 of the room size. Then, we define the related default as follows: Square-Capacity: 0.3 prob: [0 .. 0] 0.7 prob: [0.25 * Capacity + 0.1 * Size .. 0.5 * Capacity + 0.1 * Size] -= Example rule =- If we put the above examples together, we get a rule that illustrates all specification elements, although it is not useful in practice: Name: Capacity Priority: 2 Applicability: Room types: Classroom, Conference-Room Properties: Size: [1000..100000] Capacity: Known Stations: Unknown Variables: Size, Capacity Defaults: Projectors: 2 Reception-Capacity: 0.5 * Capacity Square-Capacity: 0.3 prob: [0 .. 0] 0.7 prob: [0.25 * Capacity + 0.1 * Size .. 0.5 * Capacity + 0.1 * Size] ------------------------- Application of room rules ------------------------- We next describe an algorithm for applying room rules. Note that rules may conflict with each other, and they may also conflict with inherited and explicitly specified values. To resolve these conflicts, the system assigns a priority to each known value, and compares it with priorities of conflicting rules. -= Priorities of property values =- For each known property value of each room, the system keeps its priority, which is a natural number between 0 and 1001; note that the system does not keep priority of "Unknown" values. Intuitively, this priority shows the reliability of the system's knowledge. For example, consider the following room specification: Name: Red-Room Room type: Conference-Room Size: 0.7 prob: [1000..2000], 0.3 prob: [2000..3000]; priority 2 Capacity: 100; priority 1001 Stations: Unknown Projectors: 1.0 prob: [0..2]; priority 0 Reception-Capacity: Unknown Square-Capacity: 1.0 prob: [50..150]; priority 0 The knowledge of Capacity in this example is very reliable (1001), the knowledge of Size is unreliable (2), and the knowledge of Projectors and Square-Capacity is even less reliable (0). If the user explicitly specifies a property, its priority is 1001. If a room inherits a property from its parent in the hierarchy, then the system marks it as "inherited" without a priority, and then uses the priority of inherited values specified in "params.txt." The priority of all inherited values is the same; it must be strictly smaller than 1001. If the system generates a property value by applying a default rule, the priority is also smaller than 1001. If the initial specification of a room includes a property with unspecified priority, the system assumes that its priority is 1001. If "params.txt" does not specify the priority of "inherited" values, the system assumes that it is 0. -= Rule applicability =- A default rule is applicable to a specific room if it satisfies all of the following conditions. () The type of the room is among the types specified in the rule. () For every room property specified as "Known" in the applicability conditions, the related value in the room specification is either a numeric value or a PUD. () For every room property specified as "Unknown" in the applicability conditions, the related value in the room specification is "Unknown." () For every room property specified by a list of numeric intervals in the applicability conditions, the value in the room specification is either a numeric value in this range or a PUD completely contained in this range. In other words, the probability that this value is in the specified range must be 100%. -= Application priority =- When the system applies a rule to a specific room, it computes the application priority; intuitively, it shows the reliability of the related default values. The priority computation is as follows: Application-Priority(Rule, Room) Set Min-Priority to Rule's priority For each property in Rule's applicability conditions: If this property in is not "Unknown": Let Prop-Priority be the priority of the related property value in Room If Min-Priority > Prop-Priority, then Min-Priority = Prop-Priority Return Min-Priority In other words, the application priority is the minimum among the rule's priority and the priorities of all known room properties that are listed in the rule's applicability conditions. Note that the system ignores the "Unknown" properties when computing the priority. For example, suppose that we apply the "Capacity" rule (see above) to "Red-Room." The two known properties in the applicability conditions are Size and Capacity, and their priorities in "Red-Room" are 2 and 1001, and the priority of the rule itself is 2. The application priority is the minimum of these three values, which is 2. -= Applicable defaults =- When a rule is applicable to a room, the system may replace some of the room's property values with new values generated by the rule. The new values used in the replacement are called applicable defaults. A default value is applicable if it satisfies the following conditions. () This value is among default properties in the rule specification, and it is not "Unknown." () The old value in the room specification is "Unknown" or the old value's priority is strictly smaller than the application priority. () The system includes code for computing the related default value according to the rule specification. Since some cases may require complex probability computations, which are not yet implemented, the system may sometimes be unable to compute default values, which make them inapplicable. -= Application loop =- The "application loop" involves applying all rules to a given room. The system sorts the rule in the decreasing order of their priority, and then applies them one by one. When it finds a rule with applicable defaults, it replaces the related values in the room specification with the new values, and sets the priority of these values to the application priority. For example, if it applies the "Capacity" rule to "Red-Room," then it sets the Projectors value of "Red-Room" to 2, and the related priority to 2. If the system changes some room property during its pass through all rules, then it goes back to the beginning of the application loop and makes a second pass through all rules. Note that it completes the first pass through all rules before starting the second pass; that is, if some rule in the middle of the pass causes a change, the system applies the remaining rules before returning to the beginning of the loop. If the second pass also changes some property, the system makes the third pass, an so on. If the total number of rules is R, and the number of room properties is P, then the system can make at most P * R + 1 passes through the loop. If it makes P * R + 1 passes, and the last pass still causes changes, it signals an error.