public void SetupFeatures(IFeatureCollection pathProcessFeaturesCollection)
        {
            var mappingFeature = pathProcessFeaturesCollection.GetFeature <IPathMappingFeature>();

            _factorIndex = mappingFeature.GetDimension(_name);
            _timesteps   = pathProcessFeaturesCollection.GetFeature <ITimeStepsFeature>();
        }
Example #2
0
        public void SetupFeatures(FeatureCollection pathProcessFeaturesCollection)
        {
            var mappingFeature = pathProcessFeaturesCollection.GetFeature <IPathMappingFeature>();

            _factorIndex = mappingFeature.AddDimension(_name);

            _timesteps = pathProcessFeaturesCollection.GetFeature <ITimeStepsFeature>();
            var stepSize = (_expiryDate - _startDate).TotalDays / _numberOfSteps;

            for (var i = 0; i < _numberOfSteps - 1; i++)
            {
                _timesteps.AddDate(_startDate.AddDays(i * stepSize));
            }
            _timesteps.AddDate(_expiryDate);
        }
Example #3
0
        public void SetupFeatures(IFeatureCollection pathProcessFeaturesCollection)
        {
            var mappingFeature = pathProcessFeaturesCollection.GetFeature <IPathMappingFeature>();

            _factorIndex = mappingFeature.AddDimension(_name);

            _timesteps = pathProcessFeaturesCollection.GetFeature <ITimeStepsFeature>();
            _timesteps.AddDates(_pastFixings.Keys.Where(x => x < _startDate));

            var stepSize = (_expiryDate - _startDate).TotalDays / _numberOfSteps;
            var simDates = new List <DateTime>();

            for (var i = 0; i < _numberOfSteps; i++)
            {
                simDates.Add(_startDate.AddDays(i * stepSize).Date);
            }

            _timesteps.AddDates(simDates.Distinct());
        }
Example #4
0
        public void SetupFeatures(IFeatureCollection pathProcessFeaturesCollection)
        {
            _factorIndices = new int[_codes.Count];
            var mappingFeature = pathProcessFeaturesCollection.GetFeature <IPathMappingFeature>();

            for (var c = 0; c < _factorIndices.Length; c++)
            {
                _factorIndices[c] = mappingFeature.AddDimension(_codes[c]);
            }
            _mainFactorIndex = mappingFeature.AddDimension(_name);
            _timesteps       = pathProcessFeaturesCollection.GetFeature <ITimeStepsFeature>();
            var simDates = new List <DateTime>(_pastFixings.Keys.Where(x => x < _startDate));
            var stepSize = (_expiryDate - _startDate).TotalDays / _numberOfSteps;

            for (var i = 0; i < _numberOfSteps - 1; i++)
            {
                simDates.Add(_startDate.AddDays(i * stepSize).Date);
            }
            simDates = simDates.Distinct().ToList();
            _timesteps.AddDates(simDates);
        }
 public void Finish(IFeatureCollection collection)
 {
     _timeFeature            = collection.GetFeature <ITimeStepsFeature>();
     _calculationDateIndices = _calculationDates.Select(d => _timeFeature.GetDateIndex(d)).ToArray();
     _isComplete             = true;
 }