Пример #1
0
        public static void Init(FSMForm f)
        {
            form = f;
            picPlane = form.getPicPlane();
            lstStates = form.getLstStates();
            txtDist = form.getTxtDist();
            txtLrnSteps = form.getTxtLrnSteps();
            X = new PosInfo(25, 0, picPlane.Size.Width, picPlane.Size.Width / 2);
            Y = new PosInfo(25, 0, picPlane.Size.Height, picPlane.Size.Height / 2);

            Reset();
        }
Пример #2
0
        public static void Test(FSMForm form)
        {
            TextBox txtLrnSteps = form.getTxtLrnSteps();
            int a;
            int[] steps = new int[100000];
            int[] distr = new int[13];
            for(int i = 0; i < 13; i++)
                distr[i] = 0;

            Logic.ChangeDelay(0, 0);
            for (int i = 0; i < 100000; i++)
            {
                new Target(4, 4); new Target(-4, -4);
                curRob.ReachTargetsAddOrder(Target.tarList);
                a = Convert.ToInt32(txtLrnSteps.Text);
                steps[i] = a;
                distr[a - 4]++;
                Reset();
            }
            Logic.ChangeDelay(600, 300);

            string strDistr = "";
            for (int i = 0; i < 13; i++)
                strDistr += distr[i] + "; ";

            MessageBox.Show("Average is" + steps.Average().ToString() + "\n" + strDistr);
        }