Table System and Compute Function

Thie goal is to create a mechanism in the XML to represent, look up, and use information in a table. In addition, the goal is to create a compute function over response and pattern results to allow the XML write to computer complex functions over both individual items, and lists of items. For the later aggregate functions will be supported (SUM, MAX, etc).

Tables

Tables will allow the XML author to create tables that include references to either reponse knowledge or pattern results (including other table lookups), to look up something in a table and return the appropriate response value. The link below gives some example tables, with comments:

Sample Architecture Tables

T is for TableLookup

A two dimensional table

The table will work by first selecting a column. This is done by going through the header and fidning the first one that matches (dependancy is true). Then the system will go through the rows, finding the first that also matches. If a reference is made to a question that has not been asked, the question will be asked. If an another table is referenced, that table will be referenced for an answer.

GROUP Sprinklered
exit enclosures and exit passageways
Sprinklered
Corridors
Sprinklered
Rooms and enclosed spaces
Nonsprinklered
exit enclosures and exit passageways
Nonsprinklered
Corridors
Nonsprinklered
Rooms and enclosed spaces
A-1 & A-2 B B C A Ad Bc
A-3f, A-4, A-4 B B C A Ad C

<item id=t803.9 type="lookuptable" subtype="2">
      <summerystatement note="k">Interior Wall and Ceiling Finish Requirements by Occupancy</summerystatement>
      <explanation>More Information</explanation> 
      <headers>
          <header>
             <title>GROUP</title>
         </header>
          <header>
             <title>Sprinklered, exit enclosures and exit passageways</title>
             <selector dependency="OR(qSprinklered,qExit)"\>
         </header>
         <header>
            <title>Sprinklered, Corridors</title>
            <selector dependency="OR(qSprinklered,qCorridors)"\>
        </header>
        <header>
            <title>Sprinklered, Rooms and enclosed spaces</title>
            <selector dependency="OR(qSprinklered,qRoom)"\>
        </header>
          <header>
             <title>Nonsprinklered, exit enclosures and exit passageways</title>
             <selector dependency="OR(NOT(qSprinklered),qExit)"\>
         </header>
         <header>
            <title>Nonsprinklered, Corridors</title>
            <selector dependency="OR(NOT(qSprinklered),qCorridors)"\>
        </header>
        <header>
            <title>Nonsprinklered, Rooms and enclosed spaces</title>
            <selector dependency="OR(NOT(qSprinklered),qRoom)"\>
        </header>
    </headers>
    <rows>
        <row>
            <label>A-1 & A-2</label>
            <selector dependency="OR(tA1,tA2)"\>
             <cell>B</cell>
             <cell>B</cell>
             <cell>C</cell>
             <cell>A</cell>
             <cell note="d">A</cell>
             <cell note="c">B</cell>
        </row>
        <row>
            <label>I-1, I-3, I-4</label>
            <selector dependency="OR(tA3,tA4,tA5)"\>
             <cell>B</cell>
             <cell>B</cell>
             <cell>C</cell>
             <cell>A</cell>
             <cell note="d">A</cell>
             <cell>C</cell>
        </row>
    </rows>
   <notes>
      <note>
         <label>c</label>
         <comment>Requirements for rooms and ... </comment>
       <note>
    <notes
</item>   
          

A symbolic constant

A symbol can be used instead of an integer for a response. It will always be translated to the underlying integer for use in dependencies, responses, and computations. A symbol is really a simplifies version of a table, and the same classifier is used (first letter "T")

<item id="tClassA" type="symbol">
    <symbol>A</symbol>
    <comment>Class A construction</comment>
    <value>1</value>
</item>

<item id="tS" type="symbol">
    <symbol>S</symbol>
    <comment>Building equipped throughout with an automatic sprinkler system install in accordance with Section 903.3.1.1</comment>
    <value>2</value>
</item>

The Compute Operation

A new tag will be added <compute> that works like <value>, but is much more generalized.

<compute>[q9.2.1,B] + [q5.4.3,B]</compute>  // voice B for building
<compute>([q9.2.1,B] / [q5.4.3,B]) + [t507.2.3,B]</compute>

The compute function with work with the index with aggregate functions like SUM, MAX, AVG, etc. If you see an aggregate function over a q (question) or t (table) reference, by default the operation is computed over all NON-null (answered) values across the indexes:

<compute>SUM([qRoomSize,R])</compute> // Rooms are in an indexed voice R (room).
<compute>[t304.2]+AVG([t342.1.1.2,F])</compute> //  t341.1.1.2 is a table with the  indexed voice F (floor)

Or you could use aggregate functions across groups of questions, or XML question sets (different from Clips question sets, but the same concept)

<set id=sFireSppression><name>Fire Suppression Types</name><items>q304.2, q304.3, q304.5, q304.7</items></set>
<compute>COUNT([t304.2])</compute> // Count the number differnt types of fire suppression used
<set id=sCommunication><name>Communication Questions</name><items>q200, q201, q202, q203, q204, q205, q206, q208, q212</items></set>
<compute>COUNT([sCommunication])>7<compute>

And you can as a dependency to an aggregate function, it will only compute for values that meet a given dependency AVE([qRoomSize,R],[qRoomType,R,qPublic]) // This finds the average size of rooms that are indexed, and only includes rooms that are qPublic COUNT([sCommunication],[pAgreement]) // compute the number of items in the sCommunication set that match the agree pattern

Evaluate

A similar idea to compute is a <evaluate ...> option. The idea is that this evaluates to True, False, or NA (not answered) much as <Compute> does numbers.

Patterns

Now if we can merely name our compute and evaluate functions, and then reference them as patterns, can we eliminate CLIPS? * refers to the question evoked on it

<pattern id="pAgreement"><evaluate>[*,F,F]<=2 && [*,M,F]<=2  || [*,M,F]>=4 && [*,M,M]>=4</evaluate></pattern>

<item id="..." dependency="pAgreement,q200"> ... </item>
Topic attachments
I Attachment History Action Size Date Who Comment
JPEGjpeg 1BuildingHeights.jpeg r2 r1 manage 2595.4 K 2016-06-26 - 01:11 JimSkon Allowable Heights
JPEGjpeg 2separation.jpeg r1 manage 2350.1 K 2016-06-26 - 00:53 JimSkon Separation
JPEGjpeg 3wallfinish.jpeg r1 manage 2230.4 K 2016-06-26 - 01:07 JimSkon Wall Finish
JPEGjpeg 4Alarms.jpeg r2 r1 manage 2681.8 K 2016-06-26 - 01:20 JimSkon  
JPEGjpeg 5StoriesOneExit.jpeg r1 manage 1172.5 K 2016-06-26 - 01:21 JimSkon  
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r3 - 2016-06-26 - JimSkon
 
  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback