/// <summary> /// Add another model artefacts to the actual model /// </summary> /// <param name="model"></param> public void Add(XMileModel model) { if (model == null) { throw new ArgumentNullException(nameof(model)); } Variables.AddRange(model.Variables); Groups.AddRange(model.Groups); }
public static Module CreateInstance(XMileModel model, string name, ConnectCollection connects) { if (model == null) { throw new ArgumentNullException(nameof(model)); } var variable = new Module(name, connects, model.Name); model.Variables.Add(variable); return(variable); }
public static async Task <T> CreateInstance <T>(string name, XMileModel model, string eqn) where T : IVariable, new() { if (model == null) { throw new ArgumentNullException(nameof(model)); } var variable = await CreateVariable <T>(name, model.Name, eqn); model.Variables.Add(variable); return(variable); }
public static async Task <Flow> CreateInstance(string name, XMileModel model, string eqn, GraphicalFunction graph, Range range, Range scale, NonNegative nonNegative, VariableAccess access) { if (model == null) { throw new ArgumentNullException(nameof(model)); } var variable = await CreateFlow(name, model.Name, eqn, graph, range, scale, nonNegative, access); model.Variables.Add(variable); return(variable); }