Skip to content

Commit 8cc8883

Browse files
authored
Fix links (second round) (#1143)
* Add explicit @id with @ref * Avoid ref to abstract class not present in API docs * Fix Missing docstring * Add link * Make explicit that GraphSpace inherits from DiscrecteSpace * bump version
1 parent 0479c38 commit 8cc8883

File tree

8 files changed

+15
-14
lines changed

8 files changed

+15
-14
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.6"
4+
version = "6.2.7"
55

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

docs/src/api.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ normalize_position
132132
spacesize
133133
```
134134

135-
## Discrete space exclusives
135+
## [`DiscreteSpace` exclusives](@id DiscreteSpace_exclusives)
136136
```@docs
137137
positions
138138
npositions
@@ -149,7 +149,7 @@ random_empty
149149
add_agent_single!
150150
move_agent_single!
151151
swap_agents!
152-
isempty(::Integer, ::ABM)
152+
isempty(::Int, ::ABM)
153153
```
154154

155155
## `GraphSpace` exclusives
@@ -291,7 +291,7 @@ return df_agent, df_model
291291

292292
```@docs
293293
Schedulers
294-
schedule
294+
schedule(::ABM)
295295
```
296296

297297
### Predefined schedulers
@@ -308,7 +308,7 @@ Schedulers.ByType
308308
Schedulers.ByKind
309309
```
310310

311-
### Advanced scheduling
311+
### [Advanced scheduling](@id advanced_scheduling)
312312
You can use [Function-like objects](https://docs.julialang.org/en/v1/manual/methods/#Function-like-objects) to make your scheduling possible of arbitrary events.
313313
For example, imagine that after the `n`-th step of your simulation you want to fundamentally change the order of agents. To achieve this you can define
314314
```julia

src/core/model_standard.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ The evolution rules are functions given to the keywords `agent_step!`, `model_st
9393
- `warn=true`: some type tests for `AgentType(s)` are done, and by default
9494
warnings are thrown when appropriate.
9595
96-
## Advanced stepping
96+
## [Advanced stepping](@id advanced_stepping)
9797
9898
Some advanced models may require special handling for scheduling, or may need to
9999
schedule agents several times and act on different subsets of agents with different

src/simulations/step.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Step the model forwards until `f(model, t)` returns `true`,
2222
where `t` is the current amount of time the model has been evolved
2323
for, starting from the model's initial time.
2424
25-
See also [Advanced stepping](@ref).
25+
See also [Advanced stepping](@ref advanced_stepping).
2626
"""
2727
function CommonSolve.step!(model::AgentBasedModel, args...)
2828
error(lazy"`step!` not implemented yet for model of type $(typeof(model)).")

src/spaces/graph.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ Create a `GraphSpace` instance that is underlined by an arbitrary graph from
1717
arbitrary amount of agents, and each agent can move between the nodes of the graph.
1818
The position type for this space is `Int`, use [`GraphAgent`](@ref) for convenience.
1919
20-
`Graphs.nv` and `Graphs.ne` can be used in a model with a `GraphSpace` to obtain
21-
the number of nodes or edges in the graph.
20+
`GraphSpace` inherits from `DiscreteSpace` and all functions for [`DiscreteSpace`](@ref DiscreteSpace_exclusives)
21+
are available. On top of that, `Graphs.nv` and `Graphs.ne` can be used in a model
22+
with a `GraphSpace` to obtain the number of nodes or edges in the graph.
2223
The underlying graph can be altered using [`add_vertex!`](@ref) and [`rem_vertex!`](@ref).
2324
2425
An example using `GraphSpace` is [SIR model for the spread of COVID-19](@ref).

src/spaces/openstreetmap.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export OpenStreetMapSpace, OSMSpace, OSM, OSMAgent
22

33
"""
44
OSM
5-
Submodule for functionality related to `OpenStreetMapSpace`.
5+
Submodule for functionality related to [`OpenStreetMapSpace`](@ref).
66
See the docstring of the space for more info.
77
"""
88
module OSM # OpenStreetMap

src/spaces/utilities.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ export euclidean_distance, manhattan_distance, get_direction, spacesize
44
"""
55
spacesize(model::ABM)
66
7-
Return the size of the model's space. Works for [`AbstractGridSpace`](@ref) and
8-
[`ContinuousSpace`](@ref).
7+
Return the size of the model's space. Works for [`GridSpace`](@ref),
8+
[`GridSpaceSingle`](@ref) and [`ContinuousSpace`](@ref).
99
"""
1010
spacesize(model::ABM) = spacesize(abmspace(model))
1111

src/submodules/schedulers.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ Schedulers have many purposes:
2525
1. Can be given in [`StandardABM`](@ref) as a default scheduler.
2626
This functionality is only meaningful when the `agent_step!` has been configured.
2727
The function `schedule(model)` will return the scheduled IDs.
28-
2. Can be used by a user when performing [manual scheduling](@ref Advanced_scheduling)
28+
2. Can be used by a user when performing [manual scheduling](@ref advanced_scheduling)
2929
in case `agent_step!` has not been configured.
3030
3. Can be used to globally filter agents by type/property/whatever. For example,
3131
one can use the [`ByProperty`](@ref) scheduler to simply obtain
3232
the list of all agent IDs that satisfy a particular property.
3333
34-
See also [Advanced scheduling](@ref) for making more advanced schedulers.
34+
See also [Advanced scheduling](@ref advanced_scheduling) for making more advanced schedulers.
3535
"""
3636
module Schedulers
3737
using Agents

0 commit comments

Comments
 (0)