예제 #1
0
        public THopfield(TBoxes Boxes)
        {
            this.Boxes = Boxes;

            N = Boxes.N;
            M = Boxes.Count;

            w = new double[N, N];

            for (int i = 0; i < N; i++)
            {
                for (int j = 0; j < N; j++)
                {
                    w[i, j] = 0;
                }
            }

            Learning();
        }
예제 #2
0
        void LoadBox()
        {
            BinaryFormatter formatter = new BinaryFormatter();

            if (File.Exists(FName))
            {
                using (FileStream fs = new FileStream(FName, FileMode.OpenOrCreate))
                {
                    Boxes = (TBoxes)formatter.Deserialize(fs);
                }

                if (Boxes.NN == Pole.NN)
                {
                    return;
                }
            }

            Boxes = new TBoxes(Pole.NN);

            using (FileStream fs = new FileStream(FName, FileMode.OpenOrCreate))
            {
                formatter.Serialize(fs, Boxes);
            }
        }
예제 #3
0
        private void cmClearBoxes(object sender, RoutedEventArgs e)
        {
            Boxes = new TBoxes(Pole.NN);

            StoreBox();
        }