private Object GetSubscriptionToupleFromRange(Field field) { RangedModel model = new RangedModel(); string op = GetRandom(_subscriptionsConfig.GetOperators()); if (field == Field.drop) { model = _publicationsConfig.GetDrop(); } if (field == Field.value) { model = _publicationsConfig.GetValue(); } if (field == Field.variation) { model = _publicationsConfig.GetVariation(); } double value = GetRandom(model.GetMinValue(), model.GetMaxValue()); return(new SubscriptionTouple <Double>(field, op, value)); }
private static void LoadRangedValue(string minKey, string maxKey, RangedModel model) { var minValue = ConfigurationManager.AppSettings[minKey]; var maxValue = ConfigurationManager.AppSettings[maxKey]; model.SetMinValue(double.Parse(minValue)); model.SetMaxValue(double.Parse(maxValue)); }
public PublicationsConfiguration() { _outputFileName = "publications.txt"; _dateStringFormat = "yyyy-MM-dd"; _messageNumber = new ValueModel <int>(); _drop = new RangedModel(); _value = new RangedModel(); _variation = new RangedModel(); _companies = new List <string>(); _stringDates = new List <string>(); _dates = new List <DateTime>(); }
private Object GetPublicationToupleFromRange(Field field) { RangedModel model = new RangedModel(); if (field == Field.drop) { model = _publicationsConfig.GetDrop(); } if (field == Field.value) { model = _publicationsConfig.GetValue(); } if (field == Field.variation) { model = _publicationsConfig.GetVariation(); } double value = GetRandom(model.GetMinValue(), model.GetMaxValue()); return(new PublicationTouple <Double>(field, value)); }
public void SetVariation(RangedModel variation) { _variation = variation; }
public void SetValue(RangedModel value) { _value = value; }
public void SetDrop(RangedModel drop) { _drop = drop; }