Skip to content

Commit

Permalink
Birth cross ref, missed flamegpu:: prefix in inline code block
Browse files Browse the repository at this point in the history
  • Loading branch information
ptheywood committed Aug 9, 2021
1 parent 513ba3d commit 77e40ae
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/guide/3-behaviour-definition/6-host-functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ Agent populations can also be sorted according to a variable, the C++ API can ad
sheep.sortFloat("health", flamegpu.ASC);


It's also possible to create new agents with the ``HostAgentAPI``, this is covered in `Section 6.2. <../6-agent-birth-death/2-agent-birth-host.html>`_. These agents are not created until after the layer has completed execution, so they will not affect reductions or sorts carried out in the same host function. This is the preferred method of host agent birth as it performs a single host-device memory copy.
It's also possible to create new agents with the ``HostAgentAPI``, this is covered in :ref:`Agent Birth from Host Functions`. These agents are not created until after the layer has completed execution, so they will not affect reductions or sorts carried out in the same host function. This is the preferred method of host agent birth as it performs a single host-device memory copy.

For raw access to agent data, ``DeviceAgentVector`` can be used. This has an interface similar to ``AgentVector``, however automatically synchronises data movement between host and device. This should only be used in limited circumstances as copying memory between host and device has high latency.

Expand Down
2 changes: 1 addition & 1 deletion src/guide/6-agent-birth-death/1-agent-birth-device.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Agent Creation Overview
-----------------------
The agent creation interface usable in agent functions is only able to create a single agent per existing agent per iteration.
Additionally, the agent type and state being created must be earlier specified as part of the model description. If you need
to create more than one agent for each existing agent, you should use the *TODO: link to host agent creation api*
to create more than one agent for each existing agent, you should use the :ref:`Agent Birth from Host Functions`.

**Note:** *Agents created by agent functions do not exist until the next layer.*

Expand Down
2 changes: 2 additions & 0 deletions src/guide/6-agent-birth-death/2-agent-birth-host.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _Agent Birth from Host Functions:

Agent Birth from Host Functions
===============================

Expand Down
2 changes: 1 addition & 1 deletion src/guide/6-agent-birth-death/3-agent-death.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ the ``AgentFunctionDescription`` object:
Agent Death
-----------

To have an agent die, simply ``return DEAD;`` instead of ``return ALIVE;`` at the end of a death-enabled agent function. You can use
To have an agent die, simply ``return flamegpu::DEAD;`` instead of ``return flamegpu::ALIVE;`` at the end of a death-enabled agent function. You can use
conditionals to only have agents die according to a certain condition:

.. tabs::
Expand Down

0 comments on commit 77e40ae

Please sign in to comment.