s.territory(1)		      Grass User's Manual		s.territory(1)



NNAAMMEE
       _s_._t_e_r_r_i_t_o_r_y - Calculates territory consumption for animal based on dis-
       tributed positions.

       _(_G_R_A_S_S _S_i_t_e_s _P_r_o_g_r_a_m_)

SSYYNNOOPPSSIISS
       ss..tteerrrriittoorryy

       ss..tteerrrriittoorryy hheellpp

       ss..tteerrrriittoorryy   rraasstt==_v_a_l_u_e    ssiitteess==_n_a_m_e	 [oouuttppuutt==_n_a_m_e]	  [ccllaaiimm==_n_a_m_e]
       [tthhrreesshh==_n_a_m_e] [iinnccrr==_n_a_m_e]



DDEESSCCRRIIPPTTIIOONN
       _s_._t_e_r_r_i_t_o_r_y  calculates	territory consumption for animal based on dis-
       tributed positions.

OOPPTTIIOONNSS
   PPaarraammeetteerrss::
       rraasstt==_v_a_l_u_e
	      Name of incidence or density file


       ssiitteess==_n_a_m_e
	      Name of sites file with threshold locations

       oouuttppuutt==_n_a_m_e
	      Name of new sites file to contain radius

       ccllaaiimm==_n_a_m_e
	      Simultaneous growth map. (ignored if site output given)

       tthhrreesshh==_n_a_m_e
	      Field in sites file containing thresholds. Threshold  is	target
	      amount of resources that site wants to consume

       iinnccrr==_n_a_m_e
	      Field  in  sites file containing radius increment (meters). incr
	      is radius increment for each iteration

		    - default incr is min distance between cells

		    - not currently implemented for sequential, only simult.


NNOOTTEESS
       OOUUTTPPUUTT is a sites file containing:

	   easting|northing|#cat %threshold %radius

       where radius is the minimum radius of a circle which  surrounds	enough
       cells in the incidence map to sum up to threshold.

       If neither a sites output file nor a claim map is named, output is sim-
       ply the radius followed by a newline for each site (for easier  use  in
       scripts).

       EEXXAAMMPPLLEESS::

		     Lion's territory

	      you  have sites for lion's lairs with food needs as the "thresh-
	      old"

	      you have an incidence map for  frequency of prey or hunting suc-
	      cess probability (Kg/week or something)

	      s.territory  creates  a  circular  range for each lair which you
	      might use to create vector or raster files and predict areas  of
	      conflict in overlapping "territories"



		     School children

	      you  have sites for schools with school capacity as the "thresh-
	      old"

	      you have population density maps for school-age children

	      s.territory creates ranges for each  school  that  encompass  an
	      area in which enough children live to fill the school


       AALLGGOORRIITTHHMM::



	   radius increment set to lesser of ns_res and ew_res

	   ( or incr if given )

	   for each site

	   {

	     for (radius = increment; cells remaining; incr+=incr)

	     {


       sum incidence cell centers which fall within radius


       if >= threshold, break

	     }

	   }



		      _i_m_p_l_e_m_e_n_t_a_t_i_o_n _(_f_a_s_t_, _h_i_g_h _m_e_m_o_r_y_)_:

		     read density map into buffer

		     use additional buffer to calculate distances(squared)

		     to current site (as needed)

		     if distance_squared > prev radius, add it in


		      _i_m_p_l_e_m_e_n_t_a_t_i_o_n   _f_o_r   _s_i_m_u_l_t_a_n_e_o_u_s  _g_r_o_w_t_h  _(_m_u_c_h  _m_u_c_h
		     _s_l_o_w_e_r_)_:

		     reads density map, then repeatedly traverses

		     output map looking for null cells, then checking to

		     see if it's in any of the sites current radius, etc.


		     _a_l_t_e_r_n_a_t_i_v_e_s_:
       1. let max increase until entire map is covered,

	      using zero for outside incidence

	      >>> currently implemented

	   2. use a rectangular(square) territory rather than circle?

	   3. somehow "weight" expansion toward successful areas

	   4. save combined nearest distances map



       ADDENDUM

       Think about:

       1.  Make already claimed territory uninhabitable - as each site is

	   processed, zero out resources within territory.

	   >>> This can be done in scripts, using masks. (slower though)

       2.  Instead of just going through in order, attack them all at the

	   same time, zeroing out resources as it goes and assigning a

	   category value to a "claim" map.



AAUUTTHHOORR
       Bill Brown, GMSL, 1999

       _L_a_s_t _c_h_a_n_g_e_d_: _$_D_a_t_e_: _2_0_0_2_/_0_1_/_2_5 _0_5_:_4_5_:_3_5 _$



GRASS 5.0							s.territory(1)
