123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- function [GD] = JA_CFs_quickness_games_distribution(relationship)
- % the function spits 4 variables
- % 1. games_distribution
- % it spits out 13 numbers. From 2:13 they represent
- % how many SLOW responses will be provided by CF within each game
- % the first game is always the wash-out game (coded as -1)
- % fast games
- % 1 game: 2 out of 9 (non catch-trials)
- % 2 games: 3/9
- % 3 games: 4/9
- % slow games
- % 1 game: 7 out of 9 (non catch-trials)
- % 2 games: 6/9
- % 3 games: 5/9
- % 2. CF_slow_out_of_bounds
- % spits out the games in which, in a slow trial CF will be too slow (4 games)
- % 3. CF_fast_out_of_bounds
- % spits out the games in which, in a fast trial CF will be too fast (4 games)
- % 4. CF_catch_failing_game
- % spits out the game in which CF fails the catch trial (1 game)
- %% games distribution
- % repmat(number of slow responses, [times,1])
- games_distribution_tmp = cat(1,repmat(2,[1,1]),...
- repmat(3,[2,1]),...
- repmat(4,[3,1]),...
- repmat(5,[3,1]),...
- repmat(6,[2,1]),...
- repmat(7,[1,1]));
- % randomize order of the indices going from 1 to number of 'real' games(12)
- idx = randperm(length(games_distribution_tmp));
- % apply the new order to the new variable games_distribution
- games_distribution = games_distribution_tmp(idx);
- % add the washout game as the first game to the game_distribution variable with the 0 code
- games_distribution = cat(1,-1, games_distribution);
- %%
- fast_games = intersect(find(games_distribution > 0),find(games_distribution < 5));
- slow_games = intersect(find(games_distribution > 0),find(games_distribution >= 5));
- wash_out_games = games_distribution < 0;
- games_distribution_names = cell(length(games_distribution),1);
- games_distribution_names(fast_games) = {'fast'};
- games_distribution_names(slow_games) = {'slow'};
- games_distribution_names(wash_out_games) = {'wash_out'};
- %% CF_slow_out_of_bounds
- tmp = randperm(length(games_distribution_tmp))+1;
- CF_slow_out_of_bounds_games = tmp(1:4);
- %% CF_fast_out_of_bounds
- CF_fast_out_of_bounds_games = tmp(5:8);
- %% CF_catch_game_failing
- CF_catch_failing_game = tmp(9);
- %% outcome feedback information (to be used into JA_outcome_feedback)
- outcome_feedback_relative2SBJ = size(games_distribution_names,1);
- SBJ_wins_distribution = zeros(size(games_distribution_names,1),1);
- switch relationship
-
- case 'parallel'
- % note that washout game is always zero
- % permute randomly the order of wins and lost games
- SBJ_wins_idx_tmp = randperm(outcome_feedback_relative2SBJ-1)+1;
- SBJ_wins_idx = SBJ_wins_idx_tmp(1:(outcome_feedback_relative2SBJ-1)/2);
- SBJ_wins_distribution(SBJ_wins_idx) = 1;
-
- case 'competitive'
- SBJ_wins_idx = strcmp(games_distribution_names, 'slow');
- SBJ_wins_distribution(SBJ_wins_idx) = 1;
-
- case 'joint'
- SBJ_wins_idx = strcmp(games_distribution_names, 'fast');
- SBJ_wins_distribution(SBJ_wins_idx) = 1;
-
- case 'imagery'
- SBJ_wins_idx_tmp = randperm(outcome_feedback_relative2SBJ-1)+1;
- SBJ_wins_idx = SBJ_wins_idx_tmp(1:(outcome_feedback_relative2SBJ-1)/2);
- SBJ_wins_distribution(SBJ_wins_idx) = 1;
-
- case 'warming_up'
-
- case 'training'
-
- end
- %%
- GD.games_distribution = games_distribution;
- GD.games_distribution_names = games_distribution_names;
- GD.CF_slow_out_of_bounds_games = CF_slow_out_of_bounds_games;
- GD.CF_fast_out_of_bounds_games = CF_fast_out_of_bounds_games;
- GD.CF_catch_failing_game = CF_catch_failing_game;
- GD.SBJ_wins_distribution = SBJ_wins_distribution;
- end
|