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(1800, ref seed1)).ToString();
- Geometric[i] = Convert.ToInt32(new Generator().Geometric(0.22, ref seed2)).ToString();
- Normal[i] = new Generator().Normal(300, 0.1, ref seed).ToString();
- }
- string pathDesktopGen = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
- string filePathGen = pathDesktopGen + "\\generators.csv";
- if (!File.Exists(filePathGen))
- {
- File.Create(filePathGen).Close();
- }
- string delimterGen = " ";
- System.Collections.Generic.List<string[]> outputGen = new System.Collections.Generic.List<string[]>();
- // outputGen.Add(Uniform);
- // outputGen.Add(Exponential);
- outputGen.Add(Geometric);
- //outputGen.Add(Normal);
- int length = outputGen.Count;
- using (System.IO.TextWriter writerGen = File.CreateText(filePathGen))
- {
- for (int index = 0; index < length; index++)
- {
- writerGen.WriteLine(string.Join(delimterGen, outputGen[index]));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement