Exemplo n.º 1
0
        public void SubmitTrialResult(bool correct)
        {
            trial++;
            blockTrial++;

            if (correct)
            {
                correctCount++;
            }
            else
            {
                blockErrorCount++;
            }

            int staircaseStepDiff = 0;

            //Block ends when the blockCollection is empty
            if (blockCollection.Count == 0)
            {
                staircaseStepDiff = StepSpecification.GetStep(blockErrorCount, blockTrial);

                if (staircaseStepDiff > 0)
                {
                    //Adjust by StepsDown
                    staircaseStepDiff *= StepsDown;
                }
                else if (staircaseStepDiff < 0)
                {
                    //Adjust by StepsUp
                    staircaseStepDiff *= StepsUp;
                }

                blockErrorCount = 0;
                blockTrial      = 0;
                block++;

                blockCollection.Reset();
            }

            SetStepValue((int)ControlParameter.Block, blockCollection.PopNext());

            if (staircaseStepDiff != 0)
            {
                if (lastStep != 0 && (staircaseStepDiff > 0) != (lastStep > 0))
                {
                    //Accumulate Reversals
                    reversals++;
                    reversalValues.Add(stepValue);
                }

                if (lastStep != 0 || staircaseStepDiff > 0)
                {
                    //Don't update lastStep until we take a Step Down
                    //This prevents reversal accumulation until our first Downward step
                    lastStep = staircaseStepDiff;
                }

                StepStatus stepStatus = SetStepValue((int)ControlParameter.Staircase, stepValue + staircaseStepDiff);

                if (stepStatus == StepStatus.Success)
                {
                    stepValue += staircaseStepDiff;
                }
                else
                {
                    //Accumulate reversals if we hit the floor or ceiling
                    ++reversals;
                    reversalValues.Add(stepValue);
                }
            }
        }
Exemplo n.º 2
0
 public StepTestDataBuilder()
 {
     _stepSpecification = new StepSpecification();
 }