Agent: Difference between revisions

From StarLogo Nova Wiki
m (Little bit on code execution)
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
Agents are the backbone of StarLogo Nova. Agents are the objects commonly seen moving around [[SpaceLand]].
<languages/>
<translate>


== Creation & Deletion ==
Agents are the backbone of StarLogo Nova. Agents are the objects commonly seen moving around [[SpaceLand]]. Different types of agents are refereed to as "breeds". A specific individual part part of breed is called an "instance".
 
==Creation & Deletion==
Agents are created using [[Code Blocks|code blocks]] such as:
Agents are created using [[Code Blocks|code blocks]] such as:
*{{Block|l|create}}
*{{Block|l|create}}
*{{Block|Create Each Do|create [_] [▼](s) each do}}.  
*{{Block|Create Each Do|create [_] [▼](s) each do}}.
Agents can be deleting using blocks such as:
Agents can be deleting using blocks such as:
*{{Block|l|delete}}
*{{Block|l|delete}}
Line 10: Line 13:
*{{Block|Delete Agent|delete agent [_]}}
*{{Block|Delete Agent|delete agent [_]}}


== Code Execution ==
==Code Execution==
Agents execute [[code block]]s under their specified [[tab]] in the [[workspace]]. The code written under the tab can be thought of a set of instructions each agent makes a copy of and follows individually.
Agents execute [[code block]]s under their specified [[tab]] in the [[workspace]]. The code written under the tab can be thought of a set of instructions each agent makes a copy of and follows individually.
==Traits==
All Agents have a set of traits. Traits are variables that are individual to each instance of an agent. Each time a agent is created, it also copies the default values for traits and stores it's own version of the variables.
Agents have the following built-in traits:
*id
**a unique number given to each instance (cannot manually be set)
*breed
**the type of agent
*x
*y
*z
*heading
*color
*shape
*size
Custom traits can be created for each breed. Custom traits can be used to track values per instance.
[[Category:Technical]]
</translate>

Latest revision as of 14:24, 16 March 2023


Agents are the backbone of StarLogo Nova. Agents are the objects commonly seen moving around SpaceLand. Different types of agents are refereed to as "breeds". A specific individual part part of breed is called an "instance".

Creation & Deletion

Agents are created using code blocks such as:

Agents can be deleting using blocks such as:

Code Execution

Agents execute code blocks under their specified tab in the workspace. The code written under the tab can be thought of a set of instructions each agent makes a copy of and follows individually.

Traits

All Agents have a set of traits. Traits are variables that are individual to each instance of an agent. Each time a agent is created, it also copies the default values for traits and stores it's own version of the variables.

Agents have the following built-in traits:

  • id
    • a unique number given to each instance (cannot manually be set)
  • breed
    • the type of agent
  • x
  • y
  • z
  • heading
  • color
  • shape
  • size

Custom traits can be created for each breed. Custom traits can be used to track values per instance.