public SimulationContext(IJ4JLoggerFactory loggerFactory)
            : base("Investment Simulator")
        {
            _logger = loggerFactory?.CreateLogger(typeof(SimulationContext)) ??
                      throw new NullReferenceException(nameof(loggerFactory));

            Betas = new BetaDistribution(this, loggerFactory);

            ChildModels.Add(Betas);
        }
示例#2
0
        public ModelWeigh(Type model, IEnumerable <Type> childModels)
        {
            Model = model;

            var index = 0;

            foreach (var childModel in childModels)
            {
                if (!ChildModels.ContainsKey(childModel))
                {
                    index += 100;
                    ChildModels.Add(childModel, index);
                }
            }
        }
示例#3
0
 /// <summary>
 /// Gets the start time.
 /// </summary>
 /// <returns>The start time.</returns>
 /// <param name="element">Element.</param>
 public Time GetStartTime(PlaylistElementVM element)
 {
     return(new Time(ChildModels.TakeWhile(elem => elem != element.Model).Sum(elem => elem.Duration.MSeconds)));
 }