function [new_agent] = SeekControl( t, dt, agent, k, coords, n, targetx, targety, w)
%UNTITLED Summary of this function goes here
%   Detailed explanation goes here
    x1 = agent(t-1, 1);
    y1 = agent(t-1, 2);
    v = agent(t-1, 3);
    theta1 = agent(t-1, 4);
    u1 = agent(t-1, 5);  
    
    if (abs(x1 - targetx) < 0.1 && abs(y1 - targety)<0.1)
        v=0;
    end
    
    theta2 = theta1 + u1*v*dt;
    agent(t, 1) = x1 + v*dt*cos(theta1);
    agent(t, 2) = y1 + v*dt*sin(theta1);
	agent(t, 3) = v;
	agent(t, 4) = theta2;
    agent(t, 5) = UkSeek(k, n, coords, targetx, targety, w);
    new_agent = agent;
end

