Skip to content

Commit 47a8b5f

Browse files
committed
Refined documentation and demo model.
1 parent 5c9dc39 commit 47a8b5f

3 files changed

Lines changed: 44 additions & 28 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ Clustering agents by location should produce the following output.
7777

7878
### Variant 1: Downloading jar files
7979

80-
To install the extension, download the zip file containing the latest version from the releases page and unzip it in the `NetLogo/extensions` folder of your NetLogo installation (the final structure should be `NetLogo/extensions/dbscan/<jar files>`).
80+
To install the extension, download the zip file containing the latest version from the releases page. It contains a folder `dbscan` that contains all relevant jar files. Unzip it to the `NetLogo/extensions` folder of your NetLogo installation (the final structure should be `NetLogo/extensions/dbscan/<jar files>`).
8181

8282
### Variant 2: Building from source
8383

84-
You can build the extension from scratch using maven by running `mvn package` after cloning the repository. In addition, you will need to do the same for the [DBSCAN repository](https://github.com/chrfrantz/DBSCAN.git) which contains the underlying DBSCAN algorithm. Place both jar files in the extensions subfolder `dbscan` (see Variant 1).
84+
You can build the extension from scratch using maven by running `mvn package` after cloning the repository. In addition, you will need to do the same for the [DBSCAN repository](https://github.com/chrfrantz/DBSCAN.git) which contains the underlying DBSCAN algorithm. Place both jar files in the extensions subfolder `dbscan` (following the structure described under Variant 1).
8585

8686

demo/dbscan-clustering-demo.nlogo

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ end
3232
to cluster-by-variable
3333
setup
3434

35-
; Cluster agents by variable "wealth", with at least 3 members to constitute a cluster, and a maximum value difference of 3
36-
let clusters dbscan:cluster-by-variable agents "wealth" 3 3
35+
; Cluster agents by variable "wealth", with at least *minimum-number-of-members* members to constitute a cluster, and a maximum value difference of *maximum-distance*
36+
let clusters dbscan:cluster-by-variable agents "wealth" minimum-number-of-members maximum-distance
3737

3838
; Show number of clusters
3939
output-print (word "Number of clusters: " (length clusters))
@@ -58,8 +58,8 @@ end
5858
to cluster-by-location
5959
setup
6060

61-
; Cluster agents by location, with at least 3 members to constitute a cluster, and a maximum distance of 3
62-
let clusters dbscan:cluster-by-location agents 3 3
61+
; Cluster agents by location, with at least *minimum-number-of-members* members to constitute a cluster, and a maximum distance of *maximum-distance*
62+
let clusters dbscan:cluster-by-location agents minimum-number-of-members maximum-distance
6363

6464
; Show number of clusters
6565
output-print (word "Number of clusters: " (length clusters))
@@ -90,7 +90,7 @@ GRAPHICS-WINDOW
9090
12
9191
13.0
9292
1
93-
8
93+
9
9494
1
9595
1
9696
1
@@ -149,42 +149,58 @@ NIL
149149
NIL
150150
1
151151

152+
SLIDER
153+
185
154+
12
155+
357
156+
45
157+
maximum-distance
158+
maximum-distance
159+
0
160+
20
161+
3
162+
1
163+
1
164+
NIL
165+
HORIZONTAL
166+
167+
SLIDER
168+
185
169+
54
170+
397
171+
87
172+
minimum-number-of-members
173+
minimum-number-of-members
174+
0
175+
20
176+
3
177+
1
178+
1
179+
NIL
180+
HORIZONTAL
181+
152182
@#$#@#$#@
153183
## WHAT IS IT?
154184

155-
(a general understanding of what the model is trying to show or explain)
185+
This model demontrates the use of the DBSCAN extension. It highlights both clustering by variable as well as location.
156186

157187
## HOW IT WORKS
158188

159-
(what rules the agents use to create the overall behavior of the model)
160-
161-
## HOW TO USE IT
189+
For variable-based clustering, individuals are clustered based on the value difference of their wealth levels.
162190

163-
(how to use the model, including a description of each of the items in the Interface tab)
191+
For location-based clustering, individuals are clustered based on their proximity.
164192

165-
## THINGS TO NOTICE
193+
## HOW TO USE IT
166194

167-
(suggested things for the user to notice while running the model)
195+
Click either button and observe how the clustering works both for variable-based clustering and location-based clustering.
168196

169197
## THINGS TO TRY
170198

171-
(suggested things for the user to try to do (move sliders, switches, etc.) with the model)
172-
173-
## EXTENDING THE MODEL
174-
175-
(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)
199+
Try varying the permissive distance (i.e. wealth difference levels for variable-based clustering, and spatial distance for location-based clustering) as well as the number of members required to form a cluster.
176200

177201
## NETLOGO FEATURES
178202

179-
(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)
180-
181-
## RELATED MODELS
182-
183-
(models in the NetLogo Models Library and elsewhere which are of related interest)
184-
185-
## CREDITS AND REFERENCES
186-
187-
(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)
203+
Note that this model relies on the DBSCAN extension found under https://github.com/chrfrantz/NetLogo-Extension-DBSCAN/
188204
@#$#@#$#@
189205
default
190206
true
-3.32 KB
Loading

0 commit comments

Comments
 (0)