My Parent: Difference between revisions

From StarLogo Nova Wiki
(updates from Blockument)
(Marked this version for translation)
 
Line 20: Line 20:
<code>parent</code>
<code>parent</code>


==Example==
==Example== <!--T:10-->


<!--T:11-->
[[File:my_parent_example.gif|alt=My Parent example gif|thumb]]
[[File:my_parent_example.gif|alt=My Parent example gif|thumb]]
[[File:my_parent_example.png|alt=My Parent example code|thumb]]
[[File:my_parent_example.png|alt=My Parent example code|thumb]]


<!--T:12-->
This is a model of follow the leader.  Each time that the new duckling button is pressed, the newest ducking (shown in pink) creates a new duckling agent.  We observe that the ducklings travel in a line since each agent follows its parent.
This is a model of follow the leader.  Each time that the new duckling button is pressed, the newest ducking (shown in pink) creates a new duckling agent.  We observe that the ducklings travel in a line since each agent follows its parent.


<!--T:13-->
<strong>Note:</strong> The original duckling of size two does not follow its parent (The World).  If it did, it would simply continue to face toward center.
<strong>Note:</strong> The original duckling of size two does not follow its parent (The World).  If it did, it would simply continue to face toward center.



Latest revision as of 18:22, 11 August 2023

Other languages:
take camera block

Refers to the agent who created the agent that is calling the block.

my parent is a code block part of the agents drawer.

Usage

my parent refers to the agent that created the agent that is currently executing the code.

Syntax

parent

Example

My Parent example gif
My Parent example code

This is a model of follow the leader. Each time that the new duckling button is pressed, the newest ducking (shown in pink) creates a new duckling agent. We observe that the ducklings travel in a line since each agent follows its parent.

Note: The original duckling of size two does not follow its parent (The World). If it did, it would simply continue to face toward center.

Related Blocks

Relevant Video Resources

Relevant Activities