abort()

Causes FRED to terminate immediately.

Synopsis

abort()

Description

This action causes FRED to terminate with an error message:

FRED ERROR: Agent <id> aborts in condition <cond_name> state <state_name> on sim day <N> sim date <YYYY-MM-DD>: <rule_containing_abort>

Parameters

This function has no parameters.

Examples

If an agent under 18 enters state B below,

condition FOO {
        ...
        state B {
              if (age < 18) then abort()
              ...
        }
     }

then FRED exits with an error message like:

FRED terminated with errors:
===================================
RUN1: FRED ERROR: Agent 164581176 aborts in condition FOO state B on sim day 10 sim date 2020-01-11:
if (age<18) then abort()

Note

The abort() action provides functionality normally associated with an assert() operator because FRED prints the rule that causes an abort.