Beispiel #1
0
        /// <summary>
        /// Sets up the associative rules in the top level of the NACS
        /// </summary>
        /// <param name="reasoner">The agent in whose NACS the rules are being placed</param>
        static void SetupRules(Agent reasoner)
        {
            //Iterates through each of the chunks (except the last one, for obvious reasons) and creates an associative rule using that chunk as the
            //condition, and the next chunk in the chunks list as the conclusion.
            for (int i = 0; i < chunks.Count - 1; i++)
            {
                //Initializes the rule
                RefineableAssociativeRule ar =
                    AgentInitializer.InitializeAssociativeRule(reasoner,
                                                               RefineableAssociativeRule.Factory, chunks[i + 1]);

                //Specifies that the current chunk must be activated as part of the condition for the rule
                ar.GeneralizedCondition.Add(chunks[i], true);

                //Commits the rule
                reasoner.Commit(ar);
            }
        }