title: Is this a correct implementation of a FuSM (Fuzzy State Machine)
body: <p>I am super confused whether or not this actually counts as beeing a FuSM, because in the end, it is just an if else condition, which many say is not enough for it to be fuzzy logic? I'm am also confused whether or not fuzzy AI and a Fuzzy State Machine are considered beeing one and the same? And must a FuSM support multiple states being executed at the same time in order for it to be a FuSM? This implementation does this, but I'm not sure it does it correct.</p>
  
  <p>Hope my question is not too unclear, maybe it is too early for me to ask. I'm definitely confused and some light on it would be appreciated.</p>
  
  <pre><code>// Some states may not be executed simultaneously
  public enum StateType
  {
      MovementXZ, // Can move while doing everything else
      MovementY, // Can jump &amp; crawl while doing everything else
      Action // Can use his hands (shoot &amp; stuff) while doing everything else
  }
  
  public class FuzzyStateMachine
  {
      private readonly Dictionary&lt;StateType, List&lt;IFuzzyState&gt;&gt; _states;
  
      public void AddState(IFuzzyState state)
      {
          _states[state.StateType].Add(state);
      }
  
      public void ExecuteStates()
      {
          foreach (List&lt;IFuzzyState&gt; states in _states.Values)
          {
              // Selects the state with the maximum "DOA" value.
              IFuzzyState state = states.MaxBy(x =&gt; x.CalculateDOA());
              state.Execute();
          }
      }
  }
  
  public interface IFuzzyState
  {
      StateType StateType { get; }
  
      /// &lt;summary&gt;
      /// Calculates the degree of activation (a value between [0, 1])
      /// &lt;/summary&gt;
      /// &lt;returns&gt;&lt;/returns&gt;
      double CalculateDOA();
  
      // TODO: implement: OnEnterState, OnExitState and OnStay instead of just Execute()
      void Execute();
  }
  </code></pre>
  
  <p>Two simple examples:</p>
  
  <pre><code>public class SeekCoverState : IFuzzyState
  {
      public StateType StateType
      {
          get { return StateType.MovementXZ; }
      }
  
      public double CalculateDOA()
      {
          return 1 - Agent.Health / 100d;
      }
  
      public void Execute()
      {
          // Move twoards cover
      }
  }
  
  public class ShootAtEnemyState : IFuzzyState
  {
      public StateType StateType
      {
          get { return StateType.Action; }
      }
  
      public double CalculateDOA()
      {
          // Return the properbility of hidding the target or something.
      }
  
      public void Execute()
      {
          // Shoot
      }
  }
  </code></pre>