Miarmy Crowd Simulation Documentation (English)

Pipeline

Terminology

As we mentioned in the Part 1 Main Concept, in a single decision node, there are several conditions and decisions.

In terminology, we are going to call them sentence inputs and decision outputs.

There is an input sentence in each condition whereas an output sentence in each decision.

Please distinguish the "active" and "results", the active is a fuzzy logic concept value and it would be and only in range from 0.0 to 1.0, whereas, the results can be any values, it's a variables. 

Example: “move forward as speed 100”:

  • decision sentence value is 100, active is 0.55, and the results is "100 * 0.55" = 55

The calculation result of an input sentence is an array, and it would be arbitrary number of results (even 0-length array and no result), we called them input results

Example: “someone in my sphere and his sphere color id = 3”,

  • the "someone in my sphere and his sphere color id" is input sentence
  • "=3" is test logic of this sentence
    • maybe there are 3 agents in my detection sphere, result is an array and we will use the maximum result
    • or maybe there is no agents in my detection sphere, result is blank, result is 0

The calculated active of a single sentence, we call it sentence active

The calculated of a decision node, we call it node active

After node active, we will get some output sentence active, we call them decision results

We need solve out the behavior results from decision results, and this calculation process we call it defuzz


Summary

  1. sentence (light blue)
  2. input sentence (yellow)
  3. true (or test) range (red)
  4. input result (result from yellow)
  5. sentence active (result from light blue, from input result and test range)
  6. node active (result from green)
  7. output decision (pink)
  8. decision value (purple)
  9. decision result (node active * decision value)
  10. behavior result (result from multiple decision node and defuzz)

decision node contents

General Pipeline

Our brain node will collect all the information from scene (environment perceptions & agents themselves) and put the information to Miarmy Core Engine. Then our engine will deal with the information and solve out the behavior results, finally drive agents and update the scene in brain post node.
The engine is not a node or command, it's a piece of code can receive information, solve out the results and send information back



Logic General Pipeline

 

Engine Process Breakdown

  1. Calculate each sentence input results
  2. Solve out the sentence active from the input results by fuzzy logic
  3. Use sentence active and logic rule and priority among these sentences, solve out the node active
  4. Using hierarchical priority ranking system, recalculate the node active
  5. Collect all the decision results based on node active
  6. Using defuzz engine and decision results to calculate behavior result

Please notice the color of the following pictures:
Firstly, we need solve out the input results from the type of input sentence



Step 1: from input sentences, calculate the input results


After getting the values from input sentence, we will use the test range and fuzzy value to calculating out the active of a single sentence, we called this sentence active



Step 2: Sentence Active Calculation Pipeline


Then we need use the logic tool and priority among several sentences and to calculate out the node active



Step 3: Node Activate Calculation Pipeline


Using priority ranking hierarchy, recalculate out the new node active



Step 4: Modify node active using priority ranking hierarchy


Using the active value from each node, and decision output values, we can get many decision results. Then using defuzz method, we can solve out the actual results of each type of sentence, drive behavior

  • tx: stand for sentence "move forward as speed ?"
  • ry: stand for sentence "rotate left as speed ?"
  • action1: stand for sentence "play action:action1"
  • action2: stand for sentence "play action:action2"



Step 5 & 6: using node active and decision results finally get the behavior results, defuzz

 

 

 

Basefount Technology