public QLearningAnalysisTrialRunner(IObservableModel observableModel, IRandomNumberProvider randomNumberProvider,
     IDataRecorder recorder)
 {
     _observableModel = observableModel;
     _recorder = recorder;
     _randomNumberProvider = randomNumberProvider;
 }
 public QLearningRewardAnalysis(IObservableModel observableModel, IRandomNumberProvider randomNumberProvider,
     ICumulativeEpochDataRecorder cumulativeTrialDataRecorderRepository)
 {
     _observableModel = observableModel;
     _randomNumberProvider = randomNumberProvider;
     _cumulativeTrialDataRepository = cumulativeTrialDataRecorderRepository;
 }
Exemplo n.º 3
0
 public Cpu(int numberOfCores, int numberOfBits, Motherboard motherboard, IRandomNumberProvider randomNumberProvider)
 {
     this.NumberOfCores = numberOfCores;
     this.NumberOfBits = numberOfBits;
     this.Motherboard = motherboard;
     this.randomNumberProvider = randomNumberProvider;
 }
 public QLearningAnalysisExperiment(IObservableModel observableModel, IRandomNumberProvider randomNumberProvider,
     IDataRecorder dataRepository)
 {
     _observableModel = observableModel;
     _randomNumberProvider = randomNumberProvider;
     _dataRepository = dataRepository;
 }
 public QLearningTrialRunner(IObservableModel observableModel, IRandomNumberProvider randomNumberProvider,
     Func<int, IQLearningActor> actorProvider)
 {
     _observableModel = observableModel;
     _randomNumberProvider = randomNumberProvider;
     _actorProvider = actorProvider;
 }
 public QLearningExperiment(IObservableModel observableModel, IRandomNumberProvider randomNumberProvider,
     ICumulativeDataRecorder cumulativeDataRepository)
 {
     _observableModel = observableModel;
     _randomNumberProvider = randomNumberProvider;
     _cumulativeDataRepository = cumulativeDataRepository;
 }
Exemplo n.º 7
0
 public Character(
     List<Item> items, 
     IRandomNumberProvider randomNumberProvider)
 {
     this.possibleItemDrops = items;
     this.RandomNumberProvider = randomNumberProvider;
 }
        public InventoryManager(int inventoryCapacity, IDocumentStore documentStore, IRandomNumberProvider randomNumberProvider)
        {
            Guard.NullParameter(documentStore, () => documentStore);
            Guard.NullParameter(randomNumberProvider, () => randomNumberProvider);

            _inventoryCapacity = inventoryCapacity;
            _documentStore = documentStore;
            _randomNumberProvider = randomNumberProvider;
        }
 /// <summary>
 /// Initializes a new instance of the BullsAndCowsGame class.
 /// </summary>
 /// <param name="randomNumberProvider">The randomNumberProvider used to generate random numbers.</param>
 /// <param name="scoreboard">The scoreboard used to hold player's scores.</param>
 /// <param name="printer">The printer used for printing messages and different objects.</param>
 /// <param name="commandProcessor">The first command processor in the chain of responsibility.</param>
 public BullsAndCowsGame(
     IRandomNumberProvider randomNumberProvider,
     ScoreBoard scoreboard,
     IPrinter printer,
     ICommandProcessor commandProcessor)
 {
     this.RandomNumberProvider = randomNumberProvider;
     this.ScoreBoard = scoreboard;
     this.Printer = printer;
     this.CommandProcessor = commandProcessor;
 }
