<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:12pt"><div style="" class=""><span style="" class="">My objective is to perform a spatial simulated annealing schedule. It works as follows:</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;" class=""><span style="" class=""><br></span></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span style="" class="">1) generate a set of n points randomly positioned in the study area (v.random);</span></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span
 style="" class="">2) query values from raster maps (r.what);</span></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span style="" class="">3) calculate an statistic;</span></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span style="" class="">4) randomly perturb one randomly selected point;</span></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span style="" class="">   - the point has to fall withing the study area;</span></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif;
 background-color: transparent; font-style: normal;"><span style="" class="">5) go through 2-4 till the statistic meets a given criterion.</span><span style="" class=""></span></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><br><span style="" class=""></span></div><div class="" style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span style="" class="">Ideally, v.perturb would do step 4: allow for perturbing a single point and check if it still falls inside the study area. If the point falls outside the study area, then it should be forced to the closest position within the study area.<br></span></div><div style="" class=""> </div><div style="" class="">Alessandro Samuel-Rosa
<br style="" class="">---
<br style="" class="">Graduate School in Agronomy - Soil Science
<br style="" class="">Federal Rural University of Rio de Janeiro
<br style="" class="">Seropédica, Rio de Janeiro, Brazil
<br style="" class="">---
<br style="" class="">Guest Researcher at ISRIC - World Soil Information
<br style="" class="">Wageningen, the Netherlands
<br style="" class="">---
<br style="" class="">Homepage: soil-scientist.net   Skype: alessandrosamuel</div> <div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div class="" style="font-family: Courier New, courier, monaco, monospace, sans-serif; font-size: 12pt;"> <div class="" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div style="" class="" dir="ltr"> <font style="" class="" face="Arial" size="2"> Em Quinta-feira, 28 de Agosto de 2014 13:49, Moritz Lennert <mlennert@club.worldonline.be> escreveu:<br style="" class=""> </font> </div>  <br style="" class=""><br style="" class=""> <div style="" class="">On 27/08/14 00:12, Alessandro Samuel Rosa wrote:<br style="" class="" clear="none">> Dear GRASS GIS developers,<br style="" class="" clear="none">><br style="" class="" clear="none">> I am planning to use v.perturb to run a spatial simulated annealing<br
 style="" class="" clear="none">> exercise. Two drawbacks with v.perturb exist. First, "output vector<br style="" class="" clear="none">> points are not guaranteed to be contained within the current geographic<br style="" class="" clear="none">> region". Second, all vector points are perturbed together.<br style="" class="" clear="none">><br style="" class="" clear="none">> Is it very difficult to solve this issues?<br style="" class="" clear="none"><br style="" class="" clear="none">What exactly are your objectives ?<br style="" class="" clear="none"><br style="" class="" clear="none">You can use v.extract with the random= option or v.kcv+v.extract to <br style="" class="" clear="none">create a sample of points you can then perturb instead of perturbing all <div style="" class="" id="yqtfd49130"><br style="" class="" clear="none">points.</div><br style="" class="" clear="none"><br style="" class="" clear="none">To make sure your points
 still fall into the region, you can use <br style="" class="" clear="none">v.in.region to create a polygon representing the region, then v.select <br style="" class="" clear="none">within your sample those that fall into the polygon.<br style="" class="" clear="none"><br style="" class="" clear="none">Moritz<div style="" class="" id="yqtfd63153"><br style="" class="" clear="none"></div><br style="" class=""><br style="" class=""></div>  </div> </div>  </div> </div></body></html>