示例#1
0
 protected override void OnStart()
 {
     if (File.Exists(this.BrainFile))
     {
         _model = Model.Load(this.BrainFile);
     }
     else
     {
         _model = new Model();
     }
 }
示例#2
0
 public void Clear()
 {
     _model = null;
     _model = new Model();
 }
示例#3
0
        public static Model Load(string fileName)
        {
            Model m = new Model();

            using (FileStream fs = File.OpenRead(fileName))
            {
                BinaryReader br = new BinaryReader(fs);
                m._dict.Load(br);
                m._forward->Read(br);
                m._backward->Read(br);
                br.Close();
                fs.Close();
                return m;
            }
        }