• API Documentation
Show / Hide Table of Contents
  • Rebus
    • Arguments
    • Biome
    • CantorPairing
    • CommandRequest
    • CommandResponse
    • CommandType
    • Commodity
    • Configuration
    • ConflictEventArgs
    • Depths
    • Economy
    • Fleet
    • HexPoint
    • IGameService
    • ILoginService
    • Player
    • Unit
    • User
    • Zone
    • ZoneInfo
  • Rebus.Client
    • GraphicsEngine
    • Layout
    • RpcClient
    • ZoneVisualizer
  • Rebus.Client.Lenses
    • BiomeLens
    • ConstellationLens
    • Lens
    • PopulationLens
    • StarLens
  • Rebus.Server
    • AStarSearch
    • EvaluationContext
    • FisherYatesShuffle
    • JuliaSet
    • PowerSet
  • Rebus.Server.Considerations
    • Agent
    • Behavior
    • BehaviorCollection
    • Consideration
    • ConsiderationCollection
    • FunctionConsideration
    • LinearConsideration
    • QuadraticConsideration
  • Rebus.Server.Functions
    • IFunctions<T>
  • System
    • NegativeExponentialRandom
  • System.Text.Json.Serialization.Converters
    • ComplexConverter
    • CultureInfoConverter
    • IPAddressConverter

Class FisherYatesShuffle

Performs Durstenfeld's Fisher–Yates shuffle algorithm to randomize collections.

Inheritance
Object
FisherYatesShuffle
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Rebus.Server
Assembly: Rebus.Server.dll
Syntax
public class FisherYatesShuffle
Remarks

The implementation of this class was inspired by and based on this Wikipedia article.

Constructors

FisherYatesShuffle(Random)

Initializes a new instance of the FisherYatesShuffle class.

Declaration
public FisherYatesShuffle(Random random)
Parameters
Type Name Description
Random random

The pseudo-random number generator.

Properties

Random

Gets the pseudo-random number generator.

Declaration
public Random Random { get; }
Property Value
Type Description
Random

The pseudo-random number generator.

Methods

Shuffle(IList<String>)

Shuffles a collection using Durstenfeld's algorithm.

Declaration
public void Shuffle(IList<string> values)
Parameters
Type Name Description
IList<String> values

The collection.

See Also

Fisher–Yates shuffle - Wikipedia
In This Article
Back to top © 2021-2022 Ishan Pranav. All rights reserved. Licensed under the MIT License.