Changes between Version 1 and Version 2 of Prefs2
- Timestamp:
- Sep 8, 2019, 10:49:29 AM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Prefs2
v1 v2 1 1 = Computing preferences, version 2 = 2 2 3 == Static and dynamic p refs ==3 == Static and dynamic parameters == 4 4 5 "Dynamic" p refs are parameters that limit BOINC activity,6 and thatchange in response to various factors.5 "Dynamic" parameters limit BOINC activity 6 and change in response to various factors. 7 7 Examples include limits on #CPUs, RAM usage, network usage, etc. 8 8 … … 25 25 Hence the prefs system is extensible without modifying the client. 26 26 27 Values are doubles; Booleans are encoded as 0/1. 28 27 29 == Preference terms == 28 30 … … 33 35 There are three types of terms: 34 36 35 * "greater than": the value of the item is greater than a thresholdX.36 * "nonzero": the value of the item is nonzero (i.e. a true Boolean)37 * "time range": the value of the item (a time value) lies in a set of timeintervals.37 * "greater than": the value of the item is greater than a number X. 38 * "nonzero": the value of the item is nonzero (i.e. Boolean true) 39 * "time range": the value of the item (a time value) lies in a set of day/week intervals. 38 40 39 41 A term can also have a "negate" flag, which if set reverses its sense. … … 41 43 The XML representation of a term is 42 44 {{{ 43 < prefs_term>45 <term> 44 46 <item>item-name</item> 45 <t erm_type>x</term_type> // 0 = greater than, 1 = nonzero, 2 = time range47 <type>x</type> // 0 = greater than, 1 = nonzero, 2 = time range 46 48 [<negate/>] 47 49 [<thresh>x</thresh>] // if greater than 48 50 [time range] // if time range 49 </ prefs_term>51 </term> 50 52 }}} 51 53 and the representation of a time range is … … 60 62 <end_hour>y</end_hour> 61 63 <day> 64 </time_range> 62 65 }}} 66 63 67 == Conditions == 64 68 … … 66 70 XML format: 67 71 {{{ 68 < prefs_condition>72 <condition> 69 73 [<negate/>] 70 < prefs_term> ... </pref_term>74 <term> ... </term> 71 75 ... 72 </ prefs_condition>76 </condition> 73 77 }}} 74 78 75 79 == Clauses == 76 80 77 A "clause" is the combination of a condition and a set of dynamic p refs.81 A "clause" is the combination of a condition and a set of dynamic parameters. 78 82 XML format: 79 83 {{{ 80 < prefs_clause>81 < prefs_condition> ... </prefs_condition>82 <dynamic_ settings> ... </dynamic_settings>83 < prefs_clause>84 <clause> 85 <condition> ... </condition> 86 <dynamic_params> ... </dynamic_params> 87 <clause> 84 88 }}} 85 89 … … 90 94 {{{ 91 95 <computing_prefs> 92 < prefs_clause> ... </prefs_clause>96 <clause> ... </clause> 93 97 ... 94 98 </computing_prefs> … … 96 100 97 101 The semantics are as follows. 98 We maintain a set X of dynamic settings, initially empty.99 the clauses are processed in order.102 X is a set of dynamic parameters, initially empty. 103 The clauses are processed in order. 100 104 For each clause C, we evaluate its condition. 101 If the condition is true, we overwrite X with C's dynamic settings.102 At the conclusion, X is the dynamic settings to be enforced.105 If the condition is true, we overwrite X with C's dynamic parameters. 106 At the conclusion, X is the dynamic parameters to be enforced by the client.