public override void SetValues(SimulationObject target) { var value = Sampler(target); if (!OmitIfNull || !Equals(value, default(TValue))) { target.Variables[Key] = Sampler(target); } }
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)); }
public abstract void SetValues(SimulationObject target);
public override void SetValues(SimulationObject target) { var var = Randomness.Random.NextDouble() < Var2Prob ? Var2 : Var1; var.SetValues(target); }