Changes between Version 1 and Version 2 of Prefs2


Ignore:
Timestamp:
Sep 8, 2019, 10:49:29 AM (5 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Prefs2

    v1 v2  
    11= Computing preferences, version 2 =
    22
    3 == Static and dynamic prefs ==
     3== Static and dynamic parameters ==
    44
    5 "Dynamic" prefs are parameters that limit BOINC activity,
    6 and that change in response to various factors.
     5"Dynamic" parameters limit BOINC activity
     6and change in response to various factors.
    77Examples include limits on #CPUs, RAM usage, network usage, etc.
    88
     
    2525Hence the prefs system is extensible without modifying the client.
    2626
     27Values are doubles; Booleans are encoded as 0/1.
     28
    2729== Preference terms ==
    2830
     
    3335There are three types of terms:
    3436
    35  * "greater than": the value of the item is greater than a threshold X.
    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 time intervals.
     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.
    3840
    3941A term can also have a "negate" flag, which if set reverses its sense.
     
    4143The XML representation of a term is
    4244{{{
    43 <prefs_term>
     45<term>
    4446   <item>item-name</item>
    45    <term_type>x</term_type>     // 0 = greater than, 1 = nonzero, 2 = time range
     47   <type>x</type>     // 0 = greater than, 1 = nonzero, 2 = time range
    4648   [<negate/>]
    4749   [<thresh>x</thresh>]         // if greater than
    4850   [time range]                 // if time range
    49 </prefs_term>
     51</term>
    5052}}}
    5153and the representation of a time range is
     
    6062      <end_hour>y</end_hour>
    6163   <day>
     64</time_range>
    6265}}}
     66
    6367== Conditions ==
    6468
     
    6670XML format:
    6771{{{
    68 <prefs_condition>
     72<condition>
    6973   [<negate/>]
    70    <prefs_term> ... </pref_term>
     74   <term> ... </term>
    7175   ...
    72 </prefs_condition>
     76</condition>
    7377}}}
    7478
    7579== Clauses ==
    7680
    77 A "clause" is the combination of a condition and a set of dynamic prefs.
     81A "clause" is the combination of a condition and a set of dynamic parameters.
    7882XML format:
    7983{{{
    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>
    8488}}}
    8589
     
    9094{{{
    9195<computing_prefs>
    92    <prefs_clause> ... </prefs_clause>
     96   <clause> ... </clause>
    9397   ...
    9498</computing_prefs>
     
    96100
    97101The semantics are as follows.
    98 We maintain a set X of dynamic settings, initially empty.
    99 the clauses are processed in order.
     102X is a set of dynamic parameters, initially empty.
     103The clauses are processed in order.
    100104For 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.
     105If the condition is true, we overwrite X with C's dynamic parameters.
     106At the conclusion, X is the dynamic parameters to be enforced by the client.