--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.
To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.
--
Thanks Patrick! for taking the time to give the code example. Accuracy is secondary at the moment so really appreciate having the capability.... Understanding the concepts is my focus at the moment. To that end I wish to make sure I understand the algorithm behind your example code.. :-)I summarise below:For the "outer "shops
1) Create "virtual perimeter" polylines from polygon geometry - Using "shape - 3 "as offset // this is actually negative buffer of the whole shape, in your case, a building, so you get a polygon that is 3 meters into the shape.2) Compile list of location points. Define a location point (x, y) for each shop agent. // for the negative-buffered shape in step1, you will have a perimeter, and the points (shops) are placed equidistant at every 1/7th position of the whole perimeter. so 7 shops. No need to worry about coordinates.
This is where I got lost. Can you explain how the X and Y parameters are derived? What is the significance of the divisor 7? I wish to have perimeter shops it equidistant to each other along the virtual perimeter - say 10 of them
3) Create shop agents from listFor the inner shops
1) Create virtual perimeter polyline from a default rectangle geometry. No offset? // virtual shape (rectangle) not perimeter. of course the shape will then have a perimeter. Patrick defines a rectangle of width 10m and length 20m. And he generalised it for all possible shapes of building by taking a minimum of 10m or minimum of shape of the building if less than 10; same with length/ height. So the rectangle is now 10x20. Then with to_squares, he divides the 10x20 rectangle into squares of size 5. this will result in 10/5 = 2 columns, and 20/5 =4 rows. That is what you see with the 8 shops in the center. As Patrick is asking (ask building) each building, the inner rectangle will form at the core/ center/ centroid of the building in concern. Again skipping the explicit definition/need for coordinates.
2) Compile list of location points. Again this is where I got lost. Can you explain how the x, y parameters are derived? I am assuming here that the shops agent are already equidistant from each other.3) Create shop agents from listThree further questions :-)a) The common parameters for each building polygon are the dimensions order (minX,minY, MinX, MaxY etc etc) and the centroid.Is it possible to derive the inner shop location points with reference to the centroid? My reasoning here is that I could create multiple inner shop "groups "with the same algorithm by simply changing the distance to and angle from the centroid? is this possible or is this getting too complicated?
b) I would like to have the shop number identified as a text box inside the shop geometry. I recall there has been a question/topic on this already in the group. I will look this up. // you can use draw statement "inside aspect" along with name, size and color. So it will be something like draw name size: 20 color:#blackc) Related to b) what is the naming numerical order convention for the shop Agents. i.e In my case where is shop agent 1 located on the building geometry? Will this consistently be at this location for every polygon shape? // The naming depends on the sequence of shops in the list. As this list is based on the perimeter of the inner or negative buffered shape, it will basically depend on the location of the very first starting point of the very first segment of your polygon (building), meaning it will depending on the first drawn segment of the polygon. I am not very sure, but this should be the case. Otherwise, the coordinate space in GAMA starts from top left.
Below is my understanding.
On Saturday, November 8, 2014 9:45:43 AM UTC+1, predic...@gmail.com wrote:
Thanks Patrick! for taking the time to give the code example. Accuracy is secondary at the moment so really appreciate having the capability.... Understanding the concepts is my focus at the moment. To that end I wish to make sure I understand the algorithm behind your example code.. :-)I summarise below:For the "outer "shops1) Create "virtual perimeter" polylines from polygon geometry - Using "shape - 3 "as offset // this is actually negative buffer of the whole shape, in your case, a building, so you get a polygon that is 3 meters into the shape.
2) Compile list of location points. Define a location point (x, y) for each shop agent. // for the negative-buffered shape in step1, you will have a perimeter, and the points (shops) are placed equidistant at every 1/7th position of the whole perimeter. so 7 shops. No need to worry about coordinates. /// Hmm Will this approach work for non symmetrical polygons? My reasoning is the various polyline lengths that make up the building agent polygon are mathematically independent so the equidistant algorithm would need to treat each polyline separately.Hence the need to go down to the coordinate level.
This is where I got lost. Can you explain how the X and Y parameters are derived? What is the significance of the divisor 7? I wish to have perimeter shops it equidistant to each other along the virtual perimeter - say 10 of them
3) Create shop agents from listFor the inner shops
1) Create virtual perimeter polyline from a default rectangle geometry. No offset? // virtual shape (rectangle) not perimeter. of course the shape will then have a perimeter. Patrick defines a rectangle of width 10m and length 20m. And he generalised it for all possible shapes of building by taking a minimum of 10m or minimum of shape of the building if less than 10; same with length/ height. So the rectangle is now 10x20. Then with to_squares, he divides the 10x20 rectangle into squares of size 5. this will result in 10/5 = 2 columns, and 20/5 =4 rows. That is what you see with the 8 shops in the center. As Patrick is asking (ask building) each building, the inner rectangle will form at the core/ center/ centroid of the building in concern. Again skipping the explicit definition/need for coordinates. /// Ok. This explanation is helpful. I note your comment about the inner rectangle geometry forming at the centroid of the building polygon. Does this fact lead to answering my question a) below if I wished to create multiple rectangular geometries ("enclosing" the shop agents)? In this case the rectangular geometries could be offset by various distances and angles from the single centroid coordinates.
2) Compile list of location points. Again this is where I got lost. Can you explain how the x, y parameters are derived? I am assuming here that the shops agent are already equidistant from each other.3) Create shop agents from listThree further questions :-)a) The common parameters for each building polygon are the dimensions order (minX,minY, MinX, MaxY etc etc) and the centroid.Is it possible to derive the inner shop location points with reference to the centroid? My reasoning here is that I could create multiple inner shop "groups "with the same algorithm by simply changing the distance to and angle from the centroid? is this possible or is this getting too complicated?
b) I would like to have the shop number identified as a text box inside the shop geometry. I recall there has been a question/topic on this already in the group. I will look this up. // you can use draw statement "inside aspect" along with name, size and color. So it will be something like draw name size: 20 color:#black /// Thanks!c) Related to b) what is the naming numerical order convention for the shop Agents. i.e In my case where is shop agent 1 located on the building geometry? Will this consistently be at this location for every polygon shape? // The naming depends on the sequence of shops in the list. As this list is based on the perimeter of the inner or negative buffered shape, it will basically depend on the location of the very first starting point of the very first segment of your polygon (building), meaning it will depending on the first drawn segment of the polygon. I am not very sure, but this should be the case. Otherwise, the coordinate space in GAMA starts from top left. /// That was my conclusion too. I was looking more for assurance that there would be consistency across multiple building polygons. I note from Patricks' example using the "hover mouse" display inspection that the numbering goes anticlockwise for the perimeter shop agents for one building then goes to the next building geometry to number the second set of perimeter shop agents then comes back to the first building geometry to number the "inner shops" of the first building geometry. My preference is to keep the shop agent numbering sequential within each building geometry. Whew that took more to explain than I expected....!