function output_cell = get_policy_rules(xparam1,M_,options_,oo_,estim_params_,bayestopt_,dataset_,dataset_info),
% function output_cell = get_policy_rules(xparam1,M_,options_,oo_,estim_params_,bayestopt_,dataset_,dataset_info),
% Function called by execute_prior_posterior_function that generates
% policy functions for given set of parameters
% For input/output arguments, see the Dynare manual on posterior_function

% Copyright (C) 2016-22 Johannes Pfeifer
% 
%  This is free software: you can redistribute it and/or modify
%  it under the terms of the GNU General Public License as published by
%  the Free Software Foundation, either version 3 of the License, or
%  (at your option) any later version.
% 
%  It is distributed in the hope that it will be useful,
%  but WITHOUT ANY WARRANTY; without even the implied warranty of
%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%  GNU General Public License for more details.
% 
%  For a copy of the GNU General Public License,
%  see <http://www.gnu.org/licenses/>.

M_ = set_all_parameters(xparam1,estim_params_,M_);
options_.noprint=1;
options_=select_qz_criterium_value(options_);
[dr,info] = resol(0,M_,options_,oo_);
if ~info(1)
    output_cell={dr.ghx,dr.ghu};
else
    output_cell={[]};
end