Difference: TableSystemandComputeFunction (2 vs. 3)

Revision 32016-06-26 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="SystemDocumentation"
Changed:
<
<

Table System and Compute Function

>
>

Table System and Compute Function

 
Changed:
<
<
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 crearte a compute function over responce and pattern results to allow the XML write to computer complex functions over both indivitual items, and lists of iteas. For the later aggregate functions will be supported (SUM, MAX, etc).
>
>
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:

Line: 13 to 13
 
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.

Changed:
<
<
%CODE{"c++"}% Table for ...
>
>
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

%CODE{"html"}% Interior Wall and Ceiling Finish Requirements by Occupancy

  More Information
Changed:
<
<
Occupancy
>
>
GROUP
Sprinklered, exit enclosures and exit passageways
Sprinklered, Corridors
 
Changed:
<
<
A^D, E: S
>
>
Sprinklered, Rooms and enclosed spaces
 
Changed:
<
<
A^D, E: NS
>
>
Nonsprinklered, exit enclosures and exit passageways
 
Changed:
<
<
I-1, I-3, I-4: S
>
>
Nonsprinklered, Corridors
 
Changed:
<
<
I-1, I-3, I-4: NS
>
>
Nonsprinklered, Rooms and enclosed spaces
 
Deleted:
<
<
...
 
Changed:
<
<
N N 1 2 2 NP 1 ...
>
>
B B C A A B
 
Changed:
<
<
N N 2 NP 1 ...
>
>
B B C A A C
 
Added:
>
>
Requirements for rooms and ... <notes
 

Line: 72 to 85
 
A symbolic constant
Changed:
<
<
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 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")
 %CODE{"c++"}%
Changed:
<
<
N 3
>
>
A Class A construction 1
 
Added:
>
>
S Building equipped throughout with an automatic sprinkler system install in accordance with Section 903.3.1.1 2
 %ENDCODE%
Changed:
<
<
The Compute Operation
>
>

The Compute Operation

  A new tag will be added <compute> that works like <value>, but is much more generalized.
Changed:
<
<
%CODE{"c++"}% [q324] + [q333]
>
>
<-- SyntaxHighlightingPlugin -->
<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>
<-- end SyntaxHighlightingPlugin -->

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:

<-- SyntaxHighlightingPlugin -->
<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)
<-- end SyntaxHighlightingPlugin -->

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

<-- SyntaxHighlightingPlugin -->
<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>
<-- end SyntaxHighlightingPlugin -->

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 %CODE{"html"}% [*,F,F]<=2 && [*,M,F]<=2 || [*,M,F]>=4 && [*,M,M]>=4

...

 %ENDCODE%

META FILEATTACHMENT attachment="1BuildingHeights.jpeg" attr="" comment="Allowable Heights" date="1466903471" name="1BuildingHeights.jpeg" path="1BuildingHeights.jpeg" size="2657659" user="JimSkon" version="2"
 
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