示例#1
0
        /// <summary>
        /// Checks to see if the specified bee has discovered a potential nest site
        /// </summary>
        /// <param name="b">The bee we are currently checking</param>
        //private void CheckSearcher(Bee b) {
        //    foreach (Site s in potentialSites) {
        //        if (b.HasReachedDestination(s.Point)) {
        //            s.Visited = true;
        //            b.FoundSite(s);
        //        }
        //    }
        //}

        private void CheckSearcher(Bee b)
        {
            foreach (Site s in potentialSites)
            {
                if (!s.Visited && b.IsExploring())
                {
                    if (b.HasReachedDestination(s.Point))
                    {
                        s.Visited = true;
                        b.FoundSite(s);
                    }
                }
            }
        }
示例#2
0
        public static void CreateBeesTest(int scoutCount, Site site)
        {
            scoutBees.Clear();

            Bee.State[] states = { Bee.State.EXPLORING, Bee.State.OBSERVING, Bee.State.RESTING, Bee.State.ASSESSING, Bee.State.DANCING };

            //            R   O   E   A   D
            int[] test = { 20, 20, 60, 0, 0 };

            for (int i = 0; i < test[0]; i++)
            {
                Bee newBee = new Bee(Constants.DESTINATION_RADIUS, rand, Bee.State.EXPLORING);
                scoutBees.Add(newBee);
            }
            for (int i = 0; i < test[1]; i++)
            {
                Bee newBee = new Bee(Constants.DESTINATION_RADIUS, rand, Bee.State.OBSERVING);
                scoutBees.Add(newBee);
            }
            for (int i = 0; i < test[2]; i++)
            {
                Bee newBee = new Bee(Constants.DESTINATION_RADIUS, rand, Bee.State.RESTING);
                scoutBees.Add(newBee);
            }
            for (int i = 0; i < test[3]; i++)
            {
                Bee newBee = new Bee(Constants.DESTINATION_RADIUS, rand, Bee.State.ASSESSING);
                newBee.FoundSite(site);
                scoutBees.Add(newBee);
            }
            for (int i = 0; i < test[4]; i++)
            {
                Bee newBee = new Bee(Constants.DESTINATION_RADIUS, rand, Bee.State.DANCING);
                newBee.setSite(site);
                scoutBees.Add(newBee);
            }
        }
示例#3
0
        public static void CreateBeesTest(int scoutCount, Site site) 
        {
            scoutBees.Clear();

            Bee.State[] states = { Bee.State.EXPLORING, Bee.State.OBSERVING, Bee.State.RESTING, Bee.State.ASSESSING, Bee.State.DANCING };

            //            R   O   E   A   D
            int[] test = {20, 20, 60, 0, 0};

            for (int i = 0; i < test[0]; i++) {
                Bee newBee = new Bee(Constants.DESTINATION_RADIUS, rand, Bee.State.EXPLORING);
                scoutBees.Add(newBee);
            }
            for (int i = 0; i < test[1]; i++) {
                Bee newBee = new Bee(Constants.DESTINATION_RADIUS, rand, Bee.State.OBSERVING);
                scoutBees.Add(newBee);
            }
            for (int i = 0; i < test[2]; i++) {
                Bee newBee = new Bee(Constants.DESTINATION_RADIUS, rand, Bee.State.RESTING);
                scoutBees.Add(newBee);
            }
            for (int i = 0; i < test[3]; i++) {
                Bee newBee = new Bee(Constants.DESTINATION_RADIUS, rand, Bee.State.ASSESSING);
                newBee.FoundSite(site);
                scoutBees.Add(newBee);
            }
            for (int i = 0; i < test[4]; i++) {
                Bee newBee = new Bee(Constants.DESTINATION_RADIUS, rand, Bee.State.DANCING);
                newBee.setSite(site);
                scoutBees.Add(newBee);
            }

        }
示例#4
0
        /// <summary>
        /// Checks to see if the specified bee has discovered a potential nest site
        /// </summary>
        /// <param name="b">The bee we are currently checking</param>
        //private void CheckSearcher(Bee b) {
        //    foreach (Site s in potentialSites) {
        //        if (b.HasReachedDestination(s.Point)) {
        //            s.Visited = true;
        //            b.FoundSite(s);
        //        }
        //    }
        //}

        private void CheckSearcher(Bee b) {
            foreach (Site s in potentialSites) {
                if (!s.Visited && b.IsExploring()) {
                    if (b.HasReachedDestination(s.Point)) {
                        s.Visited = true;
                        b.FoundSite(s);
                    }
                }
            }
        }