protected override object InternalGenerateValue(long n, Collections.GeneratorParameterCollection paramas)
        {
            //    /// http://www.sqlservercentral.com/articles/SQL+Uniform+Random+Numbers/91103/
            ///// </summary>
            ///// <returns></returns>
            //[GeneratorMetaData(Generators.GeneratorMetaDataAttribute.GeneratorType.Integer)]
            //public static Generator CreateExponentialRandomNumbersGenerator()
            //{
            //    GeneratorParameterCollection paramss = new GeneratorParameterCollection();

            //    paramss.Add(new GeneratorParameter("Lambda", new decimal(1.1), GeneratorParameterParser.DecimalParser));

            //    Generator gen = new Generator(GENERATOR_ExponentialRandomNumbers, (n, p) =>
            //    {
            //        double Lambda = (double)p.GetValueOf<decimal>("Lambda");
            //        double URN1 = RandomSupplier.Instance.GetNextDouble();

            //        //-LOG(@URN)/@Lambda
            //        return -1.0 * (Math.Log(URN1) / Lambda);
            //    }
            //        , paramss);
            //    return gen;
            //}
            return(n);
        }
        protected override object InternalGenerateValue(long n, Collections.GeneratorParameterCollection paramas)
        {
            ///// <summary>
            ///// http://www.sqlservercentral.com/articles/SQL+Uniform+Random+Numbers/91103/
            ///// </summary>
            ///// <returns></returns>
            //[GeneratorMetaData(Generators.GeneratorMetaDataAttribute.GeneratorType.Integer)]
            //public static Generator CreateWeibullRandomNumbersGenerator()
            //{
            //    GeneratorParameterCollection paramss = new GeneratorParameterCollection();

            //    paramss.Add(new GeneratorParameter("Alpha", 1.1, GeneratorParameterParser.DecimalParser));
            //    paramss.Add(new GeneratorParameter("Beta", 1.1, GeneratorParameterParser.DecimalParser));

            //    Generator gen = new Generator(GENERATOR_WeibullRandomNumbers, (n, p) =>
            //    {
            //        double Alpha = (double)p.GetValueOf<decimal>("Alpha");
            //        double Beta = (double)p.GetValueOf<decimal>("Beta");
            //        double URN1 = (double)RandomSupplier.Instance.GetNextDecimal();

            //        //RETURN POWER((-1. / @Alpha) * LOG(1. - @URN), 1./@Beta)
            //        return Math.Pow((-1.0 / Alpha) * Math.Log(1.0 - URN1), 1.0 / Beta);
            //    }
            //        , paramss);
            //    return gen;
            //}
            return(n);
        }
        protected override object InternalGenerateValue(long n, Collections.GeneratorParameterCollection paramas)
        {
            ///// <summary>
            ///// http://www.sqlservercentral.com/articles/SQL+Uniform+Random+Numbers/91103/
            ///// </summary>
            ///// <returns></returns>
            //[GeneratorMetaData(Generators.GeneratorMetaDataAttribute.GeneratorType.Integer)]
            //public static Generator CreateNormallyDistributedRandomGenerator()
            //{
            //    GeneratorParameterCollection paramss = new GeneratorParameterCollection();

            //    paramss.Add(new GeneratorParameter("Mean", new decimal(1.1), GeneratorParameterParser.DecimalParser));
            //    paramss.Add(new GeneratorParameter("StDev", new decimal(1.1), GeneratorParameterParser.DecimalParser));

            //    Generator gen = new Generator(GENERATOR_NormallyDistributedRandomNumbers, (n, p) =>
            //    {
            //        double Mean = (double)p.GetValueOf<decimal>("Mean");
            //        double StDev = (double)p.GetValueOf<decimal>("StDev");
            //        double URN1 = RandomSupplier.Instance.GetNextDouble();
            //        double URN2 = RandomSupplier.Instance.GetNextDouble();

            //        return (StDev * Math.Sqrt(-2 * Math.Log(URN1)) * Math.Cos(2 * Math.Acos(-1.0) * URN2)) + Mean;
            //    }
            //        , paramss);
            //    return gen;
            //}
            return(n);
        }
Ejemplo n.º 4
0
        protected override object InternalGenerateValue(long n, Collections.GeneratorParameterCollection paramas)
        {
            //[GeneratorMetaData(Generators.GeneratorMetaDataAttribute.GeneratorType.Integer)]
            //public static Generator CreateSequentialForeignKeyGenerator(ObservableCollection<string> fkkeys)
            //{
            //    GeneratorParameterCollection paramss = new GeneratorParameterCollection();

            //    GeneratorParameter foreignParam = new GeneratorParameter("Keys", fkkeys, GeneratorParameterParser.ObjectParser, false);
            //    GeneratorParameter startIndex = new GeneratorParameter("Start Index", 1, GeneratorParameterParser.LonglParser);
            //    GeneratorParameter maxIndex = new GeneratorParameter("Max Index", 1000, GeneratorParameterParser.LonglParser);

            //    paramss.Add(foreignParam);
            //    paramss.Add(startIndex);
            //    paramss.Add(maxIndex);

            //    Generator gen = new Generator(GENERATOR_SequentialFOREIGNKEYValueEAGER, (n, p) =>
            //    {
            //        ObservableCollection<string> keys = p.GetValueOf<ObservableCollection<string>>("Keys");
            //        if (keys == null || keys.Count == 0)
            //            throw new ArgumentException("There are no foreign keys in the table that this column references");

            //        int si = p.GetValueOf<int>("Start Index");
            //        int mi = p.GetValueOf<int>("Max Index");
            //        if (mi > fkkeys.Count)
            //        {
            //            mi = fkkeys.Count;
            //        }
            //        return keys[n.LongToInt() % keys.Count];
            //    }
            //        , paramss);
            //    return gen;
            //}
            return(n);
        }
