コード例 #1
0
        public override DestinationStatus PickDestination(IReadOnlyList <DestinationStatus> availableDestinations)
        {
            Random r = RandomFactory.GetRandom();

            DestinationStatus first  = availableDestinations[r.Next(availableDestinations.Count)];
            DestinationStatus second = availableDestinations[r.Next(availableDestinations.Count)];

            return((first.CurrentRequestCount <= second.CurrentRequestCount) ? first : second);
        }
コード例 #2
0
 public override DestinationStatus PickDestination(IReadOnlyList <DestinationStatus> availableDestinations)
 {
     return(availableDestinations[RandomFactory.GetRandom().Next(availableDestinations.Count)]);
 }