1

I have two conditions that I am unable to implement in NL.

Consider the following scenario.

I have cities as turtles. Each patch has one turtle i.e. one city.

Under certain conditions I want to split a city into two but have it visually appear as only taking the space of one city i.e. one patch. Visual Summary: two turtles as cities on one patch.

Under certain conditions I want to merge two cities in neighboring patches. I want them to then exist as one city i.e one turtle, but to visually occupy the space of two patches. visual summary: One turtle as one city on the space of two patches.

Any ideas on how I can achieve this?

Thank you!

AEA
  • 83
  • 6
  • What do you mean by "appears visually as two patches" or "appears visually as ONE patch"? Patches in NetLogo are, by default, just a black background. They don't _appear as_ anything. Maybe you can show us a screenshot? (Or make a mock up with a drawing program?) – Nicolas Payette Aug 12 '14 at 14:59
  • Also: you cannot "split" an agent, but you can ask one to [`hatch`](http://ccl.northwestern.edu/netlogo/docs/dictionary.html#hatch) another. And you can't "merge" two agents, but you can ask [`one-of`](http://ccl.northwestern.edu/netlogo/docs/dictionary.html#one-of) them to [`die`](http://ccl.northwestern.edu/netlogo/docs/dictionary.html#die). – Nicolas Payette Aug 12 '14 at 15:02
  • Many thanks again, Nicolas. I want to visualize the agents as patches. So I have created the breed/agent with shape "square" and created one agent per patch. Using the hatch and (one-of and die combo) I should be able to achieve my "split" and "merge" of the agents. – AEA Aug 12 '14 at 15:24
  • However, in the case of the "split" they will both be on ONE patch, while I wuld wnat them on two patches. In the case of the "merge" I would want them to be one patch, but here it appears there will be anempty atch for the one that was killed. So the issue is how to use hatch to create one more agent and keep the two agents on separate but contiguous patches. The second issue is how to use one-of and -die to create just one agent (by killing one of two agents) but have the remaining agent live on a patch that occupies the space for both previously living agents. Thank you. – AEA Aug 12 '14 at 15:24
  • When you say split, do you want the resultant pair of "patches" to occupy the same amount of space as the previous single patch, i.e. the square becomes two rectangles, or do you mean that the agent becomes two agents, and one of the agents moves to an adjacent square? in other words, is this a process of adding and removing detail? – TurtleZero Aug 12 '14 at 16:55
  • A split would mean: 1. One agent on one patch becomes two agents on two different patches. This is because I only want one agent per patch. This matches what you said above: "the agent becomes two agents, and one of the agents moves to an adjacent square" as long as both squares occupy only the space of ONE patch - the initial patch. Thank you. – AEA Aug 12 '14 at 17:07
  • Conversely, a merger would mean: One agent on one patch merges with another agent on another patch to leave ONE agent on ONE patch occupying the space of the TWO previous patches. – AEA Aug 12 '14 at 17:09
  • We need to define terms. In Netlogo a "patch" is: * Always a square * Fixed in location (it cannot move) * Fixed in size (it cannot change size) – TurtleZero Aug 12 '14 at 17:21
  • We need to define terms. In Netlogo a "patch" is: * Always a square * Defined by the center point (0,0);(4,-5) * Fixed in location * Fixed in size Agents (i.e. turtles) * Are movable * Have a shape that has a size * The shape scales with the size equally in all directions. So, an agent can't split, then move to two "patches" that are on the "same patch" That doesn't make sense. Use a different word than patches for the area occupied by the agent. Perhaps create a drawing that shows a before and after of what merging and dividing look like. That would help everyone understand what you mean. – TurtleZero Aug 12 '14 at 17:31
  • Given this Netlogo restriction, then perhaps the following would suffice: – AEA Aug 12 '14 at 17:37
  • Given this Netlogo restriction, then perhaps the following would suffice: 1. SPLIT: One agent with square shape on one patch splits into two agents of rectangular shape on the original square shaped patch. 2. MERGE: One agent on one patch "marries" an agent on an adjacent patch. The new couple is: ONE agent on ONE patch or if NetLogo allows (and preferably), ONE agent occupying TWO patches and as such a larger area to visually show that a merger has occurred. Thank you. – AEA Aug 12 '14 at 17:44
  • Stack Overflow permits editing questions. It would help if you went back and rewrote your question to be clearer. It's hard to piece together from the series of comments. – Seth Tisue Aug 13 '14 at 11:12

0 Answers0