public BlockTable(List <Variable> allData, ExperimentDesign design) { //Get block Variables List <Variable> blockVariables = new List <Variable>(); foreach (Variable datum in allData) { if (datum.TypeOfVariable == VariableType.Independent) { IndependentVariable independentVariable = (IndependentVariable)datum; if (independentVariable.Block) { blockVariables.Add(independentVariable); } } } baseBlockTable = design.SortAndAddIVs(blockVariables, true); }
public TrialTable(List <Variable> allData, ExperimentDesign design, BlockTable baseBlockTable, bool shuffleBaseTrialOrder, int numberOfRepetitions, ColumnNames columnNames) { this.columnNames = columnNames; BaseTrialTable = design.SortAndAddIVs(allData); //Repeat all trials if specified if (numberOfRepetitions > 1) { DataTable repeatedTable = BaseTrialTable.Clone(); for (int i = 0; i < numberOfRepetitions; i++) { foreach (DataRow row in BaseTrialTable.Rows) { repeatedTable.ImportRow(row); } } BaseTrialTable = repeatedTable; } //Shuffle trial order if needed if (shuffleBaseTrialOrder) { BaseTrialTable = BaseTrialTable.Shuffle(); } AddBlockColumnsFrom(baseBlockTable); AddTotalTrialIndexColumnTo(); AddTrialIndexColumnTo(); AddBlockNumberColumnTo(); AddSuccessColumnTo(); AddAttemptsColumnTo(); AddSkippedColumnTo(); AddTrialTimeColumnTo(); }