Exemple #1
0
        public override void SetValues(SimulationObject target)
        {
            var value = Sampler(target);

            if (!OmitIfNull || !Equals(value, default(TValue)))
            {
                target.Variables[Key] = Sampler(target);
            }
        }
Exemple #2
0
        public static TValue GetVariable <TValue>(this SimulationObject obj, string key,
                                                  TValue defaultValue = default(TValue))
        {
            var v = obj as Visit;

            if (v != null)
            {
                return(v.GetVariable(key, defaultValue));
            }
            var r = obj as Request;

            if (r != null)
            {
                return(r.GetVariable(key, defaultValue));
            }

            return((TValue)obj.Variables.GetOrDefault(key, defaultValue));
        }
Exemple #3
0
 public abstract void SetValues(SimulationObject target);
Exemple #4
0
        public override void SetValues(SimulationObject target)
        {
            var var = Randomness.Random.NextDouble() < Var2Prob ? Var2 : Var1;

            var.SetValues(target);
        }