% Project 1: simulation of agent which models simple creature
clear; correct=0;

for trial=1:1000
    x=creature_state();
    s=x+randn();
    
    %% perception model
    if (s<1.5) x_predict=1;
    elseif (s<3.65) x_predict=2;
    else x_predict=3;
    end
    
    %% calculate accuracy
    if (x==x_predict) correct=correct+1; end
end

disp(['percentage correct: ',num2str(correct/1000)]);