/// <summary>
 /// Step forward in time over the interval provided
 /// </summary>
 /// <param name="interval"></param>
 public void Step(TimeInterval interval)
 {
     if (_currentDateTime != interval.Previous) throw new ArgumentException("intervals are not continuous");
     foreach (var set in _simulationSets)
     {
         // this provides another axis for parallelising the code
         foreach (var model in set.Models)
         {
             model.StepNext(interval);
         }
     }
     _currentDateTime = interval.Next;
 }
        public void StepNext(TimeInterval timeStep)
        {
            int timeIndex = timeStep.Index;

            var S = NArray.CreateScalar(0);

            double tenor = timeStep.IntervalInYears;

            for (int factorIndex = 0; factorIndex < _factors.Length; ++factorIndex)
            {
                S += (Sigma(factorIndex) / Lambda(factorIndex))
                    * (_factorPaths[factorIndex][timeIndex] + _weinerPaths[factorIndex][timeIndex]);
            }

            double drift = GetDrift(timeIndex);

            _state[timeIndex] = NMath.Exp(-0.5 * drift + S);
        }
 public abstract void StepNext(TimeInterval interval);
 public abstract NArray Step(TimeInterval timeStep, NArray previous);