public void Makeinstance()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Esempio n. 2
0
    private void Awake()
    {
        ReadData();

        RandomNumberGen.Initialize();
        randomItem1 = new RandomItem(item.Length - 1);
    }
Esempio n. 3
0
 void Start()
 {
     randomNumberGen = GetComponent <RandomNumberGen> ();
     timer           = maxTimer;
     for (int i = 0; i < randomNumberGen.getText.Count; i++)
     {
         dots.Add(i);
     }
 }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
 private void Awake()
 {
     time = System.Environment.TickCount;
     seed = time + Name.GetHashCode();
     if (random == null)
     {
         random = new RandomNumberGen();
     }
     if (UseGeneratedSeed)
     {
         random.SetSeed((int)seed);
     }
 }
Esempio n. 6
0
        /// <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);
        }
Esempio n. 7
0
 void RandomDropItem()
 {
     RandomNumberGen.Initialize();
     randomItem1.Random();
     randomItem = randomItem1.GetItem;
 }
Esempio n. 8
0
        private ContactTypes GetRandomContactType()
        {
            var contactTypes = Enum.GetValues(typeof(ContactTypes));

            return((ContactTypes)contactTypes.GetValue(RandomNumberGen.Next(contactTypes.Length - 2)));
        }
Esempio n. 9
0
        ///<summary>
        ///
        ///</summary>
        public Neuron()
        {
            Bias = RandomNumberGen.PseudoRandomNumber(Environment.TickCount);

            Dendrites = new List <Dendrite>();
        }
Esempio n. 10
0
 ///<summary>
 /// Constructor
 ///</summary>
 public Dendrite()
 {
     Weight = RandomNumberGen.CryptoRandomNumber();
 }