clear;
clc;

datasetDir = '/Users/armin/Desktop/DML/graph\\ gen\\ proj/VotingDatasets_Nov15/Steam/FF60a_Steam_GM2_GR2_60/';
filePrefix = 'Steam_';
%netSizes = [2048 4096 5000 8192  16384 20000 25000 32768]; % 50000 75000 100000];
netSizes = [50000 75000]; %[2048 4096 8192 16384 32768]; % 10000 25000 50000 75000 100000];
debug = 0;

% convert ascii graph to .mat data graph
fprintf('Start prepareDataSet ...\n');

for nodes = netSizes
    prefix = sprintf('%s%s%d_%s',datasetDir,filePrefix,nodes,'*.txt');
    fprintf(prefix)
    files = [dir(prefix)];
    
    for i = 1:size(files,1)
        file = files(i).name;
        fprintf('SALAM')
        usrFile =  strfind(file, '.usr');
        matFile =  strfind(file, '.mat');
        if isempty(usrFile) && isempty(matFile)
            fprintf('dataSet %s ...\n',file);               
            [data] = LoadAsciiGraph(datasetDir, file, nodes, debug);
            %[edges] = SaveAsciiGraph(strcat(datasetDir,testDir), file, data);
            fprintf('SALAM')
            save(strcat(datasetDir,'matFormat/',file,'.mat'), 'data');
        end
    end
    fprintf('Completed Run.\n');
end

