Terrain Color/es: Difference between revisions

From StarLogo Nova Wiki
No edit summary
(Updating to match new version of source page)
 
(2 intermediate revisions by the same user not shown)
Line 7: Line 7:


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
== Usage==
<section begin="name" />'''<code>terrain color</code>'''<section end="name" /> is a [[code block]] part of the [[Environment]] drawer.
<p id="tooltip"><code>terrain color</code> refers to the color of the terrain that the [[agent]] is currently on.</p>
</div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
===Syntax===
==Usage==
<code>terrain color</code> refers to the color of the terrain that the [[agent]] is currently on.
</div>
 
<div lang="en" dir="ltr" class="mw-content-ltr">
==Syntax==
</div>
</div>


Line 23: Line 27:
This is commonly used as part of a conditional statement: for example, if an agent's color matches the color of the terrain, then the agent should perform a certain action.
This is commonly used as part of a conditional statement: for example, if an agent's color matches the color of the terrain, then the agent should perform a certain action.
</div>  
</div>  
<div lang="en" dir="ltr" class="mw-content-ltr">
==Example==
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
[[File:terrain_color_example.gif|alt=Terrain Color example gif|thumb]]
[[File:terrain_color_example.png|alt=Terrain Color example code|thumb]]
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
This is a model of a quarantine.  Doctors (pink cubes) find sick agents roaming around the unquarantined area (green terrain) and move them to the quarantine (white terrain).  Further, they also remove immune agents (blue) from the quarantine and move them to the unquarantined area.  Note that movement from the unquarantined area to the quarantined area changes the trait quarantined? from 0 to 1.
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
The blocks shown above describe the procedure that ensures quarantined agents remain on white terrain and unquarantined agents remain on green terrain.  If this condition is violated, the procedure bounce is called to move the agents back into its correct position.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">

Latest revision as of 06:11, 13 August 2023

Other languages:


Terrain color

terrain color is a bloque de código part of the ambiente drawer.

terrain color is a code block part of the Environment drawer.

Usage

terrain color refers to the color of the terrain that the agent is currently on.

Syntax

[Textbox Insert] terrain color

Common Uses

This is commonly used as part of a conditional statement: for example, if an agent's color matches the color of the terrain, then the agent should perform a certain action.

Example

This is a model of a quarantine. Doctors (pink cubes) find sick agents roaming around the unquarantined area (green terrain) and move them to the quarantine (white terrain). Further, they also remove immune agents (blue) from the quarantine and move them to the unquarantined area. Note that movement from the unquarantined area to the quarantined area changes the trait quarantined? from 0 to 1.

The blocks shown above describe the procedure that ensures quarantined agents remain on white terrain and unquarantined agents remain on green terrain. If this condition is violated, the procedure bounce is called to move the agents back into its correct position.

Nuances

Related Blocks