diff --git a/Moose Development/Moose/Core/Fsm.lua b/Moose Development/Moose/Core/Fsm.lua index d6a4d2dc2..cca4162db 100644 --- a/Moose Development/Moose/Core/Fsm.lua +++ b/Moose Development/Moose/Core/Fsm.lua @@ -11,12 +11,40 @@ -- # 1) @{Core.Fsm#FSM} class, extends @{Core.Base#BASE} -- -- A Finite State Machine (FSM) defines the rules of transitioning between various States triggered by Events. --- * A **State** defines a moment in the process. --- * An **Event** describes an action, that can be triggered both internally as externally in the FSM. An Event can be triggered Embedded or Delayed over time. -- +-- * A **State** defines a moment in the process. +-- * An **Event** describes an action, that can be triggered both internally as externally in the FSM. An Event can be triggered Embedded or Delayed over time. -- --- 1.1) Add or remove objects from the FSM --- -------------------------------------------- +-- ![Test Image](../Presentations/MOOSE - FSM - 1. Concepts/Dia3.jpg) +-- +-- An FSM transitions in **4 moments** when an Event is being handled. +-- Each moment can be catched by handling methods defined by the mission designer, +-- that will be called by the FSM while executing the transition. +-- These methods define the flow of the FSM process; because in those methods the FSM Internal Events will be fired. +-- +-- * To catch State moments, create methods starting with OnLeave or OnEnter concatenated with the State name. +-- * To catch Event moments, create methods starting with OnBefore or OnAfter concatenated with the Event name. +-- +-- ** The OnLeave and OnBefore transition methods may return false to cancel the transition.** +-- +-- ![Test Image](../Presentations/MOOSE - FSM - 1. Concepts/Dia4.jpg) +-- +-- The FSM creates for each Event **two Event trigger methods**. +-- There are two modes how Events can be triggered, which is **embedded** and **delayed**: +-- +-- * The **FSM:Event()** creates an Event that will be processed **embedded** or immediately. +-- * The **FSM:__Event( seconds )** creates an Event that will be processed **delayed** over time, waiting x seconds. +-- +-- ![Test Image](../Presentations/MOOSE - FSM - 1. Concepts/Dia5.jpg) +-- +-- 1.1) Define the FSM Rules +-- ------------------------- +-- +-- The FSM can be defined by using 3 methods: +-- +-- * @{#FSM.SetStartState}(): Define the **Start State** of the FSM. This is the State the FSM will have when nothing is processed yet. +-- * @{#FSM.AddTransition}(): Adds a new possible Transition Rule to the FSM. A Transition will change the State of the FSM upon the defined triggered Event. +-- * @{#FSM.AddProcess}(): Adds a new Sub-Process FSM to the FSM. A Sub-Process will start the Sub-Process of the FSM upon the defined triggered Event, with multiple possible States as a result. -- -- ==== -- diff --git a/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts.jpg b/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts.jpg deleted file mode 100644 index 2e7f2e7a8..000000000 Binary files a/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts.jpg and /dev/null differ diff --git a/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia1.JPG b/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia1.JPG new file mode 100644 index 000000000..61217a2e1 Binary files /dev/null and b/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia1.JPG differ diff --git a/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia2.JPG b/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia2.JPG new file mode 100644 index 000000000..442d4c0e3 Binary files /dev/null and b/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia2.JPG differ diff --git a/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia3.JPG b/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia3.JPG new file mode 100644 index 000000000..6aac8cbc0 Binary files /dev/null and b/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia3.JPG differ diff --git a/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia4.JPG b/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia4.JPG new file mode 100644 index 000000000..54b039046 Binary files /dev/null and b/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia4.JPG differ diff --git a/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia5.JPG b/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia5.JPG new file mode 100644 index 000000000..5341ffd0d Binary files /dev/null and b/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia5.JPG differ diff --git a/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia6.JPG b/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia6.JPG new file mode 100644 index 000000000..cfa208b57 Binary files /dev/null and b/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia6.JPG differ diff --git a/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia7.JPG b/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia7.JPG new file mode 100644 index 000000000..6ac282097 Binary files /dev/null and b/Moose Training/Presentations/Core/FSM/MOOSE - FSM - 1. Concepts/Dia7.JPG differ diff --git a/docs/Documentation/AI_Balancer.html b/docs/Documentation/AI_Balancer.html index 100b89b58..252dd3c71 100644 --- a/docs/Documentation/AI_Balancer.html +++ b/docs/Documentation/AI_Balancer.html @@ -238,7 +238,7 @@ SET_GROUP and additional event parameters provided during the event.

