Skip to content

Commit

Permalink
Fixing error.
Browse files Browse the repository at this point in the history
  • Loading branch information
jackiekazil committed May 7, 2019
1 parent 53fd9d2 commit 1413579
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/Useful-snippets/snippets.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Useful Snippets
===============

A collection of useful code snippets. Here you can find code that allows you to get to get started on common tasks in Mesa.

Models with Discrete Time
-------------------------
If you have `Multiple` type agents and one of them has time attribute you can still build a model that is run by discrete time. In this example, each step of the model, and the agents have a time attribute that is equal to the discrete time to run its own step.

.. code:: python
if self.model.schedule.time in self.discrete_time:
self.model.space.move_agent(self, new_pos)

0 comments on commit 1413579

Please sign in to comment.