Ejemplo n.º 5
0
        protected override object InternalGenerateValue(long n, Collections.GeneratorParameterCollection paramas)
        {
            decimal step       = paramas.GetValueOf <Decimal>("Step");
            decimal startValue = paramas.GetValueOf <Decimal>("StartValue");

            return(startValue + (step * (n - 1)));
        }
Ejemplo n.º 6
0
 protected override object InternalGenerateValue(long n, Collections.GeneratorParameterCollection paramas)
 {
     //public static Generator CreateSqlServerIdentityGenerator()
     //{
     //    Generator gen = new Generator(GENERATOR_IdentityFromSqlServerGenerator, (n, p) =>
     //    {
     //        return "123467890";
     //    }
     //        , null);
     //    return gen;
     //}
     return(n);
 }
Ejemplo n.º 7
0
        protected override object InternalGenerateValue(long n, Collections.GeneratorParameterCollection paramas)
        {
            //[GeneratorMetaData(Generators.GeneratorMetaDataAttribute.GeneratorType.Integer)]
            //public static Generator CreateStaticNumberGenerator()
            //{
            //    GeneratorParameterCollection paramss = new GeneratorParameterCollection();

            //    paramss.Add(new GeneratorParameter("Number", 0, GeneratorParameterParser.LonglParser));

            //    Generator gen = new Generator(GENERATOR_StaticNumber, (n, p) =>
            //    {
            //        long value = p.GetValueOf<long>("Number");

            //        return value;
            //    }
            //        , paramss);
            //    return gen;
            //}
            return(n);
        }
        protected override object InternalGenerateValue(long n, Collections.GeneratorParameterCollection paramas)
        {
            //     [GeneratorMetaData(Generators.GeneratorMetaDataAttribute.GeneratorType.General)]
            //protected static Generator CreateQueryGenerator()
            //{
            //    GeneratorParameterCollection paramss = new GeneratorParameterCollection();

            //    paramss.Add(new GeneratorParameter("Query", "select ...", GeneratorParameterParser.StringParser));

            //    Generator gen = new Generator(GENERATOR_CustomSQLQuery, (n, p) =>
            //    {
            //        string value = p.GetValueOf<String>("Query");

            //        return string.Format("({0})", value);
            //    }
            //        , paramss, true);
            //    return gen;
            //}
            return(n);
        }
Ejemplo n.º 9
0
        protected override object InternalGenerateValue(long n, Collections.GeneratorParameterCollection paramas)
        {
            //[GeneratorMetaData(Generators.GeneratorMetaDataAttribute.GeneratorType.Integer)]
            //public static Generator CreateRandomIntGenerator(long min, long max)
            //{
            //    GeneratorParameterCollection paramss = new GeneratorParameterCollection();

            //    paramss.Add(new GeneratorParameter("MinValue", min, GeneratorParameterParser.LonglParser));
            //    paramss.Add(new GeneratorParameter("MaxValue", max, GeneratorParameterParser.LonglParser));

            //    Generator gen = new Generator(GENERATOR_RandomInt, (n, p) =>
            //        {
            //            long maxValue = p.GetValueOf<long>("MaxValue");
            //            long minValue = p.GetValueOf<long>("MinValue");

            //            return (RandomSupplier.Instance.GetNextInt() % maxValue) + minValue; ;
            //        }
            //        , paramss);
            //    return gen;
            //}
            return(n);
        }
        protected override object InternalGenerateValue(long n, Collections.GeneratorParameterCollection paramas)
        {
            int l = paramas.GetValueOf <int>("Length");

            return(Names[n.LongToInt() % Names.Count].SubstringWithMaxLength(l));
        }
Ejemplo n.º 11
0
 protected override object InternalGenerateValue(long n, Collections.GeneratorParameterCollection paramas)
 {
     return(paramas.GetValueOf <string>("Value"));
 }
        protected override object InternalGenerateValue(long n, Collections.GeneratorParameterCollection paramas)
        {
            int l = paramas.GetValueOf <int>("Length");

            return(paramas.GetValueOf <string>("Value").SubstringWithMaxLength(l));
        }
Ejemplo n.º 13
0
 protected override object InternalGenerateValue(long n, Collections.GeneratorParameterCollection paramas)
 {
     return((RandomSupplier.Instance.GetNextDecimal() * decimal.MaxValue));
 }