function [nextState, output] = feeder (state, input)
%feed when 1 or time passes
if ~(strcmp(input, 'absent'))
    switch(state)
        case 'happy'
            output = 'time passes';
            nextState = 'hungry';
        otherwise
            output = 'feed';
            nextState = 'happy';
        end
    else
    nextState = state;
    output = 'absent';
end