Skip to content
Snippets Groups Projects
Commit aa47b693 authored by Jonathan Ehret's avatar Jonathan Ehret
Browse files

minor improvement for randomization if only using enBlock and InOrder factors.

parent 9b8216b2
No related branches found
No related tags found
No related merge requests found
...@@ -183,12 +183,15 @@ TArray<USFCondition*> USFStudyPhase::GenerateConditions(int ParticipantSequenceN ...@@ -183,12 +183,15 @@ TArray<USFCondition*> USFStudyPhase::GenerateConditions(int ParticipantSequenceN
// create shuffling of enBlock factor, trivial case ({0}) if we do not have an enBlock factor // create shuffling of enBlock factor, trivial case ({0}) if we do not have an enBlock factor
int OrderNr = ParticipantSequenceNr + PhaseIndex;
// we devide the participantNr by NumRandomConditions so we do not progress at the same speed, otherwise for simple setup (2-level enBlock, 2-level Random): // we devide the participantNr by NumRandomConditions so we do not progress at the same speed, otherwise for simple setup (2-level enBlock, 2-level Random):
// a1 a2 b2 b1 // a1 a2 b2 b1
// b2 b1 a1 a2 (and then repeating) // b2 b1 a1 a2 (and then repeating)
// in case NumRandomConditions is uneven even devide by 2*NumRandomConditions since we have twice as many rows in the Latin Square // in case NumRandomConditions is uneven even devide by 2*NumRandomConditions since we have twice as many rows in the Latin Square
const TArray<int> EnBlockLatinSquare = USFStudyFactor::GenerateLatinSquareOrder( if (NumRandomConditions > 1) {
ParticipantSequenceNr / (NumRandomConditions*(1 + NumRandomConditions%2)) + PhaseIndex, NumEnBlockLevels); OrderNr = ParticipantSequenceNr / (NumRandomConditions * (1 + NumRandomConditions % 2)) + PhaseIndex;
}
const TArray<int> EnBlockLatinSquare = USFStudyFactor::GenerateLatinSquareOrder(OrderNr, NumEnBlockLevels);
for (int EnBlockLevel = 0; EnBlockLevel < NumEnBlockLevels; EnBlockLevel++) for (int EnBlockLevel = 0; EnBlockLevel < NumEnBlockLevels; EnBlockLevel++)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment