We need to define certain data structures for setting up everything before implementing the main steps:
- First, we'll create the data structure for handling data bits in a flexible manner, as shown in the following code:
public struct BlackboardDatum{ public int id; public string type; public object value;}
- Next, we'll create the class defining the expert, as follows:
public abstract class BlackboardExpert{ public virtual float GetInsistence(Blackboard board) { return 0f; } public virtual void Run(Blackboard board){}}
- Then, we create the data structure for saving actions taken by the experts, as shown in the following code:
public struct BlackboardAction{ public object expert; public string name; public System.Action action; ...