Exemplo n.º 10
0
    public BawBagBot(BawBagBotConfiguration configuration)
    {
      Guard.NullParameter(configuration, () => configuration);

      _configuration = configuration;

      _store = new DocumentStore { ConnectionStringName = "RavenDB" };
      _randomProvider = new RandomNumberProvider();
      _inventoryManager = new InventoryManager(5, _store, _randomProvider);
      _textProcessor = new TextProcessor();
      _dateTimeProvider = new DefaultDateTimeProvider();

      _rooms = new Dictionary<string, Room>();
      _botAddressedMatcher = new Regex("^@?" + _configuration.JabbrNick + "[,: ](.*)$", RegexOptions.IgnoreCase);
    }
        private void Setup()
        {
            var mock = new Mock<IRandomNumberProvider>();

            mock.Setup(rnp => rnp.GetRandomNumber(
                    It.IsAny<int>(), It.IsAny<int>()))
                .Returns(0);

            mock.Setup(rnp => rnp.GetRandomNumber(
                    It.IsInRange(10, 20, Range.Inclusive), 
                    It.IsInRange(10, 20, Range.Inclusive)))
                .Throws(new InvalidOperationException());

            this.RandomNumberProvider = mock.Object;
        }
 public ZombiePackDifficultyDirector(IUserRetriever userRetriever,
     IZombiePackRetriever zombiePackRetriever,
     IUserZombiePackProgressRetriever userZombiePackRetriever,
     IUserSaver userSaver,
     IRandomNumberProvider randomNumberProvider,
     IUserPotentialProvider userPotentialProvider,
     IUserZombiePackProgressSaver userZombiePackProgressSaver,
     IUserStatsRetriever userStatsRetriever)
 {
     _userRetriever = userRetriever;
     _zombiePackRetriever = zombiePackRetriever;
     _userZombiePackProgressRetriever = userZombiePackRetriever;
     _userSaver = userSaver;
     _randomNumberProvider = randomNumberProvider;
     _userPotentialProvider = userPotentialProvider;
     _userZombiePackProgressSaver = userZombiePackProgressSaver;
     _userStatsRetriever = userStatsRetriever;
 }
Exemplo n.º 13
0
		/// <summary>
		/// Constructor.
		/// </summary>
		public QuestionService(
			DatabaseContext dbContext, 
			QuestionLoaderFactory questionLoaderFactory, 
			QuestionUpdaterFactory questionUpdaterFactory,
			QuestionGraderFactory questionGraderFactory,
			QuestionDuplicatorFactory questionDuplicatorFactory,
			IQuestionGenerator questionGenerator,
			IJsonSerializer jsonSerializer,
			IRandomNumberProvider randomNumberProvider,
			ITimeProvider timeProvider)
		{
			_dbContext = dbContext;
			_questionLoaderFactory = questionLoaderFactory;
			_questionUpdaterFactory = questionUpdaterFactory;
			_questionGraderFactory = questionGraderFactory;
			_questionDuplicatorFactory = questionDuplicatorFactory;
			_questionGenerator = questionGenerator;
			_jsonSerializer = jsonSerializer;
			_randomNumberProvider = randomNumberProvider;
			_timeProvider = timeProvider;
		}
 public HuntDirector(IUserRetriever userRetriever,
     IZombiePackRetriever zombiePackRetriever,
     IUserEnergyProvider userEnergyProvider,
     IUserSaver userSaver,
     IUserZombiePackProgressSaver userZombiePackProgressSaver,
     IUserAttackPowerProvider userAttackPowerProvider,
     IZombiePackDifficultyDirector zombiePackDifficultyDirector,
     IRandomNumberProvider randomNumberProvider,
     IUserLevelService userLevelService,
     IUserCountsSaver userCountsSaver,
     IHotZoneRetriever hotZoneRetriever)
 {
     _userRetriever = userRetriever;
     _zombiePackRetriever = zombiePackRetriever;
     _userEnergyProvider = userEnergyProvider;
     _userSaver = userSaver;
     _userZombiePackProgressSaver = userZombiePackProgressSaver;
     _userAttackPowerProvider = userAttackPowerProvider;
     _zombiePackDifficultyDirector = zombiePackDifficultyDirector;
     _randomNumberProvider = randomNumberProvider;
     _userLevelService = userLevelService;
     _userCountsSaver = userCountsSaver;
     _hotZoneRetriever = hotZoneRetriever;
 }
