% Obstacle function:
% Author: K. Passino, Version: 1/25/01
function J=obstaclefunction(x,w1)

% An example function to represent sensed obstacles:

	J=...
		w1*max([exp(-0.8*((x(1,1)-20)^2+(x(2,1)-15)^2)),...
		exp(-0.8*((x(1,1)-8)^2+(x(2,1)-10)^2)),...
		exp(-0.8*((x(1,1)-10)^2+(x(2,1)-10)^2)),...
		exp(-0.8*((x(1,1)-12)^2+(x(2,1)-10)^2)),...
		exp(-0.8*((x(1,1)-24)^2+(x(2,1)-20)^2)),...
		exp(-0.8*((x(1,1)-18)^2+(x(2,1)-20)^2))]);

