Пример #1
0
        double x, y; //ant location

        #endregion Fields

        #region Constructors

        //used in land mines case
        public Ants(Size ClientSize, Cosmos MyWorld, Array weights, int AntNumber)
        {
            clientSize = ClientSize;
            myWorld = MyWorld;
            x = Cosmos.randomR.Next(clientSize.Width);
            y = Cosmos.randomR.Next(clientSize.Height);
            dir = (float)(Cosmos.randomR.NextDouble());
            net = new Network(4, 1, 6, 2);  //initialize network and weights
            if (weights != null)
                this.net.Weights = weights;

            antNumber = AntNumber;
            startPosition = new PointF((float)x, (float)y);
            finishPosition = startPosition;
        }