Exemplo n.º 15
0
        private static CardAccount GenerateCardAccount(HashSet<long> registeredCardNumbers, IList<int> cardHolderIds, IRandomNumberProvider numberProvider, IRandomDataProvider randomDataProvider)
        {
            string cardNumber = string.Empty;
            long number = new long();
            while (number == 0 || registeredCardNumbers.Contains(number))
            {
                number = (long)numberProvider.GetIntInRange(0, 1999999999) * (long)numberProvider.GetIntInRange(1, 5);
            }

            registeredCardNumbers.Add(number);
            cardNumber = number.ToString().PadLeft(10, '0');
            var holderId = cardHolderIds[numberProvider.GetIntUpTo(cardHolderIds.Count - 1)];
            var pin = randomDataProvider.GetStringExact(4, RandomDataType.Numerics);
            var cash = (decimal)numberProvider.GetDoubleInRange(100.00D, 10000.00D);

            CardAccount currentCardAccount = new CardAccount()
            {
                CardNumber = cardNumber,
                CardHolderId = holderId,
                CardPin = pin,
                CardCash = cash
            };
            return currentCardAccount;
        }
 public void TestInit()
 {
     var mock = new RandomNumberProviderMock();
     this.randomNumberProvider = mock.RandomNumberProvider;
 }
 public QLearningBubbleAnalysisRunner(IObservableModel observableModel,
     IRandomNumberProvider randomNumberProvider)
 {
     _observableModel = observableModel;
     _randomNumberProvider = randomNumberProvider;
 }
 public VisualArrayGenerator(IRandomNumberProvider randomNumberProvider)
 {
     _randomNumberProvider = randomNumberProvider;
 }
Exemplo n.º 19
0
 public HandPower(HandClassificator type, IRandomNumberProvider random)
 {
     this.type = type;
     this.random = random;
 }
 public BullsAndCowsTests(IRandomNumberProvider randomNumberProvider)
 {
     this.randomGenerator = randomNumberProvider;
 }
 public RandomActor(IRandomNumberProvider randomNumberProvider)
 {
     _randomNumberProvider = randomNumberProvider;
 }
Exemplo n.º 22
0
 public Cpu64Bits(int numberOfCores, Motherboard motherboard, IRandomNumberProvider randomNumberProvider)
     : base(numberOfCores, BitsCount, motherboard, randomNumberProvider)
 {
 }
 public BullsAndCows(IRandomNumberProvider randomNumberProvider, IScoreBoard scoreBoard)
 {
     this.randomGenerator = randomNumberProvider;
     this.scoreBoard = scoreBoard;
     this.SetNewDigits();
 }
Exemplo n.º 24
0
 public Sensor(IRandomNumberProvider rnd)
 {
     this._randomPressureSampleSimulator = rnd;
 }
 public BullsAndCows(IRandomNumberProvider randomNumberProvider)
     : this(randomNumberProvider, new ScoreBoard())
 {
 }
Exemplo n.º 26
0
 public Character(List<Item> items, IRandomNumberProvider numberProvider)
 {
     this.RandomNumberProvider = numberProvider;
     random = new Random();
     this.possibleItemDrops = items;
 }
		/// <summary>
		/// Creates a question service.
		/// </summary>
		private QuestionService CreateQuestionService(
			DatabaseContext dbContext,
			QuestionLoaderFactory questionLoaderFactory = null,
			QuestionUpdaterFactory questionUpdaterFactory = null,
			QuestionGraderFactory questionGraderFactory = null,
			QuestionDuplicatorFactory questionDuplicatorFactory = null,
			IQuestionGenerator questionGenerator = null,
			IJsonSerializer jsonSerializer = null,
			IRandomNumberProvider randomNumberProvider = null,
			ITimeProvider timeProvider = null)
		{
			return new QuestionService
			(
				dbContext,
				questionLoaderFactory,
				questionUpdaterFactory,
				questionGraderFactory,
				questionDuplicatorFactory,
				questionGenerator,
				jsonSerializer,
				randomNumberProvider,
				timeProvider
			);
		}
Exemplo n.º 28
0
 public RandomDataProvider(IRandomNumberProvider randomGenerator)
 {
     this.randomGenerator = randomGenerator;
 }
Exemplo n.º 29
0
 public NodeCreator(string connectionString, IDistanceCalculator distanceCalculator, IRandomNumberProvider randomNumberProvider)
 {
     _connectionString = connectionString;
     _distanceCalculator = distanceCalculator;
     _randomNumberProvider = randomNumberProvider;
 }