Specifying dispersal distances for turtles in Netlogo
So for part of my model, I want my turtles (in this case, deer, specifically juvenile female deer) to "disperse" according to certain criteria. Here is what I have so far:
to move-dispersing-femjuvs
ask femjuvs [
let natal-range patches in-radius 5
let density (count femadults-on natal-range + count maleadults-on natal-
range + count femjuvs-on natal-range + count malejuvs-on natal-range +
count infants-on natal-range)
let chance-disperse 1 / (1 + exp(2.051 - (0.002605 * density)))
if (random-float 1.001 < chance-disperse) [
let mean-distance (18.703 + (0.02533 * density))
I believe this will give me the proportion of the female juveniles that will disperse, as well as the mean dispersal distance, taken from literature (I realize the if statement is incomplete, this is where I'm stuck). My question is, how do I get the "femjuvs" who are dispersing to actually move? They would move until they reach an unoccupied patch in a radius that does not overlap the "natal range". Ideally, I would want all of the distances of the femjuvs who do disperse to have a mean of "mean-distance". I have "dispersal-distance" as a "femjuvs-own" variable, but I haven't set it to any value.
Any help with any part of this problem is appreciated. Thank you!
distance netlogo mean
add a comment |
So for part of my model, I want my turtles (in this case, deer, specifically juvenile female deer) to "disperse" according to certain criteria. Here is what I have so far:
to move-dispersing-femjuvs
ask femjuvs [
let natal-range patches in-radius 5
let density (count femadults-on natal-range + count maleadults-on natal-
range + count femjuvs-on natal-range + count malejuvs-on natal-range +
count infants-on natal-range)
let chance-disperse 1 / (1 + exp(2.051 - (0.002605 * density)))
if (random-float 1.001 < chance-disperse) [
let mean-distance (18.703 + (0.02533 * density))
I believe this will give me the proportion of the female juveniles that will disperse, as well as the mean dispersal distance, taken from literature (I realize the if statement is incomplete, this is where I'm stuck). My question is, how do I get the "femjuvs" who are dispersing to actually move? They would move until they reach an unoccupied patch in a radius that does not overlap the "natal range". Ideally, I would want all of the distances of the femjuvs who do disperse to have a mean of "mean-distance". I have "dispersal-distance" as a "femjuvs-own" variable, but I haven't set it to any value.
Any help with any part of this problem is appreciated. Thank you!
distance netlogo mean
add a comment |
So for part of my model, I want my turtles (in this case, deer, specifically juvenile female deer) to "disperse" according to certain criteria. Here is what I have so far:
to move-dispersing-femjuvs
ask femjuvs [
let natal-range patches in-radius 5
let density (count femadults-on natal-range + count maleadults-on natal-
range + count femjuvs-on natal-range + count malejuvs-on natal-range +
count infants-on natal-range)
let chance-disperse 1 / (1 + exp(2.051 - (0.002605 * density)))
if (random-float 1.001 < chance-disperse) [
let mean-distance (18.703 + (0.02533 * density))
I believe this will give me the proportion of the female juveniles that will disperse, as well as the mean dispersal distance, taken from literature (I realize the if statement is incomplete, this is where I'm stuck). My question is, how do I get the "femjuvs" who are dispersing to actually move? They would move until they reach an unoccupied patch in a radius that does not overlap the "natal range". Ideally, I would want all of the distances of the femjuvs who do disperse to have a mean of "mean-distance". I have "dispersal-distance" as a "femjuvs-own" variable, but I haven't set it to any value.
Any help with any part of this problem is appreciated. Thank you!
distance netlogo mean
So for part of my model, I want my turtles (in this case, deer, specifically juvenile female deer) to "disperse" according to certain criteria. Here is what I have so far:
to move-dispersing-femjuvs
ask femjuvs [
let natal-range patches in-radius 5
let density (count femadults-on natal-range + count maleadults-on natal-
range + count femjuvs-on natal-range + count malejuvs-on natal-range +
count infants-on natal-range)
let chance-disperse 1 / (1 + exp(2.051 - (0.002605 * density)))
if (random-float 1.001 < chance-disperse) [
let mean-distance (18.703 + (0.02533 * density))
I believe this will give me the proportion of the female juveniles that will disperse, as well as the mean dispersal distance, taken from literature (I realize the if statement is incomplete, this is where I'm stuck). My question is, how do I get the "femjuvs" who are dispersing to actually move? They would move until they reach an unoccupied patch in a radius that does not overlap the "natal range". Ideally, I would want all of the distances of the femjuvs who do disperse to have a mean of "mean-distance". I have "dispersal-distance" as a "femjuvs-own" variable, but I haven't set it to any value.
Any help with any part of this problem is appreciated. Thank you!
distance netlogo mean
distance netlogo mean
asked Nov 14 '18 at 17:12
AmandaVAmandaV
115
115
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Possibly use: "setxy" or "forward"
setxy
If the aim is to update a deer position over time, calculating its coordinates, setxy might be a good option. This isn't so much moving as it is adjusting its coordinates.
ask femjuvs [ setxy <xcor> <ycor> ] ; example
ask femjuvs [ let x-coordinate <some-long-computation>
let y-coordinate <some-longer-computation>
setxy x-coordinate y-coordinate ]
forward
To move a deer, there is a function called "forward" that can be invoked by femjuvs (turtle/breed context):
ask femjuvs [ forward <number> ]
It would move femjuvs n spaces in the direction it is facing, where is the number specified.
Possible additions: (* - relevant functions)
to move-dispersing-femjuvs
ask femjuvs [
let natal-range patches in-radius 5
let density (count femadults-on ...) ; shortened for space
* forward 1 ; move forward one
]
...
end
Also, if dispersing from a given point or coordinate is necessary, having the deer face the point and turn it 180 degrees could work.
ask femjuvs [ face <random-point> ; or facexy <xcor> <ycor>
left 180 ] ; turn the opposite direction
ask femjuvs [ forward 1 ] ; disperse
One thing to note is that if the direction is not set by the developer, NetLogo will store a direction beforehand, which may or may not be helpful.
More details in : https://ccl.northwestern.edu/netlogo/docs/dictionary.html
Thanks you! The fd is definitely the way to go, I'm thinking I can use a while loop to keep the femjuv moving forward 1 until it reaches a patch without any turtles and also goes until it reaches it's mean distance.
– AmandaV
Nov 14 '18 at 20:05
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53305492%2fspecifying-dispersal-distances-for-turtles-in-netlogo%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Possibly use: "setxy" or "forward"
setxy
If the aim is to update a deer position over time, calculating its coordinates, setxy might be a good option. This isn't so much moving as it is adjusting its coordinates.
ask femjuvs [ setxy <xcor> <ycor> ] ; example
ask femjuvs [ let x-coordinate <some-long-computation>
let y-coordinate <some-longer-computation>
setxy x-coordinate y-coordinate ]
forward
To move a deer, there is a function called "forward" that can be invoked by femjuvs (turtle/breed context):
ask femjuvs [ forward <number> ]
It would move femjuvs n spaces in the direction it is facing, where is the number specified.
Possible additions: (* - relevant functions)
to move-dispersing-femjuvs
ask femjuvs [
let natal-range patches in-radius 5
let density (count femadults-on ...) ; shortened for space
* forward 1 ; move forward one
]
...
end
Also, if dispersing from a given point or coordinate is necessary, having the deer face the point and turn it 180 degrees could work.
ask femjuvs [ face <random-point> ; or facexy <xcor> <ycor>
left 180 ] ; turn the opposite direction
ask femjuvs [ forward 1 ] ; disperse
One thing to note is that if the direction is not set by the developer, NetLogo will store a direction beforehand, which may or may not be helpful.
More details in : https://ccl.northwestern.edu/netlogo/docs/dictionary.html
Thanks you! The fd is definitely the way to go, I'm thinking I can use a while loop to keep the femjuv moving forward 1 until it reaches a patch without any turtles and also goes until it reaches it's mean distance.
– AmandaV
Nov 14 '18 at 20:05
add a comment |
Possibly use: "setxy" or "forward"
setxy
If the aim is to update a deer position over time, calculating its coordinates, setxy might be a good option. This isn't so much moving as it is adjusting its coordinates.
ask femjuvs [ setxy <xcor> <ycor> ] ; example
ask femjuvs [ let x-coordinate <some-long-computation>
let y-coordinate <some-longer-computation>
setxy x-coordinate y-coordinate ]
forward
To move a deer, there is a function called "forward" that can be invoked by femjuvs (turtle/breed context):
ask femjuvs [ forward <number> ]
It would move femjuvs n spaces in the direction it is facing, where is the number specified.
Possible additions: (* - relevant functions)
to move-dispersing-femjuvs
ask femjuvs [
let natal-range patches in-radius 5
let density (count femadults-on ...) ; shortened for space
* forward 1 ; move forward one
]
...
end
Also, if dispersing from a given point or coordinate is necessary, having the deer face the point and turn it 180 degrees could work.
ask femjuvs [ face <random-point> ; or facexy <xcor> <ycor>
left 180 ] ; turn the opposite direction
ask femjuvs [ forward 1 ] ; disperse
One thing to note is that if the direction is not set by the developer, NetLogo will store a direction beforehand, which may or may not be helpful.
More details in : https://ccl.northwestern.edu/netlogo/docs/dictionary.html
Thanks you! The fd is definitely the way to go, I'm thinking I can use a while loop to keep the femjuv moving forward 1 until it reaches a patch without any turtles and also goes until it reaches it's mean distance.
– AmandaV
Nov 14 '18 at 20:05
add a comment |
Possibly use: "setxy" or "forward"
setxy
If the aim is to update a deer position over time, calculating its coordinates, setxy might be a good option. This isn't so much moving as it is adjusting its coordinates.
ask femjuvs [ setxy <xcor> <ycor> ] ; example
ask femjuvs [ let x-coordinate <some-long-computation>
let y-coordinate <some-longer-computation>
setxy x-coordinate y-coordinate ]
forward
To move a deer, there is a function called "forward" that can be invoked by femjuvs (turtle/breed context):
ask femjuvs [ forward <number> ]
It would move femjuvs n spaces in the direction it is facing, where is the number specified.
Possible additions: (* - relevant functions)
to move-dispersing-femjuvs
ask femjuvs [
let natal-range patches in-radius 5
let density (count femadults-on ...) ; shortened for space
* forward 1 ; move forward one
]
...
end
Also, if dispersing from a given point or coordinate is necessary, having the deer face the point and turn it 180 degrees could work.
ask femjuvs [ face <random-point> ; or facexy <xcor> <ycor>
left 180 ] ; turn the opposite direction
ask femjuvs [ forward 1 ] ; disperse
One thing to note is that if the direction is not set by the developer, NetLogo will store a direction beforehand, which may or may not be helpful.
More details in : https://ccl.northwestern.edu/netlogo/docs/dictionary.html
Possibly use: "setxy" or "forward"
setxy
If the aim is to update a deer position over time, calculating its coordinates, setxy might be a good option. This isn't so much moving as it is adjusting its coordinates.
ask femjuvs [ setxy <xcor> <ycor> ] ; example
ask femjuvs [ let x-coordinate <some-long-computation>
let y-coordinate <some-longer-computation>
setxy x-coordinate y-coordinate ]
forward
To move a deer, there is a function called "forward" that can be invoked by femjuvs (turtle/breed context):
ask femjuvs [ forward <number> ]
It would move femjuvs n spaces in the direction it is facing, where is the number specified.
Possible additions: (* - relevant functions)
to move-dispersing-femjuvs
ask femjuvs [
let natal-range patches in-radius 5
let density (count femadults-on ...) ; shortened for space
* forward 1 ; move forward one
]
...
end
Also, if dispersing from a given point or coordinate is necessary, having the deer face the point and turn it 180 degrees could work.
ask femjuvs [ face <random-point> ; or facexy <xcor> <ycor>
left 180 ] ; turn the opposite direction
ask femjuvs [ forward 1 ] ; disperse
One thing to note is that if the direction is not set by the developer, NetLogo will store a direction beforehand, which may or may not be helpful.
More details in : https://ccl.northwestern.edu/netlogo/docs/dictionary.html
answered Nov 14 '18 at 19:26
javylowjavylow
837
837
Thanks you! The fd is definitely the way to go, I'm thinking I can use a while loop to keep the femjuv moving forward 1 until it reaches a patch without any turtles and also goes until it reaches it's mean distance.
– AmandaV
Nov 14 '18 at 20:05
add a comment |
Thanks you! The fd is definitely the way to go, I'm thinking I can use a while loop to keep the femjuv moving forward 1 until it reaches a patch without any turtles and also goes until it reaches it's mean distance.
– AmandaV
Nov 14 '18 at 20:05
Thanks you! The fd is definitely the way to go, I'm thinking I can use a while loop to keep the femjuv moving forward 1 until it reaches a patch without any turtles and also goes until it reaches it's mean distance.
– AmandaV
Nov 14 '18 at 20:05
Thanks you! The fd is definitely the way to go, I'm thinking I can use a while loop to keep the femjuv moving forward 1 until it reaches a patch without any turtles and also goes until it reaches it's mean distance.
– AmandaV
Nov 14 '18 at 20:05
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53305492%2fspecifying-dispersal-distances-for-turtles-in-netlogo%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown