Skip to content

Commit 0479c38

Browse files
jmasponsDatseris
andauthored
Fix links (#1141)
* Add URLs for links to Agents Example Zoo * Wrong section id specification * Fix or specify @ref where text value doesn't match (implicit) @id * Missing docs * Add @id and @ref * Typos and @ref missmatches * Remove reference to a missing section in the Tutorial * Add module in the @ref * Adress comments from @Datseris * Second round review * Update Project.toml --------- Co-authored-by: George Datseris <[email protected]>
1 parent f82e70e commit 0479c38

21 files changed

+42
-37
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Agents"
22
uuid = "46ada45e-f475-11e8-01d0-f70cc89e6671"
33
authors = ["George Datseris", "Tim DuBois", "Aayush Sabharwal", "Ali Vahdati", "Adriano Meligrana"]
4-
version = "6.2.5"
4+
version = "6.2.6"
55

66
[deps]
77
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"

docs/src/api.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# API
22

3-
The API of Agents.jl is defined on top of the fundamental structures [`AgentBasedModel`](@ref), [Space](@ref Space), [`AbstractAgent`](@ref) which are described in the [Tutorial](@ref) page.
3+
The API of Agents.jl is defined on top of the fundamental structures [`AgentBasedModel`](@ref), [Space](@ref available_spaces), [`AbstractAgent`](@ref) which are described in the [Tutorial](@ref) page.
44
In this page we list the remaining API functions, which constitute the bulk of Agents.jl functionality.
55

66
## [AgentBasedModel](@id ABM_Implementations)
@@ -11,6 +11,7 @@ In this page we list the remaining API functions, which constitute the bulk of A
1111

1212
```@docs
1313
AgentBasedModel
14+
step!(::AgentBasedModel, args...)
1415
```
1516

1617
### Discrete time models
@@ -108,7 +109,7 @@ get_direction
108109
```
109110

110111
### Movement with paths
111-
For [`OpenStreetMapSpace`](@ref), and [`GridSpace`](@ref)/[`ContinuousSpace`](@ref) using [`Pathfinding.Pathfinder`](@ref), a special
112+
For [`OpenStreetMapSpace`](@ref), and [`GridSpace`](@ref)/[`ContinuousSpace`](@ref) using [`Pathfinding`](@ref), a special
112113
movement method is available.
113114

114115
```@docs
@@ -159,7 +160,7 @@ add_vertex!
159160
rem_vertex!
160161
```
161162

162-
## `ContinuousSpace` exclusives
163+
## [`ContinuousSpace` exclusives](@id ContinuosSpace_exclusives)
163164
```@docs
164165
nearest_neighbor
165166
get_spatial_property
@@ -339,7 +340,7 @@ step!(model, agentstep, modelstep, 100; scheduler = ms)
339340

340341

341342
### How to use `Distributed`
342-
To use the `parallel=true` option of [`ensemblerun!`](@ref) you need to load `Agents` and define your fundamental types at all processors. How to do this is shown in [Ensembles and distributed computing](@ref) section of Schelling's Segregation Model example. See also the [Performance Tips](@ref) page for parallelization.
343+
To use the `parallel=true` option of [`ensemblerun!`](@ref) you need to load `Agents` and define your fundamental types at all processors. See the [Performance Tips](@ref) page for parallelization.
343344

344345
## Path-finding
345346
```@docs

docs/src/devdocs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ If you wish to do any development work, it is better to use
2424
git clone https://github.com/JuliaDynamics/Agents.jl.git --single-branch
2525
```
2626

27-
## [Creating a new model type](@ref make_new_model)
27+
## [Creating a new model type](@id make_new_model)
2828

2929
Note that new model types target applications where a fundamentally different
3030
way to define the "time evolution" or "dynamic rule" is required.
@@ -47,7 +47,7 @@ default implementation that e.g., attempts to return a field named `:rng`.
4747
The rest of the methods by default return a "not implemented" error message
4848
(and those you also need to extend mandatorily).
4949

50-
## [Creating a new space type](@ref make_new_space)
50+
## [Creating a new space type](@id make_new_space)
5151

5252
Creating a new space type within Agents.jl is quite simple and requires the extension of only 5 methods to support the entire Agents.jl API. The exact specifications on how to create a new space type are contained within the source file: [`src/core/space_interaction_API.jl`](https://github.com/JuliaDynamics/Agents.jl/blob/main/src/core/space_interaction_API.jl).
5353

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Agents.jl was designed with the following philosophy in mind:
9292

9393

9494

95-
There are multiple examples that highlight this core design principle, that one will quickly encounter when scanning through our [API](@ref) page. Here we just give two quick examples: first, there exists a universal function [`nearby_agents`](@ref), which returns the agents nearby a given agent and within a given "radius". What is special for this function, which is allowed by Julia's Multiple Dispatch, is that `nearby_agents` will work for any space type the model has, reducing the learning curve of finding neighbors in ABMs made with Agents.jl. An even better example is perhaps our treatment of spaces. A user may create an entirely new kind of space (e.g. one representing a planet, or whatever else) by only extending 5 functions, as discussed in our [Creating a new space type](@ref) documentation. Indeed, the simplicity of Agents.jl is due to the intuitive space-agnostic modelling approach we have implemented: agent actions are specified using generically named functions (such as "move agent" or "find nearby agents") that do not depend on the actual space the agents exist in, nor on the properties of the agents themselves. Overall this leads to ultra fast model prototyping where even changing the space the agents live in is matter of only a couple of lines of code.
95+
There are multiple examples that highlight this core design principle, that one will quickly encounter when scanning through our [API](@ref) page. Here we just give two quick examples: first, there exists a universal function [`nearby_agents`](@ref), which returns the agents nearby a given agent and within a given "radius". What is special for this function, which is allowed by Julia's Multiple Dispatch, is that `nearby_agents` will work for any space type the model has, reducing the learning curve of finding neighbors in ABMs made with Agents.jl. An even better example is perhaps our treatment of spaces. A user may create an entirely new kind of space (e.g. one representing a planet, or whatever else) by only extending 5 functions, as discussed in our [Creating a new space type](@ref make_new_space) documentation. Indeed, the simplicity of Agents.jl is due to the intuitive space-agnostic modelling approach we have implemented: agent actions are specified using generically named functions (such as "move agent" or "find nearby agents") that do not depend on the actual space the agents exist in, nor on the properties of the agents themselves. Overall this leads to ultra fast model prototyping where even changing the space the agents live in is matter of only a couple of lines of code.
9696

9797
Many other agent-based modeling frameworks have been constructed to ease the process of building and analyzing ABMs (see e.g. [here](http://dx.doi.org/10.1016/j.cosrev.2017.03.001) for an outdated review), spanning a varying degree of complexity.
9898
In the page [ABM Framework Comparison](@ref) we compare how our design philosophy puts us into comparison with other well accepted ABM software.

docs/src/performance_tips.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ It might be tempting to represent this property as a specific type of agent like
115115
However, in Agents.jl this is not necessary and a much more performant approach can be followed.
116116
Specifically, you can represent this property as a standard Julia `Array` that is a property of the model. This will typically lead to a 5-10 fold increase in performance.
117117

118-
For an example of how this is done, see the [Forest fire](@ref) model, which is a cellular automaton that has no agents in it, or the [Daisyworld](@ref) model, which has both agents as well as a spatial property represented by an `Array`.
118+
For an example of how this is done, see the [Forest fire](https://juliadynamics.github.io/AgentsExampleZoo.jl/dev/examples/forest_fire/) model, which is a cellular automaton that has no agents in it, or the [Daisyworld](https://juliadynamics.github.io/AgentsExampleZoo.jl/dev/examples/daisyworld/) model, which has both agents as well as a spatial property represented by an `Array`.
119119

120120
## [Multiple agent types: `@multiagent` versus `Union` types](@id multi_vs_union)
121121

examples/event_rock_paper_scissors.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ end
222222
# ## Time evolution
223223
# %% #src
224224

225-
# Time evolution for [`EventBasedABM`](@ref) is identical
225+
# Time evolution for [`EventQueueABM`](@ref) is identical
226226
# to that of [`StandardABM`](@ref), but time is continuous.
227227
# So, when calling `step!` we pass in a real time.
228228

examples/measurements.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# [Measurements.jl](https://github.com/JuliaPhysics/Measurements.jl) provides automatic
44
# error propagation, and integrates seamlessly with much of the Julia ecosystem.
55
#
6-
# Here, we'll slightly modify the [Daisyworld](@ref) example, to simulate some measurement
7-
# uncertainty in our world's parameters.
6+
# Here, we'll slightly modify the [Daisyworld](https://juliadynamics.github.io/AgentsExampleZoo.jl/dev/examples/daisyworld/)
7+
# example, to simulate some measurement uncertainty in our world's parameters.
88
#
99
# ## Setup
1010
#
@@ -31,8 +31,8 @@ end
3131
# parameters with type `Measurement{Float64}` as well.
3232
#
3333
# Next, we'll implement all the important functions for DaisyWorld. If you want to know what
34-
# each of these functions do, see the [Daisyworld](@ref) example, as they are copied directly
35-
# from there.
34+
# each of these functions do, see the [Daisyworld](https://juliadynamics.github.io/AgentsExampleZoo.jl/dev/examples/daisyworld/)
35+
# example, as they are copied directly from there.
3636

3737
using CairoMakie
3838
using Statistics: mean
@@ -168,8 +168,9 @@ end
168168

169169
# ## Visualizing the Result
170170
#
171-
# Similar to the [Daisyworld](@ref) example, we will now check out how the surface temperature
172-
# and daisy count fares when solar luminosity ramps up.
171+
# Similar to the [Daisyworld](https://juliadynamics.github.io/AgentsExampleZoo.jl/dev/examples/daisyworld/)
172+
# example, we will now check out how the surface temperature and daisy count fares when solar
173+
# luminosity ramps up.
173174
#
174175
# First, some helper functions
175176

examples/predator_prey.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
# ## Making the model
4343
# First we define the agent types
4444
# (here you can see that it isn't really that much
45-
# of an advantage to have two different agent types. Like in the [Rabbit, Fox, Hawk](@ref)
45+
# of an advantage to have two different agent types. Like in the [Rabbit, Fox, Hawk](https://juliadynamics.github.io/Agents.jl/stable/examples/rabbit_fox_hawk/)
4646
# example, we could have only one type and one additional field to separate them.
4747
# Nevertheless, for the sake of example, we will use two different types.)
4848
using Agents, Random

src/core/agents.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Agents participating in Agents.jl simulations are instances of user-defined type
1010
are subtypes of `AbstractAgent`.
1111
1212
Your agent type(s) **must have** the `id::Int` field as first field.
13-
If any space is used (see [Available spaces](@ref)), a `pos` field of appropriate type
13+
If any space is used (see [Available spaces](@ref available_spaces)), a `pos` field of appropriate type
1414
is also mandatory. The core model structure, and each space,
1515
may also require additional fields that may,
1616
or may not, be communicated as part of the public API.
@@ -265,7 +265,7 @@ This means that all "subtypes" are enclosed in the overarching type. Then, You c
265265
distinguish them on the basis of `typeof`, but need to use instead the `variantof`
266266
function. The `allvariants` function for a convenient way to obtain all variants types.
267267
268-
See the [Tutorial](@ref) or the [performance comparison versus `Union` types](@ref multiagent_vs_union)
268+
See the [Tutorial](@ref) or the [performance comparison versus `Union` types](@ref multi_vs_union)
269269
for why it is often better to use `@multiagent` than making multiple agent types.
270270
271271
`@multiagent` is based on LightSumTypes.jl.

src/core/model_abstract.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ see [the corresponding entry in the developer documentation](@ref make_new_model
3535
3636
## Interface of `AgentBasedModel`
3737
38+
- `step!(model, args...)` progress the model forwards in time.
3839
- `model[id]` returns the agent with given `id`.
3940
- `abmproperties(model)` returns the `properties` container storing model-level properties.
4041
- `model.property`: If the model `properties` is a dictionary with

0 commit comments

Comments
 (0)