/// <summary> /// Returns the default weight handler but calculates a profile cache first. /// </summary> public static DefaultWeightHandler DefaultWeightHandlerCached(this IProfileInstance profile, RouterDb routerDb) { // prebuild profile factor cache. var profileCache = new ProfileFactorAndSpeedCache(routerDb); profileCache.CalculateFor(profile.Profile); return(new Weights.DefaultWeightHandler(profileCache.GetGetFactor(profile))); }
/// <summary> /// Returns the augmented weight handler. /// </summary> public static WeightHandler AugmentedWeightHandlerCached(this Profile profile, RouterDb routerDb) { // prebuild profile factor cache. var profileCache = new ProfileFactorAndSpeedCache(routerDb); profileCache.CalculateFor(profile); return(new Weights.WeightHandler(profileCache.GetGetFactorAndSpeed(profile))); }