public Experiment(DataInput dataInput, AnalyticMethod analyticMethodObj, InverseFunctionMethod inverseFunctionMethodObj, NeymanMethod neymanMethodObj, MetropolisMethod metropolisMethodObj) { this.dataInput = new DataInput(dataInput); this.analyticMethodObj = new AnalyticMethod(analyticMethodObj); this.inverseFunctionMethodObj = new InverseFunctionMethod(inverseFunctionMethodObj); this.neymanMethodObj = new NeymanMethod(neymanMethodObj); this.metropolisMethodObj = new MetropolisMethod(metropolisMethodObj); }
public NeymanMethod(NeymanMethod neymanMethod) { this.experimentsAmount = neymanMethod.experimentsAmount; this.partitionsAmount = neymanMethod.partitionsAmount; this.gamma = neymanMethod.gamma; this.intervalBegin = neymanMethod.intervalBegin; this.intervalEnd = neymanMethod.intervalEnd; this.x0 = neymanMethod.x0; this.intervalDelta = neymanMethod.intervalDelta; this.leftZone = neymanMethod.leftZone; this.rightZone = neymanMethod.rightZone; this.resultList = new List <double>(neymanMethod.resultList); this.intervalsList = new List <double>(neymanMethod.intervalsList); }
public void LoadExperimentsFromDB() { this.idList.Clear(); using (SQLiteConnection connection = new SQLiteConnection("Data Source=Experiments.sqlite3")) { connection.Open(); using (SQLiteCommand command = connection.CreateCommand()) { command.CommandText = "SELECT * FROM experiment;"; using (SQLiteDataReader reader = command.ExecuteReader()) { BinaryFormatter formatter = new BinaryFormatter(); this.experimentsList = new List <Experiment>(); while (reader.Read()) { using (MemoryStream ms = new MemoryStream((byte[])reader["metropolis"])) { ms.Seek(0, SeekOrigin.Begin); this.dataInput = new DataInput((DataInput)formatter.Deserialize(ms)); this.analyticMethod = new AnalyticMethod((AnalyticMethod)formatter.Deserialize(ms)); this.inverseFunctionMethod = new InverseFunctionMethod((InverseFunctionMethod)formatter.Deserialize(ms)); this.neymanMethod = new NeymanMethod((NeymanMethod)formatter.Deserialize(ms)); this.metropolisMethod = new MetropolisMethod((MetropolisMethod)formatter.Deserialize(ms)); this.idList.Add(int.Parse(reader["id"].ToString())); this.experimentsList.Add(new Experiment(dataInput, analyticMethod, inverseFunctionMethod, neymanMethod, metropolisMethod)); } } } } } this.FillListBox(); }