Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kenblu24 committed Feb 15, 2025
1 parent 75026aa commit d16cfef
Show file tree
Hide file tree
Showing 140 changed files with 294 additions and 290 deletions.
Binary file modified doc/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified doc/build/doctrees/guide/firstrun.doctree
Binary file not shown.
26 changes: 14 additions & 12 deletions doc/build/html/_sources/guide/firstrun.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Open a Python shell with ``python``, and make sure you can ``import novel_swarms
Python 3.11.0 (or newer)
Type "help", "copyright", "credits" or "license" for more information.
>>> import novel_swarms
>>>
>>>
Creating a :fas:`earth-americas` world
Expand Down Expand Up @@ -54,7 +54,7 @@ and use it to initialize the :py:class:`~novel_swarms.agent.MazeAgent.MazeAgent`
.. code-block:: python
from novel_swarms.agent.MazeAgent import MazeAgent, MazeAgentConfig
agent_config = MazeAgentConfig(pos=(5, 5), agent_radius=0.1)
agent_config = MazeAgentConfig(position=(5, 5), agent_radius=0.1)
agent = MazeAgent(agent_config, world)
world.population.append(agent) # add the agent to the world
Expand Down Expand Up @@ -126,9 +126,11 @@ First, we need to create a :py:class:`~novel_swarms.world.spawners.AgentSpawner.
spawner = PointAgentSpawner(world, n=6, facing="away", avoid_overlap=True, agent=agent, oneshot=True)
world.spawners.append(spawner)
Now, remove the existing agent from the :py:attr:`~novel_swarms.world.World.World.population` and run the simulation again.
Now, remove the existing agent from the :py:attr:`~novel_swarms.world.World.World.population`
and run the simulation again.

The spawner will create copies of the agent and controller and add the copies to the world's population.
On the first ``step()`` after the ``sim()`` starts, the spawner will create copies of the agent and
controller and add the copies to the world's population.

The agents will spawn in the same location, but get pushed apart as they spawn.

Expand All @@ -137,7 +139,7 @@ The agents will spawn in the same location, but get pushed apart as they spawn.
del world.population[-1] # remove the most recently added agent
sim(world)
Because of the ``oneshot=True`` argument, the spawner will spawn all its agents once,
Because of the ``oneshot=True`` argument, the spawner will spawn all its agents once on that first ``step()``\ ,
and then delete itself.


Expand Down Expand Up @@ -204,15 +206,15 @@ the simulation will perform a single step :fas:`forward-step`.
You can :fas:`pause` **pause** or :fas:`play` **unpause** the simulation by pressing :kbd:`Space`.

:kbd:`⇧LShift` and :kbd:`⇧RShift` will **slow down** or :fas:`gauge-high` **speed up** the simulation.
The speed multiplier is shown in the top left corner of the window. Values beginning with a ``/`` slash
The speed multiplier is shown in the top left corner of the window. Values beginning with a ``/`` slash
are divisors, i.e. ``/2`` half or ``/4`` quarter speed. The number of :far:`clock` elapsed time steps is also shown.

The number in between the timesteps and multiplier is the :fas:`stopwatch` step rate and :fas:`film` framerate, respectively, in frames per second.

You can also see the :fas:`ruler-combined` world coordinates under your cursor displayed in this area.

Clicking and dragging the :fas:`computer-mouse` :kbd:`MMB` inside the simulation window will
allow you to :far:`hand` **pan** the simulation, and :fas:`computer-mouse` scrolling up or down will
allow you to :far:`hand` **pan** the simulation, and :fas:`computer-mouse` scrolling up or down will
:fas:`magnifying-glass-plus` **zoom** in or :fas:`magnifying-glass-minus` **zoom** out.

You can reset the viewport and :fas:`magnifying-glass` zoom level with the :kbd:`Num0` Numpad 0 key if you get lost :fas:`house`\ .
Expand Down Expand Up @@ -314,7 +316,7 @@ If not, try re-adding the spawner to the world's ``spawners`` list:
So, you don't need to re-define the spawner, you already created it before and can just
*un-mark it for deletion* and add it back to the ``spawners`` list.

2. Our :py:class:`~novel_swarms.spawners.AgentSpawner.AgentSpawner` stores either a config
2. Our :py:mod:`~novel_swarms.spawners.AgentSpawner` stores either a config
for the agent parameters, or in this example, a **reference** to the actual agent itself.
In the case of the latter, the spawner will attempt to make a :py:func:`~copy.deepcopy`
of the ``agent`` we gave it earlier. Because ``agent`` is a reference to the agent
Expand Down Expand Up @@ -391,7 +393,7 @@ History
However, the speed is important to get right. In fact, if you adjust the :fas:`gauge-high` speed and how
quickly you :fas:`arrows-turn-to-dots` turn, you can create a variety of different behaviors, not just milling.

.. sidebar::
.. sidebar::

Ants can also mill! `Ant mills <https://en.wikipedia.org/wiki/Ant_mill>`_
are an example of emergent behaviors.
Expand All @@ -409,7 +411,7 @@ We've used it to automatically discover interesting behaviors [#novel_discovery]
train Spiking Neural Networks [#snnicons]_, and even train real robots [#snnnice]_!

.. note::

That's also why the package is called :py:mod:`novel_swarms`\ .


Expand Down Expand Up @@ -484,7 +486,7 @@ becomes a list of dictionaries, which are then turned into :py:class:`~novel_swa
We cover the order that things are initialized in :ref:`initialization_order`\ .

.. card::

**Exercise**
^^^

Expand Down Expand Up @@ -526,7 +528,7 @@ of an agent to a :py:mod:`~novel_swarms.agent.control.BinaryController`\ :
a=(0.02, -0.5),
b=(0.02, 0.5)
)
.. grid-item::

.. code-block:: yaml
Expand Down
4 changes: 2 additions & 2 deletions doc/build/html/api/_gen/novel_swarms.agent.Agent.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docsearch:version" content="" />
<meta name="docbuild:last-update" content="Feb 14, 2025"/>
<meta name="docbuild:last-update" content="Feb 15, 2025"/>
</head>


Expand Down Expand Up @@ -1222,7 +1222,7 @@ <h3>This Page</h3>
</p></div>

<div class="footer-item"><p class="last-updated">
Last built Feb 14, 2025.
Last built Feb 15, 2025.
<br/>
</p></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docsearch:version" content="" />
<meta name="docbuild:last-update" content="Feb 14, 2025"/>
<meta name="docbuild:last-update" content="Feb 15, 2025"/>
</head>


Expand Down Expand Up @@ -685,7 +685,7 @@ <h3>This Page</h3>
</p></div>

<div class="footer-item"><p class="last-updated">
Last built Feb 14, 2025.
Last built Feb 15, 2025.
<br/>
</p></div>

Expand Down
4 changes: 2 additions & 2 deletions doc/build/html/api/_gen/novel_swarms.agent.DroneAgent.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docsearch:version" content="" />
<meta name="docbuild:last-update" content="Feb 14, 2025"/>
<meta name="docbuild:last-update" content="Feb 15, 2025"/>
</head>


Expand Down Expand Up @@ -685,7 +685,7 @@ <h3>This Page</h3>
</p></div>

<div class="footer-item"><p class="last-updated">
Last built Feb 14, 2025.
Last built Feb 15, 2025.
<br/>
</p></div>

Expand Down
4 changes: 2 additions & 2 deletions doc/build/html/api/_gen/novel_swarms.agent.HumanAgent.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docsearch:version" content="" />
<meta name="docbuild:last-update" content="Feb 14, 2025"/>
<meta name="docbuild:last-update" content="Feb 15, 2025"/>
</head>


Expand Down Expand Up @@ -682,7 +682,7 @@ <h3>This Page</h3>
</p></div>

<div class="footer-item"><p class="last-updated">
Last built Feb 14, 2025.
Last built Feb 15, 2025.
<br/>
</p></div>

Expand Down
4 changes: 2 additions & 2 deletions doc/build/html/api/_gen/novel_swarms.agent.MazeAgent.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docsearch:version" content="" />
<meta name="docbuild:last-update" content="Feb 14, 2025"/>
<meta name="docbuild:last-update" content="Feb 15, 2025"/>
</head>


Expand Down Expand Up @@ -1447,7 +1447,7 @@ <h3>This Page</h3>
</p></div>

<div class="footer-item"><p class="last-updated">
Last built Feb 14, 2025.
Last built Feb 15, 2025.
<br/>
</p></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docsearch:version" content="" />
<meta name="docbuild:last-update" content="Feb 14, 2025"/>
<meta name="docbuild:last-update" content="Feb 15, 2025"/>
</head>


Expand Down Expand Up @@ -685,7 +685,7 @@ <h3>This Page</h3>
</p></div>

<div class="footer-item"><p class="last-updated">
Last built Feb 14, 2025.
Last built Feb 15, 2025.
<br/>
</p></div>

Expand Down
4 changes: 2 additions & 2 deletions doc/build/html/api/_gen/novel_swarms.agent.StaticAgent.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docsearch:version" content="" />
<meta name="docbuild:last-update" content="Feb 14, 2025"/>
<meta name="docbuild:last-update" content="Feb 15, 2025"/>
</head>


Expand Down Expand Up @@ -1432,7 +1432,7 @@ <h3>This Page</h3>
</p></div>

<div class="footer-item"><p class="last-updated">
Last built Feb 14, 2025.
Last built Feb 15, 2025.
<br/>
</p></div>

Expand Down
4 changes: 2 additions & 2 deletions doc/build/html/api/_gen/novel_swarms.agent.UnicycleAgent.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docsearch:version" content="" />
<meta name="docbuild:last-update" content="Feb 14, 2025"/>
<meta name="docbuild:last-update" content="Feb 15, 2025"/>
</head>


Expand Down Expand Up @@ -685,7 +685,7 @@ <h3>This Page</h3>
</p></div>

<div class="footer-item"><p class="last-updated">
Last built Feb 14, 2025.
Last built Feb 15, 2025.
<br/>
</p></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docsearch:version" content="" />
<meta name="docbuild:last-update" content="Feb 14, 2025"/>
<meta name="docbuild:last-update" content="Feb 15, 2025"/>
</head>


Expand Down Expand Up @@ -800,7 +800,7 @@ <h3>This Page</h3>
</p></div>

<div class="footer-item"><p class="last-updated">
Last built Feb 14, 2025.
Last built Feb 15, 2025.
<br/>
</p></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docsearch:version" content="" />
<meta name="docbuild:last-update" content="Feb 14, 2025"/>
<meta name="docbuild:last-update" content="Feb 15, 2025"/>
</head>


Expand Down Expand Up @@ -736,7 +736,7 @@ <h3>This Page</h3>
</p></div>

<div class="footer-item"><p class="last-updated">
Last built Feb 14, 2025.
Last built Feb 15, 2025.
<br/>
</p></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docsearch:version" content="" />
<meta name="docbuild:last-update" content="Feb 14, 2025"/>
<meta name="docbuild:last-update" content="Feb 15, 2025"/>
</head>


Expand Down Expand Up @@ -685,7 +685,7 @@ <h3>This Page</h3>
</p></div>

<div class="footer-item"><p class="last-updated">
Last built Feb 14, 2025.
Last built Feb 15, 2025.
<br/>
</p></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docsearch:version" content="" />
<meta name="docbuild:last-update" content="Feb 14, 2025"/>
<meta name="docbuild:last-update" content="Feb 15, 2025"/>
</head>


Expand Down Expand Up @@ -688,7 +688,7 @@ <h3>This Page</h3>
</p></div>

<div class="footer-item"><p class="last-updated">
Last built Feb 14, 2025.
Last built Feb 15, 2025.
<br/>
</p></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docsearch:version" content="" />
<meta name="docbuild:last-update" content="Feb 14, 2025"/>
<meta name="docbuild:last-update" content="Feb 15, 2025"/>
</head>


Expand Down Expand Up @@ -685,7 +685,7 @@ <h3>This Page</h3>
</p></div>

<div class="footer-item"><p class="last-updated">
Last built Feb 14, 2025.
Last built Feb 15, 2025.
<br/>
</p></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docsearch:version" content="" />
<meta name="docbuild:last-update" content="Feb 14, 2025"/>
<meta name="docbuild:last-update" content="Feb 15, 2025"/>
</head>


Expand Down Expand Up @@ -685,7 +685,7 @@ <h3>This Page</h3>
</p></div>

<div class="footer-item"><p class="last-updated">
Last built Feb 14, 2025.
Last built Feb 15, 2025.
<br/>
</p></div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docsearch:version" content="" />
<meta name="docbuild:last-update" content="Feb 14, 2025"/>
<meta name="docbuild:last-update" content="Feb 15, 2025"/>
</head>


Expand Down Expand Up @@ -694,7 +694,7 @@ <h3>This Page</h3>
</p></div>

<div class="footer-item"><p class="last-updated">
Last built Feb 14, 2025.
Last built Feb 15, 2025.
<br/>
</p></div>

Expand Down
4 changes: 2 additions & 2 deletions doc/build/html/api/_gen/novel_swarms.agent.control.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
<meta name="docsearch:version" content="" />
<meta name="docbuild:last-update" content="Feb 14, 2025"/>
<meta name="docbuild:last-update" content="Feb 15, 2025"/>
</head>


Expand Down Expand Up @@ -705,7 +705,7 @@ <h3>This Page</h3>
</p></div>

<div class="footer-item"><p class="last-updated">
Last built Feb 14, 2025.
Last built Feb 15, 2025.
<br/>
</p></div>

Expand Down
Loading

0 comments on commit d16cfef

Please sign in to comment.