%LoadCadrePaths -- a script that adds the necessary paths to work with CaDRE 
%    To Use: You can use MATLAB's run command to run this script from any directory.
%			 It must be stored in the top Cadre folder to function properly.

curr_dir = pwd;
if(ispc)
	TOOLS_PATH = strcat(curr_dir,'\Tools');
	ARGS_PATH = strcat(curr_dir,'\Tools\DreamArgs');
	UTIL_PATH = strcat(curr_dir,'\Tools\DreamUtil');
	MODELS_PATH = strcat(curr_dir,'\Models');
	EXPERIMENTS_PATH = strcat(curr_dir,'\Experiments');
else
	TOOLS_PATH = strcat(curr_dir,'/Tools');
	ARGS_PATH = strcat(curr_dir,'/Tools/DreamArgs');
	UTIL_PATH = strcat(curr_dir,'/Tools/DreamUtil');
	MODELS_PATH = strcat(curr_dir,'/Models');
	EXPERIMENTS_PATH = strcat(curr_dir,'/Experiments');
end



if(~exist(TOOLS_PATH,'dir'))
	error(['Could not find Tools path: ',TOOLS_PATH,' doesn''t exist.']); end
if(~exist(ARGS_PATH,'dir'))
	error(['Could not find Args path: ',ARGS_PATH,' doesn''t exist.']); end
if(~exist(UTIL_PATH,'dir'))
	error(['Could not find Util path: ',UTIL_PATH,' doesn''t exist.']); end
if(~exist(MODELS_PATH,'dir'))
	error(['Could not find Models path: ',MODELS_PATH,' doesn''t exist.']); end
if(~exist(EXPERIMENTS_PATH,'dir'))
	error(['Could not find Experiments path: ',EXPERIMENTS_PATH,' doesn''t exist.']); end
addpath(TOOLS_PATH, ARGS_PATH, UTIL_PATH, MODELS_PATH, EXPERIMENTS_PATH, '-END'); 
clear TOOLS_PATH ARGS_PATH UTIL_PATH MODELS_PATH EXPERIMENTS_PATH curr_dir;
