Exemplo n.º 1
0
        public static void SetValue <T>(this IBasicModelInterface model, string variable, T value)
        {
            var length = BasicModelInterfaceLibrary.GetTotalLength(model.GetShape(variable));
            var values = Enumerable.Repeat(value, length).ToArray();

            model.SetValues(variable, values);
        }
Exemplo n.º 2
0
        public static void SetValue <T>(this IBasicModelInterface model, string variable, int index, T value)
        {
            var shape = model.GetShape(variable);

            if (shape.Length != 1)
            {
                throw new NotSupportedException("use SetValue(variable, start, count, values)");
            }

            //model.SetValues(variable, new int[] { index }, new int[] { 1 }, new T[] { value });
            model.SetValues(variable, new int[] { index }, new T[] { value });
        }
Exemplo n.º 3
0
 public void SetUp()
 {
     library = new BasicModelInterfaceLibrary(LibraryC);
 }
Exemplo n.º 4
0
        public MmiModelRunner(string connectionString, IBasicModelInterface model)
        {
            this.model = model;

            MmiHelper.ParseConnectionString(connectionString, out protocol, out host, out port);
        }
Exemplo n.º 5
0
        public static T GetValue <T>(this IBasicModelInterface model, string variable)
        {
            var values = model.GetValues(variable);

            return((T)values.GetValue(0));
        }