public void BlauSpaceSerializationTest() { Console.WriteLine("BlauSpaceSerializationTest"); int dim = 3; string [] names = new string [3] { "x", "y", "z" }; double [] mins = new double [3] { 0.0, 0.0, 0.0 }; double [] maxs = new double [3] { 100.0, 200.0, 300.0 }; IBlauSpace bs = BlauSpace.create(dim, names, mins, maxs); FileStream fs = new FileStream("bs.xml", FileMode.Create); SoapFormatter formatter = new SoapFormatter(); formatter.Serialize(fs, bs); fs.Flush(); fs.Close(); SingletonLogger.Instance().DebugLog(typeof(blau_tests), "bs => " + bs.ToString()); FileStream fs2 = new FileStream("bs.xml", FileMode.Open); BlauSpace bs2 = (BlauSpace)formatter.Deserialize(fs2); fs2.Close(); SingletonLogger.Instance().DebugLog(typeof(blau_tests), "bs2 => " + bs2.ToString()); IBlauSpace bs3 = BlauSpaceRegistry.Instance().validate(bs2); Assert.AreEqual(bs == bs3, true); SingletonLogger.Instance().DebugLog(typeof(blau_tests), "bs agrees with validated bs2"); Assert.AreEqual(bs == bs2, true); SingletonLogger.Instance().DebugLog(typeof(blau_tests), "bs agrees with bs2"); }
internal void register(StreamingContext context) { this._space = BlauSpaceRegistry.Instance().validate(this._space); }
internal void register(StreamingContext context) { SingletonLogger.Instance().DebugLog(typeof(Distribution_Sequential), "Sequential OnDeserialized ..."); this._space = BlauSpaceRegistry.Instance().validate(this._space); _current = new BlauPoint(this.SampleSpace); }
internal void register(StreamingContext context) { SingletonLogger.Instance().DebugLog(typeof(Distribution_Pointed), "PointedImmutable OnDeserialized ..."); this._space = BlauSpaceRegistry.Instance().validate(this._space); }