MDP Toolbox for MATLAB |
mdp_check
Checks the validity of a MDP.
Syntax
error_msg = mdp_check (P, R)
Description
mdp_check checks whether the MDP defined by
the transition probability array (P) and the reward matrix (R) is valid.
If P and R are correct, the function returns an empty error message.
In the opposite case, the function returns an
error message describing the problem.
Arguments
P can be a 3 dimensions array (SxSxA) or a cell array (1xA), each cell containing a sparse matrix (SxS).
R can be a 3 dimensions array (SxSxA) or a cell array (1xA), each cell containing a sparse matrix (SxS) or a 2D array (SxA) possibly sparse.
Evaluation
error_msg is a character string which is empty if the MDP is valid. In the opposite case, the variable contains problem
information.
Example
>> P(:,:,1) = [ 0.5 0.5;   0.8 0.2 ];
>> P(:,:,2) = [ 0 1;   0.1 0.9 ];
>> R = [ 5 10;   -1 2 ];
>> error_msg = mdp_check (P, R)
error_msg =
       ''
In the above example, P can be a cell array containing sparse matrices:
>> P{1} = sparse([ 0.5 0.5 0.8 0.2 ]);
>> P{2} = sparse([ 0 1;  0.1 0.9 ]);
The function call is unchanged.
MDP Toolbox for MATLAB |