public AbstractRandomGenerator()
            : base()
        {
            _buffer = new ArrayList();
            _useDefault = true;
            _configuration = new RandomConfiguration();
            _configuration.OnChange += new EventHandlerConfigurationChange(PropagateConfigurationChange);
            _configuration.DoOnChange();

            Initialize();
        }
        public bool Equals(IRandomConfiguration configuration)
        {
            bool test1 = true; // this.Seed.Equals(configuration.Seed);
            bool test2 = this.Capacity.Equals(configuration.Capacity);
            bool test3 = this.Max.Equals(configuration.Max);
            bool test4 = this.Min.Equals(configuration.Min);

            return (test1 & test2 & test3 & test4);
        }
 // CODE
 private void PropagateConfigurationChange(IRandomConfiguration configuration)
 {
     PurgeBuffer();
     //CheckNormalizationFactor();
 }
Exemplo n.º 4
0
 static FactoryRandom()
 {
     _defaultConfiguration = new RandomConfiguration(true);
     _defaultConfiguration.OnChange += new EventHandlerConfigurationChange(PropagateConfigurationChange);
     CheckDefaultGenerator();
 }
Exemplo n.º 5
0
        private static void PropagateConfigurationChange(IRandomConfiguration configuration)
        {
            int count = RandomRepository.Instance.Count();

            IRandomGenerator generator;
            for (int i = 0; i < count; i++)
            {
                generator = (IRandomGenerator)RandomRepository.Instance.getItem(i);
                generator.Configuration.DoOnChange();
            }
        }