


% Main script used to create all the Agreement Plot figures. 
clearvars
close all
clc

tstart = tic;

Color_1 = [0, 1, 1];
Color_2 = [1, 0, 1];
OriginalGreenColor = (1/255)*[0,128,0];
OriginalOrangeColor = (1/255)*[255,140,0];

OriginalPurpleColor_1 = (1/255)*[139,0,139];
OriginalPurpleColor_2 = (1/255)*[128,0,128];

NodeColor = (1/255)*[220,20,60];

FigureSize = [-974 201 607 509];
Fig = figure('position', FigureSize);

CreateAllFigures = 0;
demo = 0;

desLineWidth_Digraph = 1;
ArrowSize = 1.5;

load('InitialOpinions_100_agents.mat', 'AllInitialOpinions')
load('RequiredFigures.mat', 'AllFigures')

IntermediateDigraphIDs = [3, 8, 13, 18, 23, 28, 33, 38, 43];

InitialOpinionIDs_small = [2495, 1217, 2022, 5112, 287]; 
InitialOpinionIDs_medium = [5081, 3057, 318, 1248, 1877, 4364, 82, 229, 899, 3450, 3889, 3443, 2397, 2907, 1575];
InitialOpinionIDs_large = 1:size(AllInitialOpinions,1); 

for id_model = 1:4 

    if id_model == 2
        GreenColor = OriginalPurpleColor_1;
        OrangeColor = OriginalPurpleColor_2;
    else
        GreenColor = OriginalGreenColor;
        OrangeColor = OriginalOrangeColor;
    end

    Parameter_Initialization
    disp(' ')
    disp(' ')
    disp(' ')

    disp([ 9 'Figures ' ModelLabel ' model'])

    disp(' ')
    disp(' ')
    disp(' ')

    total_time = 50+1;
    
    Plot_1
    Plot_2
    Plot_3

    total_time = 1000+1;
    
    if ~exist([ModelLabel '_Plot_5_Data.mat'],'file')
        Plot_5_comp
    end
    Plot_5_plot

    if ~exist([ModelLabel '_Plot_4_Data.mat'],'file')
        Plot_4_comp
    end
    Plot_4_plot
    
    if ~exist([ModelLabel '_Plot_6_Data.mat'],'file')
        Plot_6_comp
    end
    Plot_6_plot

end


% Now, create the .tex files to display SOME figures (for the dissertation)
DissertationFigureTables

% Now, create the .tex files and figures corresponding to the digraphs
DigraphCharacteristics

telapsed = toc(tstart);
disp([ 9 'Time to execute the script = ' num2str(telapsed) 's' ])
















