/// <summary> /// Generate the necessary parameters /// </summary> public List <KeyValuePair <string, string> > GetParams() { var p = new List <KeyValuePair <string, string> >(); if (Binding != null) { p.Add(new KeyValuePair <string, string>("Binding", Binding)); } if (FriendlyName != null) { p.Add(new KeyValuePair <string, string>("FriendlyName", FriendlyName)); } if (FactorType != null) { p.Add(new KeyValuePair <string, string>("FactorType", FactorType.ToString())); } if (Config != null) { p.Add(new KeyValuePair <string, string>("Config", Config)); } return(p); }
/// <summary> /// Gets the value factor mapping reference. /// </summary> /// <param name="factor">The factor.</param> /// <param name="factorType">Type of the factor.</param> /// <param name="generatorType">Type of the generator.</param> /// <returns></returns> public static double GetValueFactorMappingReference(BaseFactor factor, FactorType factorType, GeneratorType generatorType) { double factorMappingReferenceData = 0; // Make sure to initialize the mapping information if (Constants.GeneratorsTypeToFactorMapper.ContainsKey(generatorType)) { if (factorType == FactorType.ValueFactor) { var valueFactorMappingTuple = Constants.GeneratorsTypeToFactorMapper[generatorType]; var valueFactorMapping = valueFactorMappingTuple.Item1.Value; switch (valueFactorMapping) { case ValueFactorType.Low: factorMappingReferenceData = factor.Low; break; case ValueFactorType.Medium: factorMappingReferenceData = factor.Medium; break; case ValueFactorType.High: factorMappingReferenceData = factor.High; break; } ; } else { var emissionFactorMappingTuple = Constants.GeneratorsTypeToFactorMapper[generatorType]; var emissionFactorMapping = emissionFactorMappingTuple.Item2.Value; switch (emissionFactorMapping) { case EmissionsFactorType.NA: factorMappingReferenceData = 0; break; case EmissionsFactorType.Low: factorMappingReferenceData = factor.Low; break; case EmissionsFactorType.Medium: factorMappingReferenceData = factor.Medium; break; case EmissionsFactorType.High: factorMappingReferenceData = factor.High; break; } ; } } return(factorMappingReferenceData); }
public Debtor(Person person) { Person = person; Factor = person.DebtFactor; Factor_Type = FactorType.Standart; int beginDebt = 0; Debt = beginDebt; }
public static IUserFactor NewFactor(FactorType factorType, string provider, Resource profile) { var data = new Dictionary <string, object>(StringComparer.Ordinal) { ["factorType"] = factorType, ["provider"] = provider, ["profile"] = profile, }; return(Create <UserFactor>(data)); }
private BaseFactor GetFactors(FactorType factorType) { var factors = (from factor in base.SimpleStreamAxis(FileName, factorType.ToString()) select new BaseFactor { High = Convert.ToDouble(factor.ElementAnyNS(EmissionsFactorType.High.ToString()).Value), Medium = Convert.ToDouble(factor.ElementAnyNS(EmissionsFactorType.Medium.ToString()).Value), Low = Convert.ToDouble(factor.ElementAnyNS(EmissionsFactorType.Low.ToString()).Value), }).Select(x => { x.ErrorMessages = x.Validate(); return(x); }).FirstOrDefault(); return(factors); }
/// <summary> /// Generate the necessary parameters /// </summary> public List <KeyValuePair <string, string> > GetParams() { var p = new List <KeyValuePair <string, string> >(); if (FriendlyName != null) { p.Add(new KeyValuePair <string, string>("FriendlyName", FriendlyName)); } if (FactorType != null) { p.Add(new KeyValuePair <string, string>("FactorType", FactorType.ToString())); } if (BindingAlg != null) { p.Add(new KeyValuePair <string, string>("Binding.Alg", BindingAlg)); } if (BindingPublicKey != null) { p.Add(new KeyValuePair <string, string>("Binding.PublicKey", BindingPublicKey.ToString())); } if (ConfigAppId != null) { p.Add(new KeyValuePair <string, string>("Config.AppId", ConfigAppId)); } if (ConfigNotificationPlatform != null) { p.Add(new KeyValuePair <string, string>("Config.NotificationPlatform", ConfigNotificationPlatform.ToString())); } if (ConfigNotificationToken != null) { p.Add(new KeyValuePair <string, string>("Config.NotificationToken", ConfigNotificationToken)); } if (ConfigSdkVersion != null) { p.Add(new KeyValuePair <string, string>("Config.SdkVersion", ConfigSdkVersion)); } return(p); }
private decimal ExecuteFactor(FactorType type, Dictionary <FactorType, List <FactorInfo> > factors, Dictionary <FactorType, List <FactorInfo> > defenderFactors, Hero hero, Creature creature, TextWriter log, decimal i2 = 1, decimal r2 = 1) { decimal value = 0; if (!factors.ContainsKey(type)) { return(value); } List <FactorInfo> factorInfos = factors[type]; foreach (FactorInfo info in factorInfos) { log.WriteLine("Executing bonus: {0} for {1}. Factor type: {2}", info.ParentRef.Name, creature.Name, type.ToString()); object modificator = null; if (info.Factor.Item is Modificator) { modificator = info.Factor.Item; } else if (info.Factor.Item is Reference) { object refModificator = World.Modificators[((Reference)info.Factor.Item).Name]; modificator = (Modificator)refModificator; } else if (info.Factor.Item is LevelModificator) { modificator = info.Factor.Item; } value += EvalModificator(modificator, info, defenderFactors, hero, creature, log, i2, r2); } log.WriteLine("Factor Type: {0} evaluationg finished with value: '{1}' for {2}.", type.ToString(), value, creature.Name); return(value); }
public Debtor(Person person, FactorType factorType, double value) { Person = person; this.Factor_Type = factorType; if (factorType == FactorType.SpecialForProduct) { Factor = value; int beginDebt = 0; Debt = beginDebt; } else if (factorType == FactorType.WithoutFactor) { Factor = GeneralInfo.FixedDebtFactor; Debt = value; } else { Factor = Person.DebtFactor; int beginDebt = 0; Debt = beginDebt; } }
public Xavier(RandType randType = RandType.Gaussian, FactorType factorType = FactorType.Average, float magnitude = 3) { this.Rand = randType; this.Factor = factorType; this.Magnitude = magnitude; }
public MSPReLU(FactorType factorType = FactorType.Average, float slope = 0.25f) : base(RandType.Gaussian, factorType, (float)(2d / (1 + slope * slope))) { }
public Xavier(RndType rnd_type = RndType.Uniform, FactorType factor_type = FactorType.Avg, float magnitude = 3) { this._rnd_type = rnd_type; this._factor_type = factor_type; this._magnitude = magnitude; }
public Factor(FactorType type, NonTerminal expression) { Type = type; Expression = expression; }
public Factor(FactorType type, string digit) { Type = type; Digit = digit; }
public Factor(FactorType type, Identifier identifier) { Type = type; Identifier = identifier; }
public FabWeightFactor(string name, float weightFactor, float sequence, FactorType type, OrderType orderType, string criteria, bool isAllowFilter) : base(name, weightFactor, sequence, type, orderType) { this.OrigCriteria = criteria; this.IsAllowFilter = IsAllowFilter; }