Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void GeneratorTest(){
- int seed = 17389;
- int seed1 = 13963;
- int seed2 = 10457;
- string[] Uniform = new string[10000];
- string[] Exponential = new string[10000];
- string[] Geometric = new string[10000];
- string[] Normal = new string[10000];
- for (int i = 0; i < 10000; i++)
- {
- //Console.WriteLine( 500.0 + new Generator().UniformZO(ref seed) * (2500.0 - 500.0));
- Uniform[i] = Convert.ToInt32(new Generator().UniformAB(100, 200, ref seed)).ToString();
- Exponential[i] = Convert.ToInt32(new Generator().Exponential(0.0011, ref seed1)).ToString();
- Geometric[i] = Convert.ToInt32(new Generator().Geometric(0.22, ref seed2)).ToString();
- Normal[i] = new Generator().Normal(300, 0.001, ref seed).ToString();
- }
- string pathDesktop = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
- string filePath = pathDesktop + "\\generators.csv";
- if (!File.Exists(filePath))
- {
- File.Create(filePath).Close();
- }
- string delimter = " ";
- System.Collections.Generic.List<string[]> output = new System.Collections.Generic.List<string[]>();
- output.Add(Uniform);
- output.Add(Exponential);
- output.Add(Geometric);
- output.Add(Normal);
- int length = output.Count;
- using (System.IO.TextWriter writer = File.CreateText(filePath))
- {
- for (int index = 0; index < length; index++)
- {
- writer.WriteLine(string.Join(delimter, output[index]));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement