Ejemplo n.º 1
0
        /// <summary>
        /// This method initializes the dimension-value pairs and declarative chunks in the <see cref="World"/>
        /// </summary>
        static void InitializeWorld(Agent a)
        {
            //Initialize the dimension-value pairs
            for (int i = 1; i <= nodeCount; i++)
            {
                dvs.Add(World.NewDistributedDimensionValuePair(a, i));
            }

            //Initializes the declarative chunks
            for (int i = 0; i < patterns.Length; i++)
            {
                //Generates a declarative chunk and specifies that the semantic label associated with the declarative chunk should NOT be added to the
                //dimension-value pairs of that chunk
                DeclarativeChunk dc =
                    World.NewDeclarativeChunk(i, addSemanticLabel: false);

                //Adds the appropriate dimension-value pairs (as indicated by the "patterns" array) for each declarative chunk pattern representation
                foreach (var dv in dvs)
                {
                    if (patterns[i].Contains(dv.Value))
                    {
                        dc.Add(dv);
                    }
                }

                //Adds the declarative chunk to the chunks list
                chunks.Add(dc);
            }
        }
Ejemplo n.º 2
0
        static void InitializeWorld()
        {
            string feature = " ";

            //Initialize the dimension-value pairs
            for (int i = 1; i <= nodeCount; i++)
            {
                //features for DV pairs
                if (i == 1)
                {
                    feature = "wings";
                }
                else if (i == 2)
                {
                    feature = "beaks";
                }
                else if (i == 3)
                {
                    feature = "lays eggs";
                }
                else if (i == 4)
                {
                    feature = "bird";
                }
                else if (i == 5)
                {
                    feature = "flies south for winter";
                }
                else if (i == 6)
                {
                    feature = "eats berries";
                }
                else if (i == 7)
                {
                    feature = "eats plants (grass)";
                }
                else if (i == 8)
                {
                    feature = "swims";
                }
                else if (i == 9)
                {
                    feature = "builds nests";
                }
                else if (i == 10)
                {
                    feature = "small";
                }
                else if (i == 11)
                {
                    feature = "big";
                }
                else if (i == 12)
                {
                    feature = "red";
                }
                else if (i == 13)
                {
                    feature = "blue";
                }
                else if (i == 14)
                {
                    feature = "yellow";
                }
                else if (i == 15)
                {
                    feature = "brownish";
                }

                dvs.Add(World.NewDimensionValuePair(feature, i));
            }

            //Initializes the declarative chunks
            for (int i = 0; i < patterns.Length; i++)
            {
                //Generates a declarative chunk
                string bird_name = " ";
                if (i == 0)
                {
                    bird_name = "robin";
                }
                else if (i == 1)
                {
                    bird_name = "sparrow";
                }
                else if (i == 2)
                {
                    bird_name = "goose";
                }

                DeclarativeChunk dc =
                    World.NewDeclarativeChunk(bird_name, addSemanticLabel: false);

                //Adds the appropriate dimension-value pairs (as indicated by the "patterns" array) for each declarative chunk pattern representation
                foreach (var dv in dvs)
                {
                    if (patterns[i].Contains(dv.Value))
                    {
                        dc.Add(dv);
                    }
                }

                //Adds the declarative chunk to the chunks list
                chunks.Add(dc);
            }
        }
Ejemplo n.º 3
0
        static void InitializeWorld()
        {
            string feature = " ";

            //Initialize the dimension-value pairs
            for (int i = 1; i <= nodeCount; i++)
            {
                //names for features
                if (i == 1)
                {
                    feature = "lactates";
                }
                else if (i == 2)
                {
                    feature = "hair/fur";
                }
                else if (i == 3)
                {
                    feature = "warm-blooded";
                }
                else if (i == 4)
                {
                    feature = "teeth";
                }
                else if (i == 5)
                {
                    feature = "tails";
                }
                else if (i == 6)
                {
                    feature = "lives on land";
                }
                else if (i == 7)
                {
                    feature = "omnivores";
                }
                else if (i == 8)
                {
                    feature = "herbivores";
                }
                else if (i == 9)
                {
                    feature = "carnivores";
                }
                else if (i == 10)
                {
                    feature = "small";
                }
                else if (i == 11)
                {
                    feature = "large";
                }
                else if (i == 12)
                {
                    feature = "something";
                }
                else if (i == 13)
                {
                    feature = "wild";
                }
                else if (i == 14)
                {
                    feature = "domesticated";
                }
                else if (i == 15)
                {
                    feature = "swims";
                }
                else if (i == 16)
                {
                    feature = "horns";
                }

                dvs.Add(World.NewDimensionValuePair(feature, i));
            }

            //Initializes the declarative chunks
            for (int i = 0; i < patterns.Length; i++)
            {
                //Generates a declarative chunk
                string mammal_name = " ";
                if (i == 0)
                {
                    mammal_name = "mammal";
                }
                else if (i == 1)
                {
                    mammal_name = "hippo";
                }
                else if (i == 2)
                {
                    mammal_name = "rhino";
                }
                else if (i == 3)
                {
                    mammal_name = "hamster";
                }

                DeclarativeChunk dc =
                    World.NewDeclarativeChunk(mammal_name, addSemanticLabel: false);

                //Adds the appropriate dimension-value pairs (as indicated by the "patterns" array) for each declarative chunk pattern representation
                foreach (var dv in dvs)
                {
                    if (patterns[i].Contains(dv.Value))
                    {
                        dc.Add(dv);
                    }
                }

                //Adds the declarative chunk to the chunks list
                chunks.Add(dc);
            }
        }
Ejemplo n.º 4
0
        static void InitializeWorld()
        {
            string feature = " ";

            //Initializes the dimension-value pairs
            for (int i = 1; i <= nodeCount; i++)
            {
                if (i == 1)
                {
                    feature = "wings";
                }
                else if (i == 2)
                {
                    feature = "flippers";
                }
                else if (i == 3)
                {
                    feature = "beaks";
                }
                else if (i == 4)
                {
                    feature = "lays eggs";
                }
                else if (i == 5)
                {
                    feature = "migrates in winter";
                }
                else if (i == 6)
                {
                    feature = "eats bugs and berries";
                }
                else if (i == 7)
                {
                    feature = "eats fish";
                }
                else if (i == 8)
                {
                    feature = "builds nests";
                }
                else if (i == 9)
                {
                    feature = "flies";
                }
                else if (i == 10)
                {
                    feature = "swims";
                }
                else if (i == 11)
                {
                    feature = "feathers";
                }
                else if (i == 12)
                {
                    feature = "colorful";
                }
                else if (i == 13)
                {
                    feature = "lives in trees";
                }
                else if (i == 14)
                {
                    feature = "lives in the polar regions";
                }

                dvs.Add(World.NewDimensionValuePair(feature, i));
            }

            //Initializes the declarative chunks
            for (int i = 0; i < patterns.Length; i++)
            {
                //Generates a declarative chunk
                string bird_name = " ";
                if (i == 0)
                {
                    bird_name = "birds";
                }
                else if (i == 1)
                {
                    bird_name = "robins";
                }
                else if (i == 2)
                {
                    bird_name = "penguins";
                }

                DeclarativeChunk dc =
                    World.NewDeclarativeChunk(bird_name, addSemanticLabel: false);

                //Adds the appropriate dimension-value pairs (as indicated by the "patterns" array) for each declarative chunk pattern representation
                foreach (var dv in dvs)
                {
                    if (patterns[i].Contains(dv.Value))
                    {
                        dc.Add(dv);
                    }
                }

                //Adds the declarative chunk to the chunks list
                chunks.Add(dc);
            }
        }