How to do it...

Now, let's create the class that handles the blackboard and the main logic behind our metaphor:

  1. First, let's define the Blackboard class, as shown in the following code:
using System.Collections.Generic;public class Blackboard{  public List<BlackboardDatum> entries;  public List<BlackboardAction> pastActions;  public List<BlackboardExpert> experts;}
  1. Next, let's implement its constructor, as follows:
public Blackboard(){  entries = new List<BlackboardDatum>();  pastActions = new List<BlackboardAction>();  experts = new List<BlackboardExpert>();}
  1. Then, we can define the main class for each iteration, as shown in the following code:
public void RunIteration(){  // next steps}
  1. Next, we're going to add the required variables, as ...

Get Unity 2018 Artificial Intelligence Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.