public void PQN_Method(int state_nubmer, int period_length, int stop, Mode mode, PRNGMode rndMode) { int L = Ro[state_nubmer].Length; double[] p = new double[period_length];//вероятность ошибки в момент j double[] Fi; if (IfExistsVarPhi(state_nubmer, period_length)) { Fi = VarPhi[state_nubmer][period_length - 1]; } else { Fi = integral(Ro[state_nubmer], L, period_length); VarPhi[state_nubmer][period_length - 1] = Fi; } for (int j = 0; j < period_length; j++) { p[j] = Fi[j] * Per[state_nubmer] * period_length; //Console.WriteLine(p[j].ToString()); } int k = 0; double[] PSmb = MatrToArr(B, state_nubmer);//должен вернуть массив из элементов строки с номером state_nubmer матрицы B while (k < stop) { int OP = BinaryProbabilityMethod(p[k], rndMode); int Prob; if (OP == 1) { Prob = ProbabilityMethod(PSmb, rndMode) + 1; } else { Prob = 0; } OutStreamer OutStream = new OutStreamer("res.txt"); OutStream.SymbolToFile(Prob); if (mode == HSMPQApplication.Mode.Test) { OutStreamer SostStream = new OutStreamer("sost.txt"); SostStream.SymbolToFile(state_nubmer); } k++; } }
public void PQN_Method(int state_nubmer, int period_length, int stop, Mode mode, PRNGMode rndMode) { double[] p = new double[period_length];//вероятность ошибки в момент j int k = 0; double[] PSmb = MatrToArr(B, state_nubmer);//должен вернуть массив из элементов строки с номером state_nubmer матрицы B while (k < stop) { int Prob; Prob = ProbabilityMethod(PSmb, rndMode); OutStreamer OutStream = new OutStreamer("res.txt"); OutStream.SymbolToFile(Prob); if (mode == HSMPQApplication.Mode.Test) { OutStreamer SostStream = new OutStreamer("sost.txt"); SostStream.SymbolToFile(state_nubmer); } k++; } }