function b = UR_exit_flag
% UR_exit_flag - checks if simulation should end (if file UR_EXIT exists)
% On input:
%     N/A
% On output:
%     b (Boolean): true if file UR_EXIT exists; else 0
% Call:
%     b = UR_exit_flag;
% Author:
%     T. Henderson
%     UU
%     Summer 2019
%

EXIT_F_NAME = 'UR_EXIT.txt';

b = 0;

files = dir('.');
num_files = length(files);
for f = 1:num_files
    f_name = files(f).name;
    if strcmp(f_name,EXIT_F_NAME)
        b = 1;
        return
    end
end
