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(); }
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); } }
private void cmClearBoxes(object sender, RoutedEventArgs e) { Boxes = new TBoxes(Pole.NN); StoreBox(); }