Beispiel #1
0
        // map value indices to actual values and create a Variation
        private static Variation IndicesToVariation <T>(Model <T> model, VariationIndexTagPair pair) where T : new ()
        {
            Variation v = new Variation(pair.Tag);

            for (int i = 0; i < pair.Indices.Length; i++)
            {
                var value = model.Parameters[i].GetAt(pair.Indices[i]) is ParameterValueBase ?
                            ((ParameterValueBase)model.Parameters[i].GetAt(pair.Indices[i])).GetValue() : model.Parameters[i].GetAt(pair.Indices[i]);
                v.Add(model.Parameters[i].Name, value);
            }

            return(v);
        }
Beispiel #2
0
        // map value indices to actual values and create a Variation
        private static Variation IndicesToVariation(Model model, VariationIndexTagPair pair)
        {
            Variation v = new Variation(pair.Tag);

            for (int i = 0; i < pair.Indices.Length; i++)
            {
                var value = model.Parameters[i][pair.Indices[i]] is ParameterValue ?
                            ((ParameterValue)model.Parameters[i][pair.Indices[i]]).Value : model.Parameters[i][pair.Indices[i]];
                v.Add(model.Parameters[i].Name, value);
            }

            return(v);
        }