Ejemplo n.º 1
0
        /// <summary>
        /// Save the network
        /// </summary>
        /// <param name="Net">The network to save</param>
        private static void SaveNet(network_scaler Net, string FilePath)
        {
            FileStream      fs        = new FileStream(FilePath, FileMode.Create);
            BinaryFormatter formatter = new BinaryFormatter();

            formatter.Serialize(fs, Net);
            fs.Close();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Load a network
        /// </summary>
        /// <param name="FilePath">The path to the binary network file</param>
        /// <returns></returns>
        private static network_scaler LoadNet(string FilePath)
        {
            FileStream      fs        = new FileStream(FilePath, FileMode.Open);
            BinaryFormatter formatter = new BinaryFormatter();
            network_scaler  net       = (network_scaler)formatter.Deserialize(fs);

            fs.Close();
            return(net);
        }
Ejemplo n.º 3
0
        private void btn_samplein_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            OpenFileDialog file1 = new OpenFileDialog();

            file1.Filter = "文本文件|*.pdi";
            if (file1.ShowDialog() == DialogResult.OK)
            {
                net_scaler = LoadNet(file1.FileName);
                network    = net_scaler.network;
                sclarer    = net_scaler.sclarer;
            }
        }