예제 #1
0
        public CooldownsUpdaterSystem(CannonCooldownsController cannonCooldownsController, IApproximator <float> cannonCooldownApproximator)
        {
            if (cannonCooldownsController == null)
            {
                throw new Exception($"{nameof(CooldownsUpdaterSystem)} {nameof(cannonCooldownsController)} was null");
            }

            approximator = cannonCooldownApproximator;

            _cannonCooldownsController = cannonCooldownsController;
            weaponInfos = new WeaponInfo[0];
            cooldowns   = new float[0];
        }
예제 #2
0
        public AbilityUpdaterSystem(CooldownInfo abilityCooldownInfo, IApproximator <float> abilityCooldownApproximator)
        {
            if (abilityCooldownInfo == null)
            {
                throw new NullReferenceException($"{nameof(AbilityUpdaterSystem)} {nameof(abilityCooldownInfo)} was null");
            }

            approximator = abilityCooldownApproximator;

            approximator.Set(new Dictionary <ushort, float> {
                { 0, float.PositiveInfinity }
            }, Time.time - Time.deltaTime);
            approximator.Set(new Dictionary <ushort, float> {
                { 0, float.PositiveInfinity }
            }, Time.time);

            _cooldownInfo = abilityCooldownInfo;
        }
예제 #3
0
        public TimeSpeedSystem(Contexts contexts, IApproximator <float> timeApproximator)
        {
            gameContext           = contexts.game;
            _lastMessageId        = 0;
            WasChanged            = false;
            approximator          = timeApproximator;
            _serverDeltaTime      = ServerTimeConstants.MinDeltaTime;
            defaultFixedDeltaTime = Time.fixedDeltaTime;

            approximator.Set(new Dictionary <ushort, float>(1)
            {
                { 0, ServerTimeConstants.MinDeltaTime }
            }, Time.time - Time.deltaTime);
            approximator.Set(new Dictionary <ushort, float>(1)
            {
                { 0, ServerTimeConstants.MinDeltaTime }
            }, Time.time);
        }
예제 #4
0
        /// <summary>
        /// Создание экземпляра класса <see cref="TextRecognizer"/>.
        /// </summary>
        public TextRecognizer(
            IApproximator approximator,
            EulerContainer container,
            IFragmentAnalyzer analyzer,
            IScanner scanner)
        {
            if (approximator == null)
            {
                throw new ArgumentNullException(nameof(approximator));
            }

            if (container == null)
            {
                throw new ArgumentNullException(nameof(container));
            }

            _approximator = approximator;
            _analyzer     = analyzer ?? new DefaultFragmentAnalyzer(container);
            _scanner      = scanner ?? new DefaultScanner();
        }
예제 #5
0
        //readonly IGroup<GameEntity> gameEntitiesGroup;

        public UpdateRadiusSystem(Contexts contexts, IApproximator <float> radiusApproximator)
        {
            gameContext  = contexts.game;
            approximator = radiusApproximator;
            //gameEntitiesGroup = gameContext.GetGroup(GameMatcher.Circle);
        }
예제 #6
0
 /// <summary>
 /// Создание экземпляра класса <see cref="TextRecognizer"/>.
 /// </summary>
 public TextRecognizer(EulerContainer container, IApproximator approximator)
     : this(approximator, container, null, null)
 {
 }
예제 #7
0
        private void startApproximateButton_Click(object sender, EventArgs e)
        {
            if (approximator == null) {
                approximator = new LeastSquareMethod();
            }

            int selectionSize = 1000;
            int order = 6;

            ISelection selection = generateSourceSelection(selectionSize, sinWithNoiseFunc2D);
            drawSeries(approximateChart.Series[0], selection);

            Polynomial polynomial = approximator.Approximate(selection, order);

            ISelection app_selection = polynomial.GetSelectionFromRange(0, selectionSize, selectionSize/100);
            drawSeries(approximateChart.Series[1], app_selection);
        }
예제 #8
0
 public RQlearning(double Epsilon, double DiscountFactor, IApproximator Qfunc)
 {
     this.Epsilon        = Epsilon;
     this.DiscountFactor = DiscountFactor;
     this.Qfunc          = Qfunc;
 }