예제 #1
0
 /// <summary>
 /// Gets a get factor function based on the given routerdb.
 /// </summary>
 public static Func <ushort, Factor> GetGetFactor(this Profile profile, RouterDb routerDb)
 {
     return((profileId) =>
     {
         var edgeProfile = routerDb.EdgeProfiles.Get(profileId);
         return profile.Factor(edgeProfile);
     });
 }
예제 #2
0
 /// <summary>
 /// Gets a get factor and speed function for the given profile.
 /// </summary>
 public static Func <ushort, FactorAndSpeed> GetGetFactorAndSpeed(this Profile profile, RouterDb routerDb)
 {
     return((e) =>
     {
         var att = routerDb.EdgeProfiles.Get(e);
         var f = profile.Factor(att);
         var s = profile.Speed(att);
         return new FactorAndSpeed()
         {
             SpeedFactor = 1 / s.Value,
             Value = f.Value,
             Direction = f.Direction
         };
     });
 }
예제 #3
0
 /// <summary>
 /// Gets a get factor function for the given profile.
 /// </summary>
 public static Func <ushort, Factor> GetGetFactor(this Profile profile, RouterDb routerDb)
 {
     return((e) => profile.Factor(routerDb.EdgeProfiles.Get(e)));
 }