
load([ModelLabel '_Plot_4_Data.mat'], 'Plot_4_Results')

% Plot 4: 5000 Final opinion points: Different Agent Parameters

if id_model == 1
    DigraphIDs = 1;
else
    DigraphIDs = 1:size(InteractionNetworks,2);
end

disp([ 9 9 9 'Plot 4: 5000 Final opinion points: Different Agent Parameters PLOT'])

switch id_model
    case 1 
        DigraphIDs = 1;
    case 2
        DigraphIDs = 1:9;
    case 3
        DigraphIDs = IntermediateDigraphIDs;
    case 4
        DigraphIDs = IntermediateDigraphIDs;
end

InitialOpinionIDs = InitialOpinionIDs_small;
AgentParametersIDs = AgentParametersIDs_large;

local_counter = 0;
for id_di = 1:size(DigraphIDs,2)
    Aux_3_DigraphSelection

    for id_io = 1:size(InitialOpinionIDs,2)

        Aux_5_InitialOpinionSelection
        Aux_8_PlotPreparation

        local_counter = local_counter + 1;

        SingleNameFigure = [ ModelLabel '_ParametricCurve_4_id_io_' num2str(id_initial_opinion) '_id_di_' num2str(id_network) '.png' ];
        if CreateFigure(SingleNameFigure,AllFigures)

            
            disp([ 9 ' . ' num2str(local_counter) '/' num2str(size(DigraphIDs,2)*size(InitialOpinionIDs,2))])

            Plot_4_LocalResults = Plot_4_Results{local_counter}{1};

            for id_ap = 1:size(AgentParametersIDs,2)

                Aux_4_AgentParameterSelection
                % Aux_7_PredictedPlots

                x_value = Plot_4_LocalResults{id_ap}{1}(1);
                y_value = Plot_4_LocalResults{id_ap}{1}(2);
                LineColor = Plot_4_LocalResults{id_ap}{2};
                
                plot(x_value, y_value, 'o', 'LineWidth',4, 'color', LineColor, 'MarkerSize',7, 'MarkerEdgeColor',LineColor, 'MarkerFaceColor',LineColor), hold on

            end

            x_value = Plot_4_Results{local_counter}{3}(1);
            y_value = Plot_4_Results{local_counter}{3}(2);

            plot(x_value, y_value, 'o', 'LineWidth',4, 'color', GreenColor, 'MarkerSize',10, 'MarkerEdgeColor',OrangeColor, 'MarkerFaceColor',GreenColor), hold on

            Aux_9_PlotDetails

            exportgraphics(Fig, [ './Chap/Opinion_Tools/Figures/' ModelLabel '/Plot_4/' ModelLabel '_ParametricCurve_4_id_io_' num2str(id_initial_opinion) '_id_di_' num2str(id_network) '.png']), pause(0.1), clf

            % Aux_1_AgentParameterSuplot
            Aux_2_DigraphSubplot

            id_initial_opinion = Plot_4_Results{local_counter}{2}(1);
            id_network = Plot_4_Results{local_counter}{2}(2);

        else

            disp([ 9 'Figure skipped'])

        end


        
        

    end
end