

% test if this generation is the first after the initialization:
vTest1 = evalResults(end,sodaPar.iterCol)==sodaPar.nSamples+sodaPar.nOffspring;

% test if this generation id the first after a resume:
vTest2 = (exist('nRecords','var')==1 && nModelEvals == nRecords-nTrownAway);

% test if this script is called from the base workspace:
callStack = dbstack;
vTest3 = numel(callStack)==1;

if vTest1 || vTest2 || vTest3 
    
    % if any of these tests are true, organize the layout of the screen
    % according to:

    sodaSubplotScreen(1,2,1,'figureNumber',1)    
    sodaSubplotScreen(1,2,2,'figureNumber',2)
end

clear vTest1
clear vTest2
clear vTest3


figure(1)
clf
sodaMatrixOfScatter(sodaPar,'par-obj',sequences,metropolisRejects,'hideBadScore',true)


figure(2)
clf
sodaPlotSeq(sodaPar,sequences,metropolisRejects,'plotMode','subaxes','checkered',true)



drawnow