function [H,ny]=init_hyperstate(N, n_grid, apriori, mode)
%OK
if mode ==0
    dim=2;
    H=zeros(N,n_grid^dim,dim);  %prostor hyperstavu - kazdy bod ma souradnice (y, b, P)
    ny=zeros(N,n_grid^dim);  %nejlepsi nalezena rozhodnuti - pocatecni strategie =0
    %ny=abs(rand(N-1,n_grid^dim));  

    %nastavi H0
    step_eta0=apriori.eta0_range/(n_grid-1)*2;
    min_eta0=apriori.eta0-apriori.eta0_range;
    step_beta0=apriori.beta0_range/(n_grid-1)*2;
    min_beta0=apriori.beta0-apriori.beta0_range;
    for i=1:size(H,2)
        H(1,i,1)=min_eta0+step_eta0*(index(i,n_grid,1)-1);
        H(1,i,2)=min_beta0+step_beta0*(index(i,n_grid,2)-1);
       % plot(H(1,:,1),H(1,:,2),'r.'); hold on
    end
else
    [H ny]=load_H;
end


