Example #1
0
 public EvalControlTestForm()
 {
     InitializeComponent();
     seed     = Environment.TickCount;
     type     = EvaluationGraphType.TrigonometricSigmoid;
     reverse  = false;
     evaldata = new EvaluationGraphData
     {
         data_array = new[]
         {
             new GameEvaluationData()
             {
                 values = new List <EvalValue>()
             },
             new GameEvaluationData()
             {
                 values = new List <EvalValue>()
             },
         },
         selectedIndex = -1,
         maxIndex      = 0,
         type          = type,
         reverse       = reverse,
     };
 }
Example #2
0
        private void UpdateData_Click(object sender, EventArgs e)
        {
            Console.WriteLine($"seed: {seed}");
            var rand     = new Random(seed++);
            var maxIndex = rand.Next(10, 300);

            evaldata = new EvaluationGraphData
            {
                data_array = new[]
                {
                    randomEval(rand, 0, maxIndex),
                    randomEval(rand, 1, maxIndex),
                    randomEval(rand, 2, maxIndex),
                    randomEval(rand, 3, maxIndex),
                    randomEval(rand, 4, maxIndex),
                    randomEval(rand, 5, maxIndex),
                    randomEval(rand, 6, maxIndex),
                },
                selectedIndex = rand.Next(-1, maxIndex),
                maxIndex      = maxIndex,
                type          = type,
                reverse       = reverse,
            };
            EvalUpdate(evaldata);
        }
Example #3
0
        public EvalGraphControl()
        {
            evaldata = new EvaluationGraphData()
            {
                data_array = new[]
                {
                    new GameEvaluationData()
                    {
                        values = new List <EvalValue>()
                    },
                    new GameEvaluationData()
                    {
                        values = new List <EvalValue>()
                    },
                },
                selectedIndex = -1,
                maxIndex      = 0,
                type          = EvaluationGraphType.TrigonometricSigmoid,
                reverse       = false,
            };

            playerColor = new[]
            {
                DColor.Red,
                DColor.Blue,
                DColor.Black,
                DColor.Green,
                DColor.Purple,
                DColor.Orange,
                DColor.YellowGreen,
            };

            {
                FontFamily[] ff = FontFamily.Families;
                fontFamilyName = FontFamily.GenericMonospace.Name;
                foreach (var n in new[] { "Consolas", "Inconsolata" })
                {
                    foreach (var f in ff)
                    {
                        if (f.Name == n)
                        {
                            fontFamilyName = f.Name;
                            goto fontLoopOut;
                        }
                    }
                }
                fontLoopOut :;
            }

            InitializeComponent();

            evalGraphPictureBox.Paint += Render;
        }
Example #4
0
        public EvalGraphControl()
        {
            evaldata = new EvaluationGraphData()
            {
                data_array = new[]
                {
                    new GameEvaluationData()
                    {
                        values = new List <EvalValue>()
                    },
                    new GameEvaluationData()
                    {
                        values = new List <EvalValue>()
                    },
                },
                selectedIndex = -1,
                maxIndex      = 0,
                type          = EvaluationGraphType.TrigonometricSigmoid,
                reverse       = false,
            };

            playerColor = new[]
            {
                DColor.Red,
                DColor.Blue,
                DColor.Black,
                DColor.Green,
                DColor.Purple,
                DColor.Orange,
                DColor.YellowGreen,
            };

            InitializeComponent();

            evalGraphPictureBox.Paint += Render;
        }
Example #5
0
 /// <summary>
 /// [UI thread] : リストが変更されたときに呼び出されるハンドラ
 /// </summary>
 public void OnEvalDataChanged(PropertyChangedEventArgs args)
 {
     evaldata    = args.value as EvaluationGraphData;
     scrollCheck = true;
     evalGraphPictureBox.Invalidate();
 }
Example #6
0
 public void EvalUpdate(EvaluationGraphData evaldata)
 {
     evalGraphControl1.OnEvalDataChanged(new PropertyChangedEventArgs("EvalData", evaldata));
 }