Skip to main content

My Parent

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

My Parent block

Description

The My Parent block is a reference to the agent that created the agent that is currently executing the code. This 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

This block has no inputs.

parent

Example

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

My Parent example code

Notes

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

  • Me - References the agent executing the code
  • Delete Agent - Can be used with my parent to delete the parent agent