Exemplo n.º 1
0
 public Form1()
 {
     InitializeComponent();
     buttons = new Button[9] { this.field0, this.field1, this.field2, this.field3, this.field4, this.field5, this.field6, this.field7, this.field8 };
     Game = new TicTacToe(this);
     this.NeuralNetwork = new Network(30, 2, 2, 1);
     ifc = new interfaceNetworkGame(this.Game, this.NeuralNetwork);
 }
Exemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            objNetwork = new Network(this);

            // Initialize data packet
            data[0] = (byte)player.none;    //NW
            data[1] = (byte)player.none;    //N
            data[2] = (byte)player.none;    //NE
            data[3] = (byte)player.none;    //W
            data[4] = (byte)player.none;    //Cen
            data[5] = (byte)player.none;    //E
            data[6] = (byte)player.none;    //SW
            data[7] = (byte)player.none;    //S
            data[8] = (byte)player.none;    //SE
            data[9] = (byte)player.X;    //turn
            data[10] = (byte) turn_num;   //turn_num
        }
Exemplo n.º 3
0
 public interfaceNetworkGame(TicTacToe Game, Network Net)
 {
     this.Game = Game;
     this.Net = Net;
     field = new float[18];
     output = new float[9];
 }
Exemplo n.º 4
0
 private void loadNetwork_Click(object sender, EventArgs e)
 {
     System.Xml.Serialization.XmlSerializer mySerializer = new System.Xml.Serialization.XmlSerializer(typeof(Network));
     System.IO.FileStream myFileStream = new System.IO.FileStream("serializedNetwork.xml", System.IO.FileMode.Open);
     this.NeuralNetwork = (Network)mySerializer.Deserialize(myFileStream);
     myFileStream.Close();
 }