


% timing is fixed according to this vector 

% let's also fix coherence for now (e.g. Kelly & O'Connell, 2014)
% 6 of each direction-coherence level

dotInfo.cohLevels = [0.25, 0.35, 0.5, 0.7];
dotInfo.directions = [0 180]; % 1 - left, 2 - right

% TO DO: set random seed

distrib = repmat([1:8],1,6);
tmp_rand = randperm(numel(distrib));
distrib_rand = distrib(tmp_rand);

dotInfo.coh = NaN(1,numel(distrib_rand));
dotInfo.dir = NaN(1,numel(distrib_rand));
for indDis = 1:8
    if indDis <= 4
        indDir = 1;
        indCoh = indDis;
    else
        indDir = 2;
        indCoh = indDis-4;
    end;
    curDis = find(distrib_rand==indDis);
    dotInfo.coh(curDis) = dotInfo.cohLevels(indCoh);
    dotInfo.dir(curDis) = dotInfo.directions(indDir);
end;

dotInfo.timeTarget = 1.9; % target time in s
dotInfo.timeNontarget = [3.6, 6.6, 8.4]; % target time in s

tmp = []; tmp2 = [];
for indCoh = 1:numel(dotInfo.coh)
    tmp = [tmp, 0, dotInfo.coh(indCoh)];
    tmp2 = [tmp2, NaN, dotInfo.dir(indCoh)];
end;
% tmp = [tmp, 0];
% tmp2 = [tmp2, NaN];

dotInfo.coh = tmp;
dotInfo.dir = tmp2;

nonTargets = find(dotInfo.coh == 0);
Targets = find(dotInfo.coh ~= 0);

nontargetDur = repmat([1:3], 1, 16); % create vector for non-target duration
tmp_rand = randperm(numel(nontargetDur));
targetDur_rand = nontargetDur(tmp_rand);

dotInfo.presTime = NaN(1,numel(dotInfo.coh));
dotInfo.presTime(nonTargets) = dotInfo.timeNontarget(targetDur_rand);
dotInfo.presTime(Targets) = dotInfo.timeTarget;
