public FewestProductClashesAtChildLevelBreakFactor( IReadOnlyCollection <Spot> spots, SmoothBreak smoothBreak, IReadOnlyDictionary <Guid, SpotInfo> spotInfos, IProductClashChecker productClashChecker) { _spots = spots; _smoothBreak = smoothBreak; _spotInfos = spotInfos; _productClashChecker = productClashChecker; }
public FewestProductClashesBreakFactor( SmoothBreak smoothBreak, IReadOnlyCollection <Spot> spots, IReadOnlyDictionary <Guid, SpotInfo> spotInfos, IReadOnlyDictionary <string, Product> productsByExternalRef, IReadOnlyDictionary <string, Clash> clashesByExternalRef, IProductClashChecker productClashChecker, IClashExposureCountService effectiveClashExposureCount) { _smoothBreak = smoothBreak; _spots = spots; _spotInfos = spotInfos; _productsByExternalRef = productsByExternalRef; _clashesByExternalRef = clashesByExternalRef; _productClashChecker = productClashChecker; _effectiveClashExposureCount = effectiveClashExposureCount; }
/// <summary> /// Calculates the factor score for product clashes at both child and /// parent level /// </summary> private double GetFactorScoreForProductClashes( SmoothBreak smoothBreak, IReadOnlyCollection <Spot> spots, IReadOnlyDictionary <Guid, SpotInfo> spotInfos, IReadOnlyDictionary <string, Product> productsByExternalRef, IReadOnlyDictionary <string, Clash> clashesByExternalRef, IProductClashChecker productClashChecker, IClashExposureCountService effectiveClashExposureCount) { var factorScoreCalculator = new ProductClashFactorScore(effectiveClashExposureCount); return(factorScoreCalculator.GetFactorScoreForProductClashes( smoothBreak.SmoothSpots.Select(s => s.Spot).ToList(), spots, spotInfos, productsByExternalRef, clashesByExternalRef, productClashChecker.GetProductClashesForSingleSpot )); }