- AI_BALANCER:onenterDestroying(SetGroup, AIGroup, Event, From, To) + AI_BALANCER:onenterDestroying(SetGroup, AIGroup, From, Event, To) @@ -250,13 +250,13 @@ SET_GROUP and additional event parameters provided during the event.

- AI_BALANCER:onenterReturning(SetGroup, AIGroup, Event, From, To) + AI_BALANCER:onenterReturning(SetGroup, AIGroup, From, Event, To) - AI_BALANCER:onenterSpawning(SetGroup, ClientName, AIGroup, Event, From, To) + AI_BALANCER:onenterSpawning(SetGroup, ClientName, AIGroup, From, Event, To) @@ -487,7 +487,7 @@ The SET of Core.Set#SET_AIRBASEs to e
-AI_BALANCER:onenterDestroying(SetGroup, AIGroup, Event, From, To) +AI_BALANCER:onenterDestroying(SetGroup, AIGroup, From, Event, To)
@@ -508,12 +508,12 @@ The SET of Core.Set#SET_AIRBASEs to e
  • -

    Event :

    +

    From :

  • -

    From :

    +

    Event :

  • @@ -549,7 +549,7 @@ The SET of Core.Set#SET_AIRBASEs to e
    -AI_BALANCER:onenterReturning(SetGroup, AIGroup, Event, From, To) +AI_BALANCER:onenterReturning(SetGroup, AIGroup, From, Event, To)
    @@ -570,12 +570,12 @@ The SET of Core.Set#SET_AIRBASEs to e
  • -

    Event :

    +

    From :

  • -

    From :

    +

    Event :

  • @@ -590,7 +590,7 @@ The SET of Core.Set#SET_AIRBASEs to e
    -AI_BALANCER:onenterSpawning(SetGroup, ClientName, AIGroup, Event, From, To) +AI_BALANCER:onenterSpawning(SetGroup, ClientName, AIGroup, From, Event, To)
    @@ -616,12 +616,12 @@ The SET of Core.Set#SET_AIRBASEs to e
  • -

    Event :

    +

    From :

  • -

    From :

    +

    Event :

  • diff --git a/docs/Documentation/Base.html b/docs/Documentation/Base.html index 4cc8e7812..ec98ea9b2 100644 --- a/docs/Documentation/Base.html +++ b/docs/Documentation/Base.html @@ -225,12 +225,37 @@ The Core.Event#EVENTDATA structure co
  • BASE.GetParent: Returns the parent object from the object it is handling, or nil if there is no parent object.
  • -

    Future

    -

    Further methods may be added to BASE whenever there is a need to make "overall" functions available within MOOSE.

    +
    + +

    API CHANGE HISTORY

    + +

    The underlying change log documents the API changes. Please read this carefully. The following notation is used:

    + + + +

    YYYY-MM-DD: CLASS:NewFunction( Params ) replaces CLASS:OldFunction( Params ) +YYYY-MM-DD: CLASS:NewFunction( Params ) added

    + +

    Hereby the change log:


    -

    Author: FlightControl

    +

    AUTHORS and CONTRIBUTIONS

    + +

    Contributions:

    + + + +

    Authors:

    + +

    Global(s)

    diff --git a/docs/Documentation/Fsm.html b/docs/Documentation/Fsm.html index 0b08c42d6..1ec51d176 100644 --- a/docs/Documentation/Fsm.html +++ b/docs/Documentation/Fsm.html @@ -84,20 +84,99 @@

    Module Fsm

    -

    This module contains the FSM class.

    +

    This module contains the FSM class and derived FSM_ classes.

    +

    This development is based on a state machine implementation made by Conroy Kyle. The state machine can be found here: https://github.com/kyleconroy/lua-state-machine

    -

    I've taken the development and enhanced it to make the state machine hierarchical... +

    I've taken the development and enhanced it (actually rewrote it) to make the state machine hierarchical... It is a fantastic development, this module.


    -

    1) Workflow#FSM class, extends Core.Base#BASE

    +

    1) Core.Fsm#FSM class, extends Core.Base#BASE

    + +

    A Finite State Machine (FSM) defines the rules of transitioning between various States triggered by Events.

    + + + +

    Test Image

    + +

    An FSM transitions in 4 moments when an Event is being handled.
    +Each moment can be catched by handling methods defined by the mission designer,
    +that will be called by the FSM while executing the transition.
    +These methods define the flow of the FSM process; because in those methods the FSM Internal Events will be fired.

    + + + +

    * The OnLeave and OnBefore transition methods may return false to cancel the transition.*

    + +

    Test Image

    + +

    The FSM creates for each Event two Event trigger methods.
    +There are two modes how Events can be triggered, which is embedded and delayed:

    + + + +

    Test Image

    + +

    1.1) Define the FSM Rules

    + +

    The FSM can be defined by using 3 methods:

    + + + +
    + +

    API CHANGE HISTORY

    + +

    The underlying change log documents the API changes. Please read this carefully. The following notation is used:

    + + + +

    YYYY-MM-DD: CLASS:NewFunction( Params ) replaces CLASS:OldFunction( Params ) +YYYY-MM-DD: CLASS:NewFunction( Params ) added

    + +

    Hereby the change log:

    + + + +
    + +

    AUTHORS and CONTRIBUTIONS

    + +

    Contributions:

    + + + +

    Authors:

    + + -

    1.1) Add or remove objects from the FSM

    Global(s)

    diff --git a/docs/Documentation/Spawn.html b/docs/Documentation/Spawn.html index a4652532b..6017f8d4d 100644 --- a/docs/Documentation/Spawn.html +++ b/docs/Documentation/Spawn.html @@ -89,6 +89,7 @@

    1) Functional.Spawn#SPAWN class, extends Core.Base#BASE

    +

    The #SPAWN class allows to spawn dynamically new groups, based on pre-defined initialization settings, modifying the behaviour when groups are spawned. For each group to be spawned, within the mission editor, a group has to be created with the "late activation flag" set. We call this group the "Spawn Template" of the SPAWN object. A reference to this Spawn Template needs to be provided when constructing the SPAWN object, by indicating the name of the group within the mission editor in the constructor methods.

    @@ -116,6 +117,7 @@ Groups will follow the following naming structure when spawned at run-time:

    1.1) SPAWN construction methods

    +

    Create a new SPAWN object with the SPAWN.New() or the SPAWN.NewWithAlias() methods:

    @@ -2496,7 +2502,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 ) -

    When the first Spawn executes, all the Groups need to be made visible before start.

    +

    Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.

    diff --git a/docs/Documentation/index.html b/docs/Documentation/index.html index 27ad96c3c..c9d4166e0 100644 --- a/docs/Documentation/index.html +++ b/docs/Documentation/index.html @@ -255,7 +255,7 @@
    diff --git a/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia1.JPG b/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia1.JPG new file mode 100644 index 000000000..61217a2e1 Binary files /dev/null and b/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia1.JPG differ diff --git a/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia2.JPG b/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia2.JPG new file mode 100644 index 000000000..442d4c0e3 Binary files /dev/null and b/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia2.JPG differ diff --git a/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia3.JPG b/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia3.JPG new file mode 100644 index 000000000..6aac8cbc0 Binary files /dev/null and b/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia3.JPG differ diff --git a/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia4.JPG b/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia4.JPG new file mode 100644 index 000000000..54b039046 Binary files /dev/null and b/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia4.JPG differ diff --git a/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia5.JPG b/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia5.JPG new file mode 100644 index 000000000..5341ffd0d Binary files /dev/null and b/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia5.JPG differ diff --git a/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia6.JPG b/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia6.JPG new file mode 100644 index 000000000..cfa208b57 Binary files /dev/null and b/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia6.JPG differ diff --git a/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia7.JPG b/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia7.JPG new file mode 100644 index 000000000..6ac282097 Binary files /dev/null and b/docs/Presentations/MOOSE - FSM - 1. Concepts/Dia7.JPG differ
    Fsm -

    This module contains the FSM class.

    +

    This module contains the FSM class and derived FSM_ classes.