| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (10 out of 22)

Inference Engine Parameters

The Inference Engine Parameters system table controls computational aspects of the inference engine.

Limiting the Depth of Recursion

The Recursion-limit attribute limits the depth of recursion for user-defined functions. This limit does not affect procedures at all. If user-defined functions extend beyond the recursion limit, G2 fails to evaluate the function and displays a level 1 warning message, indicating that the user-defined function is in an infinite recursion or that the recursion limit is too low.

Defining the Timeout for Getting a Variable Value

The Timeout-for-variables attribute defines how much time G2 allows before concluding that it has failed to receive a value for a variable. The default is 30 seconds. Specify none if you do not want variables to time out.

When a variable fails to receive a value, G2 invokes all of the whenever rules containing fails-to-receive-a-value statements for that variable. For example, if the variable temperature-sensor-1 fails to receive a value within the time interval that the Timeout-for-variables attribute specifies, G2 invokes the following whenever rule for that variable:

Specifying the Timeout for Rule Completion

The Timeout-for-inference-completion attribute specifies the amount of time a rule has to complete. If the rule does not complete in this time, it is considered failed. When G2 is evaluating an expression, if a rule cannot be completed immediately (because a variable does not have a current value and G2 cannot immediately get one through backward chaining or data service), the rule goes to sleep. G2 temporarily stops evaluating the expressions in the rule. The variable that needs a value will wake up the expression when the value is available. If the timeout for the rule occurs before the rule awakens, the rule tries one last time to execute, and then completes whether or not it succeeds.

This attribute lets you control when inferencing occurs. If rules did not have timeouts, they could reawaken long after the conditions that cause G2 to invoke them end.

You can override the Timeout-for-inference-completion attribute for a particular rule with that rule's Timeout-for-rule-completion attribute. For example, if you want one rule to have up to 1 minute to complete, but all other rules to have 30 seconds to complete, set the Timeout-for-inference-completion system table attribute to 30 seconds and the special rule's Timeout-for-rule-completion attribute to 1 minute.

The default is 30 seconds. Specify none if you do not want rules to time out.

Specifying the Number of Retries for a Variable Value

The Retry-interval-after-timeout attribute specifies the number of retries for a variable value. In this context, the term retry refers to when G2 checks to see if a variable has received a value after it initially fails to receive one. The value of this attribute determines how long G2 waits before a retry.

When the Retry-interval-after-timeout attribute has a time interval value, G2 requests a value for the variable immediately when the variable exceeds the time interval that the Timeout-for-variables attribute specifies, and continues to do so every retry interval. For example, if the Retry-interval-after-timeout is 2 minutes, and a variable fails to receive a value within the Timeout-for-variables interval, G2 sends out an additional request every 2 minutes until the variable receives a value.

Setting this attribute to do-not-retry prevents G2 from retrying a variable.

Specifying the Fuzzy Truth Threshold

The Truth-threshold attribute specifies the threshold for fuzzy truth expressions, as described in the section Producing Fuzzy Truth Values From Relational Operations.

This attribute can have a value from 0 to 1. Fuzzy truth expressions that evaluate to less than the threshold are false, while those that are equal to or greater than the threshold are true. If, for example, the Truth-threshold attribute is set to 0.5 and the antecedent to a rule has a truth value of 0.6, the antecedent is true and the rule fires. The default truth threshold is 0.8.

Class-Specific Attributes of the Inference Engine Parameters

The class-specific attributes of the Inference Engine Parameters system table are:

Attribute Description
Recursion-limit
Limits the depth of recursion for user-defined functions.
Allowable values:
integer
Default value:
50


Timeout-for-variables
Determines how much time G2 allows before concluding that it is has failed to receive a value for a variable.
Allowable values:
{time interval | none}
Default value:
30 seconds


Timeout-for-inference-completion
Specifies the amount of time a rule has to complete.
Allowable values:
time-interval
Default value:
30 seconds


Retry-interval-after-timeout
Tells G2 how often to retry for a value after a variable fails to receive one.
Allowable values:
{time-interval | do not retry}
Default value:
1 minute


Truth-threshold
Determines the threshold for fuzzy truth expressions.
Allowable values:
{number true | true | false}
Default value:
.800 true

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (10 out of 22)

Copyright © 1997 Gensym Corporation, Inc.