Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mastrof committed Sep 24, 2024
1 parent 29eb8a6 commit a928abe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 6 additions & 4 deletions docs/src/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,18 @@ model = StandardABM(Microbe{1}, space, dt)
Now, with the `add_agent!` function we will populate the model with microbes of
the specified type (`Microbe{1}`).
The only argument we must *always* specify for `add_agent!` is the motility of the microbe, via the `motility` keyword. An overview of the motility interface is given later;
For now we will just use a Run-Tumble motility with an average run duration of 1 second
and a constant swimming speed of 20 micron / second.
For now we will just use a Run-Tumble motility with an average run duration of 1 second and a constant swimming speed of 20 micron / second.
The third required argument to the call is the distribution of reorientation
angles, but it is irrelevant in 1-dimensional systems so we can just pass
an empty array.
If unspecified, position, direction and speed of the microbe will be assigned randomly;
all the other fields will be assigned default values from the constructor (unless specified).
To select a position, it can be passed as the first argument to the `add_agent!` call,
and any other bacterial parameter can be defined via keyword arguments.
All of the following are valid calls
```
motility = RunTumble(1.0, [20.0])
# a Microbe with large radius and low tumble rate
motility = RunTumble(1.0, [20.0], [])
# a Microbe with large radius
add_agent!(model; motility, radius=10.0)
# a Microbe with custom position and high coefficient of rotational diffusion
add_agent!((53.2,), model; motility, rotational_diffusivity=0.5)
Expand Down
5 changes: 3 additions & 2 deletions src/motility.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ It is not necessary to indicate impossible transitions; any pair
transition probability `p=0`.
For example, if we want to define a 3-state motility, composed by a
slow but long run, a tumble, and a fast but short run, where the two runs
slow but long run, an instantaneous tumble with some `angle_pdf`,
and a fast but short run, where the two runs
can only transition towards the tumble, but the tumble can transition
with probability 30% towards the slow run and 70% towards the fast run,
we will call:
Motility((Run(10.0, 2.0), Tumble(), Run(60.0, 0.5)),
Motility((Run(10.0, 2.0), Tumble(0.0, angle_pdf), Run(60.0, 0.5)),
(1 => 2, 1.0),
(2 => 1, 0.3), (2 => 3, 0.7),
(3 => 2, 1.0)
Expand Down

0 comments on commit a928abe

Please sign in to comment.