/// <summary> /// Initializes a new instance of the <see cref="MeshXT2"/> class. /// while specifying the seed, generator and distribution to use as well as the /// parameters for the distribution alpha corrosponds to p the amount of error in the /// distribution generally smaller means less variance /// </summary> /// <param name="seed">Seed.</param> /// <param name="genx">Genx.</param> /// <param name="distx">Distx.</param> /// <param name="args">Arguments.</param> public MeshXT2(int seed, generators genx, distributions distx, Dictionary <string, double> args) { if (Camera.mainCamera.gameObject.GetComponent <MeshXTinternal>() == null) { internalObj = Camera.mainCamera.gameObject.AddComponent <MeshXTinternal> (); } else { internalObj = Camera.mainCamera.gameObject.GetComponent <MeshXTinternal>(); } setGenerator(seed, genx); setDistribution(distx, args); }
/// <summary> /// Sets the generator does not reset the generator the distribution is using to the new /// generator if only using a generator this is the only thing you need to call /// </summary> /// <param name="seed">Seed.</param> /// <param name="genx">Genx.</param> public void setGenerator(int seed, generators genx) { switch (genx) { case generators.MT19937: gen = new MT19937Generator(seed); break; case generators.ALF: gen = new ALFGenerator(seed); break; case generators.Standard: gen = new StandardGenerator(seed); break; case generators.XorShift: gen = new XorShift128Generator(seed); break; } }
public MeshXT2(int seed, generators genx) : this(seed, genx, MeshXT2.distributions.None, null) { }