public void Makeinstance() { if (instance == null) { instance = this; } }
private void Awake() { ReadData(); RandomNumberGen.Initialize(); randomItem1 = new RandomItem(item.Length - 1); }
void Start() { randomNumberGen = GetComponent <RandomNumberGen> (); timer = maxTimer; for (int i = 0; i < randomNumberGen.getText.Count; i++) { dots.Add(i); } }
protected Layer(NeuralNetwork neuralNetwork) { this.neuralNetwork = neuralNetwork; neuralNetwork.Layers.Add(this); LayerCount++; this.LayerNum = LayerCount; this.learningRate = neuralNetwork.LearningRate; this.activation = new Function(); this.randNumGen = new RandomNumberGen(0, 1); }
private void Awake() { time = System.Environment.TickCount; seed = time + Name.GetHashCode(); if (random == null) { random = new RandomNumberGen(); } if (UseGeneratedSeed) { random.SetSeed((int)seed); } }
/// <summary> /// /// </summary> /// <param name="relativePosition">Offset addition from this point</param> /// <param name="rMax"></param> /// <param name="nPlots"></param> /// <returns></returns> private List <IReferencePoint> GenerateRandomPlots(PointF relativePosition, double rMax, int nPlots) { var randPlots = new List <IReferencePoint>(); for (int i = 0; i < nPlots; i++) { var randomRange = RandomNumberGen.NextDouble() * rMax; var randomBearing = RandomNumberGen.Next(360); var contactType = GetRandomContactType(); var altitude = contactType.ToString().Contains("Air") || contactType.ToString().Contains("Missile") ? RandomNumberGen.Next(50000) : 0.00; var speed = contactType.ToString().Contains("Air") ? RandomNumberGen.Next(300, 10000) : contactType.ToString().Contains("Missile") ? RandomNumberGen.Next(3000, 100000) : RandomNumberGen.Next(50); var heading = RandomNumberGen.Next(360); var polarPosition = new PolarCoordinate(randomBearing, randomRange); var newContact = CreateContactAtPolarCoordinate(relativePosition, contactType, polarPosition, heading, speed, altitude); Logger.Info($"Adding contact: {newContact} as a random contact."); randPlots.Add(newContact); } return(randPlots); }
void RandomDropItem() { RandomNumberGen.Initialize(); randomItem1.Random(); randomItem = randomItem1.GetItem; }
private ContactTypes GetRandomContactType() { var contactTypes = Enum.GetValues(typeof(ContactTypes)); return((ContactTypes)contactTypes.GetValue(RandomNumberGen.Next(contactTypes.Length - 2))); }
///<summary> /// ///</summary> public Neuron() { Bias = RandomNumberGen.PseudoRandomNumber(Environment.TickCount); Dendrites = new List <Dendrite>(); }
///<summary> /// Constructor ///</summary> public Dendrite() { Weight = RandomNumberGen.CryptoRandomNumber(); }