:orphan: .. **************************************************************************** .. CUI .. .. The Advanced Framework for Simulation, Integration, and Modeling (AFSIM) .. .. The use, dissemination or disclosure of data in this file is subject to .. limitation or restriction. See accompanying README and LICENSE for details. .. **************************************************************************** behavior -------- .. contents:: :local: :depth: 4 .. command:: behavior :block: .. parsed-literal:: behavior_ script_variables ... end_script_variables on_init ... end_on_init on_message ... end_on_message precondition ... end_precondition on_new_execute ... end_on_new_execute on_new_fail ... end_on_new_fail execute ... end_execute end_behavior Overview ======== A behavior (also called a behavior node or a leaf node) is one of the two basic node types used by a :command:`behavior_tree`. A behavior is defined globally at the simulation level. Every behavior defined in a scenario must be given a unique name. Once a behavior is defined, any behavior tree can use it, by referencing it by name. Behavior Mode of Operation ========================== Behavior nodes themselves can have child nodes of any type; child nodes are executed after the behavior performs its execute script. Behavior nodes can also have a finite state machine (FSM) on them, one per behavior node. To implement the FSM, define states with transition rules inside the behavior block. The transition rules are defined using the :ref:`WSF scripting language