HasRuleFiredSuccessfully

Description

Returns whether or not the rule with a given name has successfully executed (with or without effect) during the current timestep of a rulebased simulation.

Type

BOOLEAN

Arguments

Type

Meaning

1

STRING

The name of the rule. The special string "Current Rule" or “ThisRule” (not case sensitive) is interpreted as a reference to the currently executing rule.

Evaluation

This function returns TRUE if:

  • the rule finished successfully (i.e., at least one assignment is attempted and none fail), or
  • the rule finished ineffectively (i.e., the rule is evaluated but the logic within the execution constraint or within the body of the rule decides no assignment is necessary or the rule attempts assignment but priority is junior so no assignment is made).

The function returns FALSE if

  • the rule has not yet fired, or
  • the rule has fired but terminated early (the rule encountered a NaN in a slot value).

Note that, as mentioned above, if the input name is "Current Rule" or “ThisRule”, then this is taken to be a reference to the currently executing rule.

Using the structure NOT HasRuleFiredSuccessfully("ThisRule") will cause the that rule to only execute successfully once.

Comments

The behavior of this function is undetermined outside of a rulebased simulation.

 
HasRuleFiredSuccessfully("Smith Flood Control")
HasRuleFiredSuccessfully("Current Rule")
HasRuleFiredSuccessfully("ThisRule")
 
TRUE or FALSE