/**
  * generates a random attribute, taking into account its desidered type = {string,double,int}
  */
 public Attribute generate()
 {
     MyRandom r = new MyRandom();
     switch (type)
     {
         case AttributeType.STRING:
             string a = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
             value_string = a[(int)r.Next(49)].ToString();
             value_string += a[(int)r.Next(6, 26)];
             value_string += a[(int)r.Next(9, 18)];
             value_string += a[(int)r.Next(25, 48)];
             break;
         case AttributeType.INT:
             value_int = (int)r.Next(this.lowerbound, this.upperbound);
             break;
     }
     return this;
 }
Exemple #2
0
        /**
         * generates a random attribute, taking into account its desidered type = {string,double,int}
         */
        public Attribute generate()
        {
            MyRandom r = new MyRandom();

            switch (type)
            {
            case AttributeType.STRING:
                string a = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
                value_string  = a[(int)r.Next(49)].ToString();
                value_string += a[(int)r.Next(6, 26)];
                value_string += a[(int)r.Next(9, 18)];
                value_string += a[(int)r.Next(25, 48)];
                break;

            case AttributeType.INT:
                value_int = (int)r.Next(this.lowerbound, this.upperbound);
                break;
            }
            return(this);
        }