Optimizing Rule-based Clash

Clash rules written to perform interference checking rely on the DefineInterferenceComputation function.
The mechanism works as follows:

The rule enables calling the DefineInterferenceComputation function, which in return launches the interference calculation.

Optimizing clash rules consist in making sure only relevant calls to this function are performed. Specifying the appropriate condition in the clash rule thus permits to avoid unnecessary calls and optimizes the computation time.

This task shows you how to optimize clash rules for interference analysis purposes. The following procedures described are described:
 

Using HasARepresentation condition

The HasARepresentation condition allows to verify the product involved has the same representation shape described as an argument within the DefineInterferenceComputation function.

In the example below, the rule takes into account a PipingPart with a representation Envelope and Equipment with a representation Layout.

  • The condition specified in this rule (if (p1 != p2) only checks P1 different from P2.
  • No check is performed to verify that the representations described in the DefineInterferenceComputation exist for P1 and P2.

    To optimize this rule, we recommend you to the HasARepresentation condition as follows:
  • The HasARepresentation condition verifies P1 is assigned an Envelope representation and P2 is assigned a Layout representation.
If in the DefineInterferenceComputation function the arguments specified for the representation are the default arguments, the HasARepresentation condition becomes obsolete because we are sure the representation exist.

Preferring the the test > instead of =! condition

The > test condition can only be used:

  • When the type of product for P1 and P2 is the same.
  • When the expected representation name for P1 and P2 is the same.

    In the rule below (if (p1 != p2) , these two conditions are fulfilled:

  • P1 and P2 have the very same type (Equipment)
  • The representation name for P1 and P2 is also identical (Layout).

To optimize this rule, we recommend you to use the > test condition as follows:

Test Condition Description

Let's say we have three products namely Product A, Product B and Product C

The DefineInterferenceComputation function searches for interferences combining all pairs of products:

  • Product A vs. Product B

  • Product A vs. Product C

  • Product B vs. Product A

  • Product B vs. Product C

  • Product C vs. Product A

  • Product C vs. Product B

If products A, B and C are assigned the same product type and we are checking the same representations, the system performs useless double checks.

Now, if we consider the same three products using the > test condition, the interference checking will be performed between the following scheme: Product A > Product C > Product B.

The DefineInterferenceComputation function searches for interferences combining:

  • Product A vs. Product B

  • Product A vs. Product C

  • Product C vs. Product B
     

The useless checks are not performed by the DefineInterferenceComputation:

  • Product B vs. Product A

  • Product B vs. Product C

  • Product C vs. Product A

Important: To make sure all cases will be taken into account during the calculation:

  • The product type for P1 and P2 must be identical. 

  • The representation name for  P1 and P2 must be the very same for P1 and P2.

 

Ordering conditions

The system checks the test conditions specified in the clash rule one by one and in the order they were specified within the clash rule.

Example:

 

How does the system check the rule?
 

  • Step 1: checks P1 is different from P2 if (p1 != p2) 
  • Step 2: checks P2 is assigned an Envelope representation ( p2->HasARepresentation ("Envelope"))
  • Step 3: checks that P1 is assigned the representation Double ( p1->HasARepresentation ("Double")).

If for example, P2 is not assigned the Envelope  representation, the system will not go further and will not check whether P1 is assigned the Double representation.

It is thus strongly recommended to order the conditions starting with the most restrictive test condition and finish with the less restrictive test conditions.