From f091cca99bad0e7a8a44de69d9f3d72cbd9126e0 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Sat, 12 Oct 2024 21:26:19 +0200 Subject: [PATCH 01/69] Create file for NetLogo implementation --- .../Creation of Network with Preferential Attachment | 1 + 1 file changed, 1 insertion(+) create mode 100644 2024-Jarigsma-001/netlogo_implementation/Creation of Network with Preferential Attachment diff --git a/2024-Jarigsma-001/netlogo_implementation/Creation of Network with Preferential Attachment b/2024-Jarigsma-001/netlogo_implementation/Creation of Network with Preferential Attachment new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/2024-Jarigsma-001/netlogo_implementation/Creation of Network with Preferential Attachment @@ -0,0 +1 @@ + From f3cf1d81f3fb1c0ec7f49d75e3f2e015eb204d90 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Sat, 12 Oct 2024 22:35:24 +0200 Subject: [PATCH 02/69] Update Creation of Network with Preferential Attachment --- ...on of Network with Preferential Attachment | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/2024-Jarigsma-001/netlogo_implementation/Creation of Network with Preferential Attachment b/2024-Jarigsma-001/netlogo_implementation/Creation of Network with Preferential Attachment index 8b13789..3f52ab6 100644 --- a/2024-Jarigsma-001/netlogo_implementation/Creation of Network with Preferential Attachment +++ b/2024-Jarigsma-001/netlogo_implementation/Creation of Network with Preferential Attachment @@ -1 +1,89 @@ +breed [nodes node] +nodes-own [ + state ;; current state (ranges from 0 to 1) + orig-state ;; each person's initially assigned state (either 0 or 1) + output-state ;; output of person's preference (0 or 1) +] + +;;; +;;; SETUP PROCEDURES +;;; + +to setup + clear-all + set-default-shape nodes "circle" + repeat num-nodes [ make-node ] ;; create a slider with the variable 'num-nodes' + create-network + distribute-states + ask patches [ set pcolor gray ] + repeat num-nodes [ layout ] + reset-ticks +end + +to make-node + create-nodes 1 [ + rt random-float 360 + fd max-pxcor + set size 2 + set state 0.0 + ] +end + + +to distribute-states + ask nodes [ set state 0 ] + + ;; Randomly select a proportion of nodes to initialize with state 1 + ;; For this section of code to work a slider 'percent-state-1' + ask n-of ((percent-state-1 / 100) * num-nodes) nodes + [ set state 1.0 ] + ask nodes [ + set orig-state state ;; Store the original state for resetting + set output-state state + update-color ;; Update node color based on state + ] +end + +to create-network + ;; For this module to work, ensure the following: + ;; - There are nodes created and initialized with states. + + ;; make the initial network of two nodes and an edge + let partner nobody + let first-node one-of nodes + let second-node one-of nodes with [self != first-node] + + ;; make the first edge + ask first-node [ create-link-with second-node [ set color white ] ] + ;; randomly select unattached node and connect it to a partner already in the network + let new-node one-of nodes with [not any? link-neighbors] + while [new-node != nobody] [ + set partner find-partner + ask new-node [ create-link-with partner [ set color white ] ] + layout + set new-node one-of nodes with [not any? link-neighbors] + ] +end + +to update-color + set color scale-color red state 0 1 +end + +to-report find-partner + let pick random-float sum [count link-neighbors] of (nodes with [any? link-neighbors]) + let partner nobody + ask nodes + [ ;; if there's no winner yet + if partner = nobody + [ ifelse count link-neighbors > pick + [ set partner self] + [ set pick pick - (count link-neighbors)] + ] + ] + report partner +end + +to layout + layout-spring (turtles with [any? link-neighbors]) links 0.4 6 1 +end From c272b160e62d0d899c425c232c08a4c510077060 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Sat, 12 Oct 2024 22:40:42 +0200 Subject: [PATCH 03/69] Create CHANGELOG.md --- 2024-Jarigsma-001/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 2024-Jarigsma-001/CHANGELOG.md diff --git a/2024-Jarigsma-001/CHANGELOG.md b/2024-Jarigsma-001/CHANGELOG.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/2024-Jarigsma-001/CHANGELOG.md @@ -0,0 +1 @@ + From 02df21b582f57fe946505dfe2554be66fef7a9f0 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Sat, 12 Oct 2024 22:41:19 +0200 Subject: [PATCH 04/69] Create LICENSE --- 2024-Jarigsma-001/LICENSE | 1 + 1 file changed, 1 insertion(+) create mode 100644 2024-Jarigsma-001/LICENSE diff --git a/2024-Jarigsma-001/LICENSE b/2024-Jarigsma-001/LICENSE new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/2024-Jarigsma-001/LICENSE @@ -0,0 +1 @@ + From 203536da5c027c2525a7eb29271287ce3a443ba1 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Sat, 12 Oct 2024 22:41:48 +0200 Subject: [PATCH 05/69] Create NASSA.yml --- 2024-Jarigsma-001/NASSA.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 2024-Jarigsma-001/NASSA.yml diff --git a/2024-Jarigsma-001/NASSA.yml b/2024-Jarigsma-001/NASSA.yml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/2024-Jarigsma-001/NASSA.yml @@ -0,0 +1 @@ + From 3c5dc8533396174c34920ced8f4d2f0ede703526 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Sat, 12 Oct 2024 22:42:17 +0200 Subject: [PATCH 06/69] Create README.md --- 2024-Jarigsma-001/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 2024-Jarigsma-001/README.md diff --git a/2024-Jarigsma-001/README.md b/2024-Jarigsma-001/README.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/2024-Jarigsma-001/README.md @@ -0,0 +1 @@ + From 124f155a242f86a60bead8cd89b457fd05abab86 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Sat, 12 Oct 2024 22:42:33 +0200 Subject: [PATCH 07/69] Create references.bib --- 2024-Jarigsma-001/references.bib | 1 + 1 file changed, 1 insertion(+) create mode 100644 2024-Jarigsma-001/references.bib diff --git a/2024-Jarigsma-001/references.bib b/2024-Jarigsma-001/references.bib new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/2024-Jarigsma-001/references.bib @@ -0,0 +1 @@ + From eedf4522bd9793cdc6c7a9b268845b5c44aef044 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Sat, 12 Oct 2024 22:45:16 +0200 Subject: [PATCH 08/69] Rename Creation of Network with Preferential Attachment to PreferentialAttachment.nlogo --- ... with Preferential Attachment => PreferentialAttachment.nlogo} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename 2024-Jarigsma-001/netlogo_implementation/{Creation of Network with Preferential Attachment => PreferentialAttachment.nlogo} (100%) diff --git a/2024-Jarigsma-001/netlogo_implementation/Creation of Network with Preferential Attachment b/2024-Jarigsma-001/netlogo_implementation/PreferentialAttachment.nlogo similarity index 100% rename from 2024-Jarigsma-001/netlogo_implementation/Creation of Network with Preferential Attachment rename to 2024-Jarigsma-001/netlogo_implementation/PreferentialAttachment.nlogo From 2cfb3433a88878dc1c837c08c2b37629017fa1a0 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Sat, 12 Oct 2024 22:46:02 +0200 Subject: [PATCH 09/69] Rename PreferentialAttachment.nlogo to preferential_attachment.nlogo --- ...PreferentialAttachment.nlogo => preferential_attachment.nlogo} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename 2024-Jarigsma-001/netlogo_implementation/{PreferentialAttachment.nlogo => preferential_attachment.nlogo} (100%) diff --git a/2024-Jarigsma-001/netlogo_implementation/PreferentialAttachment.nlogo b/2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo similarity index 100% rename from 2024-Jarigsma-001/netlogo_implementation/PreferentialAttachment.nlogo rename to 2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo From 90f5d1309db0f9d6841d05448509fc32a8085424 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Sat, 12 Oct 2024 22:49:51 +0200 Subject: [PATCH 10/69] Update preferential_attachment.nlogo From 5684d537e399bc88d5c36e5f065f91eda798b9f6 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Sat, 12 Oct 2024 22:54:37 +0200 Subject: [PATCH 11/69] Update preferential_attachment.nlogo --- .../netlogo_implementation/preferential_attachment.nlogo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo b/2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo index 3f52ab6..d28b68f 100644 --- a/2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo +++ b/2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo @@ -35,7 +35,7 @@ to distribute-states ask nodes [ set state 0 ] ;; Randomly select a proportion of nodes to initialize with state 1 - ;; For this section of code to work a slider 'percent-state-1' + ;; For this section of code to work, create a slider with variable 'percent-state-1' ask n-of ((percent-state-1 / 100) * num-nodes) nodes [ set state 1.0 ] ask nodes [ From 55153aada9f1e5d22790b06cb0e0a1bbefb3f403 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Mon, 14 Oct 2024 10:01:31 +0200 Subject: [PATCH 12/69] Create framework_preferential_attachment --- .../framework_preferential_attachment | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment diff --git a/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment b/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment new file mode 100644 index 0000000..8739986 --- /dev/null +++ b/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment @@ -0,0 +1,57 @@ +breed [nodes node] + +nodes-own [ + state ;; current state (ranges from 0 to 1) +] + + +;; DISTRIBUTE STATES IN THE SETUP PROCEDURE + ;; For this section of code to work: + ;; (1) create a slider with variable 'percent-state-1' + ;; (2) create a slider with variable 'num-nodes' OR replace 'num-nodes' in the code with the number of nodes in your network + +to distribute-states + ask nodes [ set state 0 ] + ask n-of ((percent-state-1 / 100) * num-nodes) nodes + [ set state 1.0 ] +end + + +;; CREATE NETWORK IN SETUP PROCEDURE + + +to create-network + ;; make the initial network of two nodes and an edge + let partner nobody + let first-node one-of nodes + let second-node one-of nodes with [self != first-node] + ask first-node [ create-link-with second-node [ set color white ] ] + + ;; randomly select unattached node and connect it to a partner already in the network + let new-node one-of nodes with [not any? link-neighbors] + while [new-node != nobody] [ + set partner find-partner + ask new-node [ create-link-with partner [ set color white ] ] + layout + set new-node one-of nodes with [not any? link-neighbors] + ] +end + +;; nodes with more connections (link-neighbors) are more likely to be chosen +to-report find-partner + let pick random-float sum [count link-neighbors] of (nodes with [any? link-neighbors]) + let partner nobody + ask nodes + [ ;; if there's no winner yet + if partner = nobody + [ ifelse count link-neighbors > pick + [ set partner self] + [ set pick pick - (count link-neighbors)] + ] + ] + report partner +end + +to layout + layout-spring (turtles with [any? link-neighbors]) links 0.4 6 1 +end From 447b051a9b42ac5c0ebc56cfa72f34b42c00453d Mon Sep 17 00:00:00 2001 From: AmberHam Date: Mon, 14 Oct 2024 10:01:50 +0200 Subject: [PATCH 13/69] Rename framework_preferential_attachment to framework_preferential_attachment.nlogo --- ...rential_attachment => framework_preferential_attachment.nlogo} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename 2024-Jarigsma-001/netlogo_implementation/{framework_preferential_attachment => framework_preferential_attachment.nlogo} (100%) diff --git a/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment b/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo similarity index 100% rename from 2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment rename to 2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo From 5e68782313a612f0ccb0d7c22544b32d9a2a69ea Mon Sep 17 00:00:00 2001 From: AmberHam Date: Mon, 14 Oct 2024 10:08:14 +0200 Subject: [PATCH 14/69] Update framework_preferential_attachment.nlogo --- .../framework_preferential_attachment.nlogo | 26 ++++--------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo b/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo index 8739986..4ab46ce 100644 --- a/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo +++ b/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo @@ -1,25 +1,8 @@ -breed [nodes node] - -nodes-own [ - state ;; current state (ranges from 0 to 1) -] - - -;; DISTRIBUTE STATES IN THE SETUP PROCEDURE - ;; For this section of code to work: - ;; (1) create a slider with variable 'percent-state-1' - ;; (2) create a slider with variable 'num-nodes' OR replace 'num-nodes' in the code with the number of nodes in your network - -to distribute-states - ask nodes [ set state 0 ] - ask n-of ((percent-state-1 / 100) * num-nodes) nodes - [ set state 1.0 ] -end +breed [nodes node] ;; Define a new breed of agents called 'nodes' ;; CREATE NETWORK IN SETUP PROCEDURE - to create-network ;; make the initial network of two nodes and an edge let partner nobody @@ -52,6 +35,7 @@ to-report find-partner report partner end -to layout - layout-spring (turtles with [any? link-neighbors]) links 0.4 6 1 -end +;; THIS PART IS NOT NECESSARY BUT VERY HELPFUL +;to layout +; layout-spring (turtles with [any? link-neighbors]) links 0.4 6 1 +;end From 474cc898884e06284e6b6dd686cda5c5058d1d4c Mon Sep 17 00:00:00 2001 From: AmberHam Date: Mon, 14 Oct 2024 10:10:27 +0200 Subject: [PATCH 15/69] Update framework_preferential_attachment.nlogo --- .../framework_preferential_attachment.nlogo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo b/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo index 4ab46ce..d3f0581 100644 --- a/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo +++ b/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo @@ -15,7 +15,7 @@ to create-network while [new-node != nobody] [ set partner find-partner ask new-node [ create-link-with partner [ set color white ] ] - layout + ;layout set new-node one-of nodes with [not any? link-neighbors] ] end @@ -35,7 +35,7 @@ to-report find-partner report partner end -;; THIS PART IS NOT NECESSARY BUT VERY HELPFUL +;; THIS PART IS NOT NECESSARY BUT VERY HELPFUL. If used, make sure to remove the semi-colon before 'layout' in the 'to create-network' function ;to layout ; layout-spring (turtles with [any? link-neighbors]) links 0.4 6 1 ;end From 24f0985d7b9f7fce77e7480aa0e4c57b8a5c567b Mon Sep 17 00:00:00 2001 From: AmberHam Date: Mon, 14 Oct 2024 10:15:02 +0200 Subject: [PATCH 16/69] Update preferential_attachment.nlogo --- .../preferential_attachment.nlogo | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo b/2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo index d28b68f..2c605d6 100644 --- a/2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo +++ b/2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo @@ -1,4 +1,4 @@ -breed [nodes node] +breed [nodes node] nodes-own [ state ;; current state (ranges from 0 to 1) @@ -16,7 +16,7 @@ to setup repeat num-nodes [ make-node ] ;; create a slider with the variable 'num-nodes' create-network distribute-states - ask patches [ set pcolor gray ] + ask patches [ set pcolor gray ] repeat num-nodes [ layout ] reset-ticks end @@ -35,27 +35,28 @@ to distribute-states ask nodes [ set state 0 ] ;; Randomly select a proportion of nodes to initialize with state 1 - ;; For this section of code to work, create a slider with variable 'percent-state-1' + ;; For this section of code to work a slider 'percent-state-1' ask n-of ((percent-state-1 / 100) * num-nodes) nodes [ set state 1.0 ] ask nodes [ set orig-state state ;; Store the original state for resetting - set output-state state + set output-state state update-color ;; Update node color based on state ] end +to update-color + set color scale-color red state 0 1 +end + to create-network - ;; For this module to work, ensure the following: - ;; - There are nodes created and initialized with states. ;; make the initial network of two nodes and an edge let partner nobody let first-node one-of nodes let second-node one-of nodes with [self != first-node] - - ;; make the first edge ask first-node [ create-link-with second-node [ set color white ] ] + ;; randomly select unattached node and connect it to a partner already in the network let new-node one-of nodes with [not any? link-neighbors] while [new-node != nobody] [ @@ -66,15 +67,10 @@ to create-network ] end -to update-color - set color scale-color red state 0 1 -end - to-report find-partner let pick random-float sum [count link-neighbors] of (nodes with [any? link-neighbors]) let partner nobody - ask nodes - [ ;; if there's no winner yet + ask nodes [ if partner = nobody [ ifelse count link-neighbors > pick [ set partner self] From 587ffb989204f75419dc448ca1e025d762ff48da Mon Sep 17 00:00:00 2001 From: AmberHam Date: Mon, 14 Oct 2024 10:19:58 +0200 Subject: [PATCH 17/69] Update preferential_attachment.nlogo --- .../preferential_attachment.nlogo | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo b/2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo index 2c605d6..6bc6b83 100644 --- a/2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo +++ b/2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo @@ -1,4 +1,4 @@ -breed [nodes node] +breed [nodes node] ;; Define a breed of agents called 'nodes' nodes-own [ state ;; current state (ranges from 0 to 1) @@ -8,12 +8,15 @@ nodes-own [ ;;; ;;; SETUP PROCEDURES -;;; +;;; For this section of code to work: +;;; (1) create a slider with variable 'num-nodes' to represent the number of nodes in your network, +;;; or replace 'num-nodes' in the code with the number of nodes in your network +;;; (2) create a slider with variable 'percent-state-1' to represent the percentage of nodes that are initialised with state 1 to setup clear-all set-default-shape nodes "circle" - repeat num-nodes [ make-node ] ;; create a slider with the variable 'num-nodes' + repeat num-nodes [ make-node ] create-network distribute-states ask patches [ set pcolor gray ] @@ -35,7 +38,6 @@ to distribute-states ask nodes [ set state 0 ] ;; Randomly select a proportion of nodes to initialize with state 1 - ;; For this section of code to work a slider 'percent-state-1' ask n-of ((percent-state-1 / 100) * num-nodes) nodes [ set state 1.0 ] ask nodes [ @@ -50,7 +52,6 @@ to update-color end to create-network - ;; make the initial network of two nodes and an edge let partner nobody let first-node one-of nodes From 72b624e04bbd76bbcfee37d5d481bcc7ece1068b Mon Sep 17 00:00:00 2001 From: AmberHam Date: Mon, 14 Oct 2024 10:48:58 +0200 Subject: [PATCH 18/69] Update LICENSE --- 2024-Jarigsma-001/LICENSE | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/2024-Jarigsma-001/LICENSE b/2024-Jarigsma-001/LICENSE index 8b13789..799ee5b 100644 --- a/2024-Jarigsma-001/LICENSE +++ b/2024-Jarigsma-001/LICENSE @@ -1 +1,7 @@ +Copyright 2024 Amber Esha Jarigsma +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. From 0f2635c8cfa5754dc5629102ab43f29200b9000b Mon Sep 17 00:00:00 2001 From: AmberHam Date: Mon, 14 Oct 2024 11:12:45 +0200 Subject: [PATCH 19/69] Update references.bib --- 2024-Jarigsma-001/references.bib | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/2024-Jarigsma-001/references.bib b/2024-Jarigsma-001/references.bib index 8b13789..a25100d 100644 --- a/2024-Jarigsma-001/references.bib +++ b/2024-Jarigsma-001/references.bib @@ -1 +1,7 @@ - +@misc{Troutman-Wilensky-2007, +title = {NetLogo Language Change model}, +author = {Troutman, C. and Wilensky, U.}, +year = {2007}, +note = {Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL} +howpublished = {\url{http://ccl.northwestern.edu/netlogo/models/LanguageChange}} +} From e98624d72a924c4b1b0a084176217f36a7b207ed Mon Sep 17 00:00:00 2001 From: AmberHam Date: Thu, 17 Oct 2024 12:36:49 +0200 Subject: [PATCH 20/69] Update LICENSE --- 2024-Jarigsma-001/LICENSE | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/2024-Jarigsma-001/LICENSE b/2024-Jarigsma-001/LICENSE index 799ee5b..8c82197 100644 --- a/2024-Jarigsma-001/LICENSE +++ b/2024-Jarigsma-001/LICENSE @@ -1,7 +1,4 @@ -Copyright 2024 Amber Esha Jarigsma +Copyright 2007 Uri Wilensky -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. +Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu. From f8bc7845a53dffe93860ce2e83da28ef96b86598 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Thu, 17 Oct 2024 12:57:48 +0200 Subject: [PATCH 21/69] Update preferential_attachment.nlogo --- .../netlogo_implementation/preferential_attachment.nlogo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo b/2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo index 6bc6b83..e982ce5 100644 --- a/2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo +++ b/2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo @@ -33,7 +33,6 @@ to make-node ] end - to distribute-states ask nodes [ set state 0 ] @@ -68,6 +67,7 @@ to create-network ] end +;; nodes with more connections (link-neighbors) are more likely to be chosen to-report find-partner let pick random-float sum [count link-neighbors] of (nodes with [any? link-neighbors]) let partner nobody From 2e8798f4e9d7ce39687a75b3c5497f83b8e0523b Mon Sep 17 00:00:00 2001 From: AmberHam Date: Thu, 17 Oct 2024 13:02:03 +0200 Subject: [PATCH 22/69] Update framework_preferential_attachment.nlogo --- .../framework_preferential_attachment.nlogo | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo b/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo index d3f0581..fd8b559 100644 --- a/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo +++ b/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo @@ -35,7 +35,9 @@ to-report find-partner report partner end -;; THIS PART IS NOT NECESSARY BUT VERY HELPFUL. If used, make sure to remove the semi-colon before 'layout' in the 'to create-network' function +;; THE FOLLOWING PROCEDURE IS NOT NECESSARY BUT VERY HELPFUL +;; If used, make sure to remove the semi-colon before 'layout' in the 'to create-network' function + ;to layout ; layout-spring (turtles with [any? link-neighbors]) links 0.4 6 1 ;end From ec04b449f2d3eae86bd2a3ac18556d78b106dce6 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Thu, 17 Oct 2024 13:04:05 +0200 Subject: [PATCH 23/69] Update framework_preferential_attachment.nlogo --- .../framework_preferential_attachment.nlogo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo b/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo index fd8b559..df3a875 100644 --- a/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo +++ b/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo @@ -36,7 +36,7 @@ to-report find-partner end ;; THE FOLLOWING PROCEDURE IS NOT NECESSARY BUT VERY HELPFUL -;; If used, make sure to remove the semi-colon before 'layout' in the 'to create-network' function +;; If used, make sure to remove the semi-colon before 'layout' in the 'to create-network' procedure ;to layout ; layout-spring (turtles with [any? link-neighbors]) links 0.4 6 1 From 12fe329a660a020dd11eb1e81076474ba2fcf113 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Thu, 17 Oct 2024 13:06:36 +0200 Subject: [PATCH 24/69] Update framework_preferential_attachment.nlogo --- .../framework_preferential_attachment.nlogo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo b/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo index df3a875..b309257 100644 --- a/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo +++ b/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo @@ -35,7 +35,7 @@ to-report find-partner report partner end -;; THE FOLLOWING PROCEDURE IS NOT NECESSARY BUT VERY HELPFUL +;; THE FOLLOWING PROCEDURE IS NOT NECESSARY BUT VERY HELPFUL FOR VISUALISATION ;; If used, make sure to remove the semi-colon before 'layout' in the 'to create-network' procedure ;to layout From 4906a27c9eb94a0ec189be72734fa5d67a482b20 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Thu, 17 Oct 2024 14:20:26 +0200 Subject: [PATCH 25/69] Add files via upload --- ...k Creation (Preferential Attachment).nlogo | 522 ++++++++++++++++++ 1 file changed, 522 insertions(+) create mode 100644 2024-Jarigsma-001/netlogo_implementation/Network Creation (Preferential Attachment).nlogo diff --git a/2024-Jarigsma-001/netlogo_implementation/Network Creation (Preferential Attachment).nlogo b/2024-Jarigsma-001/netlogo_implementation/Network Creation (Preferential Attachment).nlogo new file mode 100644 index 0000000..500438c --- /dev/null +++ b/2024-Jarigsma-001/netlogo_implementation/Network Creation (Preferential Attachment).nlogo @@ -0,0 +1,522 @@ +breed [nodes node] ;; Define a breed of agents called 'nodes' + +nodes-own [ + state ;; current state (ranges from 0 to 1) + orig-state ;; each person's initially assigned state (either 0 or 1) + output-state ;; output of person's preference (0 or 1) +] + +;;; +;;; SETUP PROCEDURES +;;; For this section of code to work: +;;; (1) create a slider with variable 'num-nodes' to represent the number of nodes in your network, +;;; or replace 'num-nodes' in the code with the number of nodes in your network +;;; (2) create a slider with variable 'percent-state-1' to represent the percentage of nodes that are initialised with state 1 + +to setup + clear-all + set-default-shape nodes "circle" + repeat num-nodes [ make-node ] + create-network + distribute-states + ask patches [ set pcolor gray ] + repeat num-nodes [ layout ] + reset-ticks +end + +to make-node + create-nodes 1 [ + rt random-float 360 + fd max-pxcor + set size 2 + set state 0.0 + ] +end + +to distribute-states + ask nodes [ set state 0 ] + + ;; Randomly select a proportion of nodes to initialize with state 1 + ask n-of ((percent-state-1 / 100) * num-nodes) nodes + [ set state 1.0 ] + ask nodes [ + set orig-state state ;; Store the original state for resetting + set output-state state + update-color ;; Update node color based on state + ] +end + +to update-color + set color scale-color red state 0 1 +end + +to create-network + ;; make the initial network of two nodes and an edge + let partner nobody + let first-node one-of nodes + let second-node one-of nodes with [self != first-node] + ask first-node [ create-link-with second-node [ set color white ] ] + + ;; randomly select unattached node and connect it to a partner already in the network + let new-node one-of nodes with [not any? link-neighbors] + while [new-node != nobody] [ + set partner find-partner + ask new-node [ create-link-with partner [ set color white ] ] + layout + set new-node one-of nodes with [not any? link-neighbors] + ] +end + +;; nodes with more connections (link-neighbors) are more likely to be chosen +to-report find-partner + let pick random-float sum [count link-neighbors] of (nodes with [any? link-neighbors]) + let partner nobody + ask nodes [ + if partner = nobody + [ ifelse count link-neighbors > pick + [ set partner self] + [ set pick pick - (count link-neighbors)] + ] + ] + report partner +end + +to layout + layout-spring (turtles with [any? link-neighbors]) links 0.4 6 1 +end +@#$#@#$#@ +GRAPHICS-WINDOW +210 +10 +647 +448 +-1 +-1 +13.0 +1 +10 +1 +1 +1 +0 +1 +1 +1 +-16 +16 +-16 +16 +0 +0 +1 +ticks +30.0 + +BUTTON +14 +25 +80 +58 +NIL +setup +NIL +1 +T +OBSERVER +NIL +NIL +NIL +NIL +1 + +SLIDER +22 +99 +194 +132 +num-nodes +num-nodes +0 +100 +50.0 +1 +1 +NIL +HORIZONTAL + +SLIDER +22 +145 +201 +178 +percent-state-1 +percent-state-1 +0 +100 +50.0 +1 +1 +NIL +HORIZONTAL + +@#$#@#$#@ +## WHAT IS IT? + +(a general understanding of what the model is trying to show or explain) + +## HOW IT WORKS + +(what rules the agents use to create the overall behavior of the model) + +## HOW TO USE IT + +(how to use the model, including a description of each of the items in the Interface tab) + +## THINGS TO NOTICE + +(suggested things for the user to notice while running the model) + +## THINGS TO TRY + +(suggested things for the user to try to do (move sliders, switches, etc.) with the model) + +## EXTENDING THE MODEL + +(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.) + +## NETLOGO FEATURES + +(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features) + +## RELATED MODELS + +(models in the NetLogo Models Library and elsewhere which are of related interest) + +## CREDITS AND REFERENCES + +(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links) +@#$#@#$#@ +default +true +0 +Polygon -7500403 true true 150 5 40 250 150 205 260 250 + +airplane +true +0 +Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15 + +arrow +true +0 +Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 + +box +false +0 +Polygon -7500403 true true 150 285 285 225 285 75 150 135 +Polygon -7500403 true true 150 135 15 75 150 15 285 75 +Polygon -7500403 true true 15 75 15 225 150 285 150 135 +Line -16777216 false 150 285 150 135 +Line -16777216 false 150 135 15 75 +Line -16777216 false 150 135 285 75 + +bug +true +0 +Circle -7500403 true true 96 182 108 +Circle -7500403 true true 110 127 80 +Circle -7500403 true true 110 75 80 +Line -7500403 true 150 100 80 30 +Line -7500403 true 150 100 220 30 + +butterfly +true +0 +Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240 +Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240 +Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163 +Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165 +Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225 +Circle -16777216 true false 135 90 30 +Line -16777216 false 150 105 195 60 +Line -16777216 false 150 105 105 60 + +car +false +0 +Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180 +Circle -16777216 true false 180 180 90 +Circle -16777216 true false 30 180 90 +Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89 +Circle -7500403 true true 47 195 58 +Circle -7500403 true true 195 195 58 + +circle +false +0 +Circle -7500403 true true 0 0 300 + +circle 2 +false +0 +Circle -7500403 true true 0 0 300 +Circle -16777216 true false 30 30 240 + +cow +false +0 +Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167 +Polygon -7500403 true true 73 210 86 251 62 249 48 208 +Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123 + +cylinder +false +0 +Circle -7500403 true true 0 0 300 + +dot +false +0 +Circle -7500403 true true 90 90 120 + +face happy +false +0 +Circle -7500403 true true 8 8 285 +Circle -16777216 true false 60 75 60 +Circle -16777216 true false 180 75 60 +Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240 + +face neutral +false +0 +Circle -7500403 true true 8 7 285 +Circle -16777216 true false 60 75 60 +Circle -16777216 true false 180 75 60 +Rectangle -16777216 true false 60 195 240 225 + +face sad +false +0 +Circle -7500403 true true 8 8 285 +Circle -16777216 true false 60 75 60 +Circle -16777216 true false 180 75 60 +Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183 + +fish +false +0 +Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166 +Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165 +Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60 +Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166 +Circle -16777216 true false 215 106 30 + +flag +false +0 +Rectangle -7500403 true true 60 15 75 300 +Polygon -7500403 true true 90 150 270 90 90 30 +Line -7500403 true 75 135 90 135 +Line -7500403 true 75 45 90 45 + +flower +false +0 +Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135 +Circle -7500403 true true 85 132 38 +Circle -7500403 true true 130 147 38 +Circle -7500403 true true 192 85 38 +Circle -7500403 true true 85 40 38 +Circle -7500403 true true 177 40 38 +Circle -7500403 true true 177 132 38 +Circle -7500403 true true 70 85 38 +Circle -7500403 true true 130 25 38 +Circle -7500403 true true 96 51 108 +Circle -16777216 true false 113 68 74 +Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218 +Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240 + +house +false +0 +Rectangle -7500403 true true 45 120 255 285 +Rectangle -16777216 true false 120 210 180 285 +Polygon -7500403 true true 15 120 150 15 285 120 +Line -16777216 false 30 120 270 120 + +leaf +false +0 +Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195 +Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195 + +line +true +0 +Line -7500403 true 150 0 150 300 + +line half +true +0 +Line -7500403 true 150 0 150 150 + +pentagon +false +0 +Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120 + +person +false +0 +Circle -7500403 true true 110 5 80 +Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90 +Rectangle -7500403 true true 127 79 172 94 +Polygon -7500403 true true 195 90 240 150 225 180 165 105 +Polygon -7500403 true true 105 90 60 150 75 180 135 105 + +plant +false +0 +Rectangle -7500403 true true 135 90 165 300 +Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285 +Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285 +Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210 +Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135 +Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135 +Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60 +Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90 + +sheep +false +15 +Circle -1 true true 203 65 88 +Circle -1 true true 70 65 162 +Circle -1 true true 150 105 120 +Polygon -7500403 true false 218 120 240 165 255 165 278 120 +Circle -7500403 true false 214 72 67 +Rectangle -1 true true 164 223 179 298 +Polygon -1 true true 45 285 30 285 30 240 15 195 45 210 +Circle -1 true true 3 83 150 +Rectangle -1 true true 65 221 80 296 +Polygon -1 true true 195 285 210 285 210 240 240 210 195 210 +Polygon -7500403 true false 276 85 285 105 302 99 294 83 +Polygon -7500403 true false 219 85 210 105 193 99 201 83 + +square +false +0 +Rectangle -7500403 true true 30 30 270 270 + +square 2 +false +0 +Rectangle -7500403 true true 30 30 270 270 +Rectangle -16777216 true false 60 60 240 240 + +star +false +0 +Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108 + +target +false +0 +Circle -7500403 true true 0 0 300 +Circle -16777216 true false 30 30 240 +Circle -7500403 true true 60 60 180 +Circle -16777216 true false 90 90 120 +Circle -7500403 true true 120 120 60 + +tree +false +0 +Circle -7500403 true true 118 3 94 +Rectangle -6459832 true false 120 195 180 300 +Circle -7500403 true true 65 21 108 +Circle -7500403 true true 116 41 127 +Circle -7500403 true true 45 90 120 +Circle -7500403 true true 104 74 152 + +triangle +false +0 +Polygon -7500403 true true 150 30 15 255 285 255 + +triangle 2 +false +0 +Polygon -7500403 true true 150 30 15 255 285 255 +Polygon -16777216 true false 151 99 225 223 75 224 + +truck +false +0 +Rectangle -7500403 true true 4 45 195 187 +Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194 +Rectangle -1 true false 195 60 195 105 +Polygon -16777216 true false 238 112 252 141 219 141 218 112 +Circle -16777216 true false 234 174 42 +Rectangle -7500403 true true 181 185 214 194 +Circle -16777216 true false 144 174 42 +Circle -16777216 true false 24 174 42 +Circle -7500403 false true 24 174 42 +Circle -7500403 false true 144 174 42 +Circle -7500403 false true 234 174 42 + +turtle +true +0 +Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210 +Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105 +Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105 +Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87 +Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210 +Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99 + +wheel +false +0 +Circle -7500403 true true 3 3 294 +Circle -16777216 true false 30 30 240 +Line -7500403 true 150 285 150 15 +Line -7500403 true 15 150 285 150 +Circle -7500403 true true 120 120 60 +Line -7500403 true 216 40 79 269 +Line -7500403 true 40 84 269 221 +Line -7500403 true 40 216 269 79 +Line -7500403 true 84 40 221 269 + +wolf +false +0 +Polygon -16777216 true false 253 133 245 131 245 133 +Polygon -7500403 true true 2 194 13 197 30 191 38 193 38 205 20 226 20 257 27 265 38 266 40 260 31 253 31 230 60 206 68 198 75 209 66 228 65 243 82 261 84 268 100 267 103 261 77 239 79 231 100 207 98 196 119 201 143 202 160 195 166 210 172 213 173 238 167 251 160 248 154 265 169 264 178 247 186 240 198 260 200 271 217 271 219 262 207 258 195 230 192 198 210 184 227 164 242 144 259 145 284 151 277 141 293 140 299 134 297 127 273 119 270 105 +Polygon -7500403 true true -1 195 14 180 36 166 40 153 53 140 82 131 134 133 159 126 188 115 227 108 236 102 238 98 268 86 269 92 281 87 269 103 269 113 + +x +false +0 +Polygon -7500403 true true 270 75 225 30 30 225 75 270 +Polygon -7500403 true true 30 75 75 30 270 225 225 270 +@#$#@#$#@ +NetLogo 6.4.0 +@#$#@#$#@ +@#$#@#$#@ +@#$#@#$#@ +@#$#@#$#@ +@#$#@#$#@ +default +0.0 +-0.2 0 0.0 1.0 +0.0 1 1.0 0.0 +0.2 0 0.0 1.0 +link direction +true +0 +Line -7500403 true 150 150 90 180 +Line -7500403 true 150 150 210 180 +@#$#@#$#@ +0 +@#$#@#$#@ From aad2e72ede9953fd25719540aa978dd7a49ba4fa Mon Sep 17 00:00:00 2001 From: AmberHam Date: Thu, 17 Oct 2024 14:20:53 +0200 Subject: [PATCH 26/69] Delete 2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo --- .../preferential_attachment.nlogo | 86 ------------------- 1 file changed, 86 deletions(-) delete mode 100644 2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo diff --git a/2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo b/2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo deleted file mode 100644 index e982ce5..0000000 --- a/2024-Jarigsma-001/netlogo_implementation/preferential_attachment.nlogo +++ /dev/null @@ -1,86 +0,0 @@ -breed [nodes node] ;; Define a breed of agents called 'nodes' - -nodes-own [ - state ;; current state (ranges from 0 to 1) - orig-state ;; each person's initially assigned state (either 0 or 1) - output-state ;; output of person's preference (0 or 1) -] - -;;; -;;; SETUP PROCEDURES -;;; For this section of code to work: -;;; (1) create a slider with variable 'num-nodes' to represent the number of nodes in your network, -;;; or replace 'num-nodes' in the code with the number of nodes in your network -;;; (2) create a slider with variable 'percent-state-1' to represent the percentage of nodes that are initialised with state 1 - -to setup - clear-all - set-default-shape nodes "circle" - repeat num-nodes [ make-node ] - create-network - distribute-states - ask patches [ set pcolor gray ] - repeat num-nodes [ layout ] - reset-ticks -end - -to make-node - create-nodes 1 [ - rt random-float 360 - fd max-pxcor - set size 2 - set state 0.0 - ] -end - -to distribute-states - ask nodes [ set state 0 ] - - ;; Randomly select a proportion of nodes to initialize with state 1 - ask n-of ((percent-state-1 / 100) * num-nodes) nodes - [ set state 1.0 ] - ask nodes [ - set orig-state state ;; Store the original state for resetting - set output-state state - update-color ;; Update node color based on state - ] -end - -to update-color - set color scale-color red state 0 1 -end - -to create-network - ;; make the initial network of two nodes and an edge - let partner nobody - let first-node one-of nodes - let second-node one-of nodes with [self != first-node] - ask first-node [ create-link-with second-node [ set color white ] ] - - ;; randomly select unattached node and connect it to a partner already in the network - let new-node one-of nodes with [not any? link-neighbors] - while [new-node != nobody] [ - set partner find-partner - ask new-node [ create-link-with partner [ set color white ] ] - layout - set new-node one-of nodes with [not any? link-neighbors] - ] -end - -;; nodes with more connections (link-neighbors) are more likely to be chosen -to-report find-partner - let pick random-float sum [count link-neighbors] of (nodes with [any? link-neighbors]) - let partner nobody - ask nodes [ - if partner = nobody - [ ifelse count link-neighbors > pick - [ set partner self] - [ set pick pick - (count link-neighbors)] - ] - ] - report partner -end - -to layout - layout-spring (turtles with [any? link-neighbors]) links 0.4 6 1 -end From 6f9fd4bde55bb67e7f060e8e2baeaacb68014b59 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Thu, 17 Oct 2024 14:24:42 +0200 Subject: [PATCH 27/69] Update references.bib --- 2024-Jarigsma-001/references.bib | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/2024-Jarigsma-001/references.bib b/2024-Jarigsma-001/references.bib index a25100d..30f7c61 100644 --- a/2024-Jarigsma-001/references.bib +++ b/2024-Jarigsma-001/references.bib @@ -5,3 +5,11 @@ @misc{Troutman-Wilensky-2007 note = {Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL} howpublished = {\url{http://ccl.northwestern.edu/netlogo/models/LanguageChange}} } + +@misc{Wilensky-1999, +title = {NetLogo}, +author = {Wilensky, U.} +year = {1999}, +note = {Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL}, +url = {http://ccl.northwestern.edu/netlogo/} +} From c95069a8e87ab9cadeb40fc078928857db795777 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Thu, 17 Oct 2024 14:27:33 +0200 Subject: [PATCH 28/69] Update LICENSE --- 2024-Jarigsma-001/LICENSE | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/2024-Jarigsma-001/LICENSE b/2024-Jarigsma-001/LICENSE index 8c82197..0e77b64 100644 --- a/2024-Jarigsma-001/LICENSE +++ b/2024-Jarigsma-001/LICENSE @@ -1,4 +1,5 @@ -Copyright 2007 Uri Wilensky +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. -Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. From 018995564302838973e1f2d5b26688e943d09e25 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Thu, 17 Oct 2024 14:44:43 +0200 Subject: [PATCH 29/69] Update NASSA.yml --- 2024-Jarigsma-001/NASSA.yml | 67 ++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/2024-Jarigsma-001/NASSA.yml b/2024-Jarigsma-001/NASSA.yml index 8b13789..3b0f88b 100644 --- a/2024-Jarigsma-001/NASSA.yml +++ b/2024-Jarigsma-001/NASSA.yml @@ -1 +1,66 @@ - +id: 2024-Jarigsma-001 +nassaVersion: 0.5.0 +moduleType: Submodel +title: Preferential Attachment Network +moduleVersion: 1.0.0 +contributors: + - name: Jarigsma, Amber Esha + roles: [ "Compiler" ] + email: a.e.jarigsma@student.vu.nl + orcid: 0000-0002-1825-0097 +lastUpdateDate: 2024-10-17 +description: > + This submodel implements a preferential attachment algorithm to generate networks where nodes (agents) are connected based on their existing number of links, simulating the "rich-get-richer" effect. It uses a lottery-style partner selection method to form links between nodes, favoring those with more existing connections. This structure can model social networks, citation graphs, or other real-world systems where growth follows a preferential attachment pattern. +relatedModules: +references: + moduleReferences: [ homer_iliad_1865 ] + useExampleReferences: [ nassa_guide_submissions ] +domainKeywords: + regions: + - Global + - Eastern Mediterranean + periods: + - Bronze Age + - Mycenaean + subjects: + - war +modellingKeywords: + - agent + - calculation +programmingKeywords: + - Functional + - Object-oriented +implementations: + - language: NetLogo + softwareDependencies: + - NetLogo >= v6.1.1 + - gis (NetLogo extension) + - language: Python + softwareDependencies: + - Python >= v.3.9 + - math (Python module) + - random (Python module) +docsDir: documentation/ +inputs: + - name: greeks-strength, GREEKS_STRENGTH + type: integer + unit: army strength + description: The strength of the Greek army (attackers), measured in number of soldiers, units, etc. + - name: trojans-strength, TROJANS_STRENGTH + type: integer + unit: army strength + description: The strength of the Trojan army (defenders), measured in number of soldiers, units, etc. + - name: destruction-rate, DESTRUCTION_RATE + type: float + unit: city health / army strength + description: The rate of destruction per unit of attacker strength + - name: init-troy-health, TROY_HEALTH + type: float + unit: city health + description: The general state of the defenders city, measured in population, structures, etc. +outputs: + - name: troy-health, health, City.health + type: float + unit: city health + description: The general state of the defenders city, measured in population, structures, etc. +license: MIT From c263d05f6716bf7abe31da4b60d4981975da1682 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Sat, 19 Oct 2024 11:13:14 +0200 Subject: [PATCH 30/69] Update NASSA.yml From 762d5f142313ff93b6fb202123d2a9a332712080 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Mon, 21 Oct 2024 10:33:28 +0200 Subject: [PATCH 31/69] Update NASSA.yml --- 2024-Jarigsma-001/NASSA.yml | 55 ++++++++++--------------------------- 1 file changed, 15 insertions(+), 40 deletions(-) diff --git a/2024-Jarigsma-001/NASSA.yml b/2024-Jarigsma-001/NASSA.yml index 3b0f88b..90a4ed0 100644 --- a/2024-Jarigsma-001/NASSA.yml +++ b/2024-Jarigsma-001/NASSA.yml @@ -5,62 +5,37 @@ title: Preferential Attachment Network moduleVersion: 1.0.0 contributors: - name: Jarigsma, Amber Esha - roles: [ "Compiler" ] + roles: [ "Author", "Creator", "Compiler" ] email: a.e.jarigsma@student.vu.nl - orcid: 0000-0002-1825-0097 + orcid: 0009-0008-9842-7913 + - name: Wilensky, Uri + roles: [ "Author", "Copyright Holder" ] + email: uri@northwestern.edu + orcid: 0000-0001-9591-3109 + - name: Troutman, Celina + roles: [ "Author" ] lastUpdateDate: 2024-10-17 description: > This submodel implements a preferential attachment algorithm to generate networks where nodes (agents) are connected based on their existing number of links, simulating the "rich-get-richer" effect. It uses a lottery-style partner selection method to form links between nodes, favoring those with more existing connections. This structure can model social networks, citation graphs, or other real-world systems where growth follows a preferential attachment pattern. relatedModules: references: - moduleReferences: [ homer_iliad_1865 ] - useExampleReferences: [ nassa_guide_submissions ] + moduleReferences: [ Troutman-Wilensky-2007, Wilensky-1999 ] domainKeywords: regions: - - Global - - Eastern Mediterranean + - global periods: - - Bronze Age - - Mycenaean + - contemporary subjects: - - war + - social networks modellingKeywords: - - agent - - calculation + - network creation + - preferential attachment programmingKeywords: - Functional - Object-oriented implementations: - language: NetLogo softwareDependencies: - - NetLogo >= v6.1.1 - - gis (NetLogo extension) - - language: Python - softwareDependencies: - - Python >= v.3.9 - - math (Python module) - - random (Python module) + - NetLogo >= v6.4.0 docsDir: documentation/ -inputs: - - name: greeks-strength, GREEKS_STRENGTH - type: integer - unit: army strength - description: The strength of the Greek army (attackers), measured in number of soldiers, units, etc. - - name: trojans-strength, TROJANS_STRENGTH - type: integer - unit: army strength - description: The strength of the Trojan army (defenders), measured in number of soldiers, units, etc. - - name: destruction-rate, DESTRUCTION_RATE - type: float - unit: city health / army strength - description: The rate of destruction per unit of attacker strength - - name: init-troy-health, TROY_HEALTH - type: float - unit: city health - description: The general state of the defenders city, measured in population, structures, etc. -outputs: - - name: troy-health, health, City.health - type: float - unit: city health - description: The general state of the defenders city, measured in population, structures, etc. license: MIT From fb7393ea74fa7123cd32b7a3797679f004db9287 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Mon, 21 Oct 2024 10:50:11 +0200 Subject: [PATCH 32/69] Update README.md --- 2024-Jarigsma-001/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/2024-Jarigsma-001/README.md b/2024-Jarigsma-001/README.md index 8b13789..62a80ae 100644 --- a/2024-Jarigsma-001/README.md +++ b/2024-Jarigsma-001/README.md @@ -1 +1,16 @@ +# Preferential Attachment Network +*by Amber Esha Jarigsma* +This submodel implements a preferential attachment algorithm to generate networks where nodes (agents) are connected based on their existing number of links, simulating the "rich-get-richer" effect. It uses a lottery-style partner selection method to form links between nodes, favoring those with more existing connections. This structure can model social networks, citation graphs, or other real-world systems where growth follows a preferential attachment pattern. + +## License +**MIT** + +## References +Troutman, C. and Wilensky, U. (2007). NetLogo Language Change model. http://ccl.northwestern.edu/netlogo/models/LanguageChange. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. +Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. + +## Further information +Consult Troutman and Wilensky (2007) for an example of how this submodel can be implemented in a model for Language Change. + +Screenshot 2024-10-21 at 10 49 53 From efc40176c5a59fe4492191d86d08b131377385d3 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Mon, 21 Oct 2024 10:50:57 +0200 Subject: [PATCH 33/69] Update README.md --- 2024-Jarigsma-001/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/2024-Jarigsma-001/README.md b/2024-Jarigsma-001/README.md index 62a80ae..cd7c46f 100644 --- a/2024-Jarigsma-001/README.md +++ b/2024-Jarigsma-001/README.md @@ -8,6 +8,7 @@ This submodel implements a preferential attachment algorithm to generate network ## References Troutman, C. and Wilensky, U. (2007). NetLogo Language Change model. http://ccl.northwestern.edu/netlogo/models/LanguageChange. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. + Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. ## Further information From 8a7acfc45cb634c3caca6f5aacfaf09da548ab87 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Mon, 4 Nov 2024 16:11:47 +0100 Subject: [PATCH 34/69] Delete 2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo --- .../framework_preferential_attachment.nlogo | 43 ------------------- 1 file changed, 43 deletions(-) delete mode 100644 2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo diff --git a/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo b/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo deleted file mode 100644 index b309257..0000000 --- a/2024-Jarigsma-001/netlogo_implementation/framework_preferential_attachment.nlogo +++ /dev/null @@ -1,43 +0,0 @@ -breed [nodes node] ;; Define a new breed of agents called 'nodes' - - -;; CREATE NETWORK IN SETUP PROCEDURE - -to create-network - ;; make the initial network of two nodes and an edge - let partner nobody - let first-node one-of nodes - let second-node one-of nodes with [self != first-node] - ask first-node [ create-link-with second-node [ set color white ] ] - - ;; randomly select unattached node and connect it to a partner already in the network - let new-node one-of nodes with [not any? link-neighbors] - while [new-node != nobody] [ - set partner find-partner - ask new-node [ create-link-with partner [ set color white ] ] - ;layout - set new-node one-of nodes with [not any? link-neighbors] - ] -end - -;; nodes with more connections (link-neighbors) are more likely to be chosen -to-report find-partner - let pick random-float sum [count link-neighbors] of (nodes with [any? link-neighbors]) - let partner nobody - ask nodes - [ ;; if there's no winner yet - if partner = nobody - [ ifelse count link-neighbors > pick - [ set partner self] - [ set pick pick - (count link-neighbors)] - ] - ] - report partner -end - -;; THE FOLLOWING PROCEDURE IS NOT NECESSARY BUT VERY HELPFUL FOR VISUALISATION -;; If used, make sure to remove the semi-colon before 'layout' in the 'to create-network' procedure - -;to layout -; layout-spring (turtles with [any? link-neighbors]) links 0.4 6 1 -;end From f8d4956b752fd0e86bd150f8003de55d61ca5ff7 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Mon, 4 Nov 2024 16:11:57 +0100 Subject: [PATCH 35/69] Delete 2024-Jarigsma-001/netlogo_implementation/Network Creation (Preferential Attachment).nlogo --- ...k Creation (Preferential Attachment).nlogo | 522 ------------------ 1 file changed, 522 deletions(-) delete mode 100644 2024-Jarigsma-001/netlogo_implementation/Network Creation (Preferential Attachment).nlogo diff --git a/2024-Jarigsma-001/netlogo_implementation/Network Creation (Preferential Attachment).nlogo b/2024-Jarigsma-001/netlogo_implementation/Network Creation (Preferential Attachment).nlogo deleted file mode 100644 index 500438c..0000000 --- a/2024-Jarigsma-001/netlogo_implementation/Network Creation (Preferential Attachment).nlogo +++ /dev/null @@ -1,522 +0,0 @@ -breed [nodes node] ;; Define a breed of agents called 'nodes' - -nodes-own [ - state ;; current state (ranges from 0 to 1) - orig-state ;; each person's initially assigned state (either 0 or 1) - output-state ;; output of person's preference (0 or 1) -] - -;;; -;;; SETUP PROCEDURES -;;; For this section of code to work: -;;; (1) create a slider with variable 'num-nodes' to represent the number of nodes in your network, -;;; or replace 'num-nodes' in the code with the number of nodes in your network -;;; (2) create a slider with variable 'percent-state-1' to represent the percentage of nodes that are initialised with state 1 - -to setup - clear-all - set-default-shape nodes "circle" - repeat num-nodes [ make-node ] - create-network - distribute-states - ask patches [ set pcolor gray ] - repeat num-nodes [ layout ] - reset-ticks -end - -to make-node - create-nodes 1 [ - rt random-float 360 - fd max-pxcor - set size 2 - set state 0.0 - ] -end - -to distribute-states - ask nodes [ set state 0 ] - - ;; Randomly select a proportion of nodes to initialize with state 1 - ask n-of ((percent-state-1 / 100) * num-nodes) nodes - [ set state 1.0 ] - ask nodes [ - set orig-state state ;; Store the original state for resetting - set output-state state - update-color ;; Update node color based on state - ] -end - -to update-color - set color scale-color red state 0 1 -end - -to create-network - ;; make the initial network of two nodes and an edge - let partner nobody - let first-node one-of nodes - let second-node one-of nodes with [self != first-node] - ask first-node [ create-link-with second-node [ set color white ] ] - - ;; randomly select unattached node and connect it to a partner already in the network - let new-node one-of nodes with [not any? link-neighbors] - while [new-node != nobody] [ - set partner find-partner - ask new-node [ create-link-with partner [ set color white ] ] - layout - set new-node one-of nodes with [not any? link-neighbors] - ] -end - -;; nodes with more connections (link-neighbors) are more likely to be chosen -to-report find-partner - let pick random-float sum [count link-neighbors] of (nodes with [any? link-neighbors]) - let partner nobody - ask nodes [ - if partner = nobody - [ ifelse count link-neighbors > pick - [ set partner self] - [ set pick pick - (count link-neighbors)] - ] - ] - report partner -end - -to layout - layout-spring (turtles with [any? link-neighbors]) links 0.4 6 1 -end -@#$#@#$#@ -GRAPHICS-WINDOW -210 -10 -647 -448 --1 --1 -13.0 -1 -10 -1 -1 -1 -0 -1 -1 -1 --16 -16 --16 -16 -0 -0 -1 -ticks -30.0 - -BUTTON -14 -25 -80 -58 -NIL -setup -NIL -1 -T -OBSERVER -NIL -NIL -NIL -NIL -1 - -SLIDER -22 -99 -194 -132 -num-nodes -num-nodes -0 -100 -50.0 -1 -1 -NIL -HORIZONTAL - -SLIDER -22 -145 -201 -178 -percent-state-1 -percent-state-1 -0 -100 -50.0 -1 -1 -NIL -HORIZONTAL - -@#$#@#$#@ -## WHAT IS IT? - -(a general understanding of what the model is trying to show or explain) - -## HOW IT WORKS - -(what rules the agents use to create the overall behavior of the model) - -## HOW TO USE IT - -(how to use the model, including a description of each of the items in the Interface tab) - -## THINGS TO NOTICE - -(suggested things for the user to notice while running the model) - -## THINGS TO TRY - -(suggested things for the user to try to do (move sliders, switches, etc.) with the model) - -## EXTENDING THE MODEL - -(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.) - -## NETLOGO FEATURES - -(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features) - -## RELATED MODELS - -(models in the NetLogo Models Library and elsewhere which are of related interest) - -## CREDITS AND REFERENCES - -(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links) -@#$#@#$#@ -default -true -0 -Polygon -7500403 true true 150 5 40 250 150 205 260 250 - -airplane -true -0 -Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15 - -arrow -true -0 -Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 - -box -false -0 -Polygon -7500403 true true 150 285 285 225 285 75 150 135 -Polygon -7500403 true true 150 135 15 75 150 15 285 75 -Polygon -7500403 true true 15 75 15 225 150 285 150 135 -Line -16777216 false 150 285 150 135 -Line -16777216 false 150 135 15 75 -Line -16777216 false 150 135 285 75 - -bug -true -0 -Circle -7500403 true true 96 182 108 -Circle -7500403 true true 110 127 80 -Circle -7500403 true true 110 75 80 -Line -7500403 true 150 100 80 30 -Line -7500403 true 150 100 220 30 - -butterfly -true -0 -Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240 -Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240 -Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163 -Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165 -Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225 -Circle -16777216 true false 135 90 30 -Line -16777216 false 150 105 195 60 -Line -16777216 false 150 105 105 60 - -car -false -0 -Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180 -Circle -16777216 true false 180 180 90 -Circle -16777216 true false 30 180 90 -Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89 -Circle -7500403 true true 47 195 58 -Circle -7500403 true true 195 195 58 - -circle -false -0 -Circle -7500403 true true 0 0 300 - -circle 2 -false -0 -Circle -7500403 true true 0 0 300 -Circle -16777216 true false 30 30 240 - -cow -false -0 -Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167 -Polygon -7500403 true true 73 210 86 251 62 249 48 208 -Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123 - -cylinder -false -0 -Circle -7500403 true true 0 0 300 - -dot -false -0 -Circle -7500403 true true 90 90 120 - -face happy -false -0 -Circle -7500403 true true 8 8 285 -Circle -16777216 true false 60 75 60 -Circle -16777216 true false 180 75 60 -Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240 - -face neutral -false -0 -Circle -7500403 true true 8 7 285 -Circle -16777216 true false 60 75 60 -Circle -16777216 true false 180 75 60 -Rectangle -16777216 true false 60 195 240 225 - -face sad -false -0 -Circle -7500403 true true 8 8 285 -Circle -16777216 true false 60 75 60 -Circle -16777216 true false 180 75 60 -Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183 - -fish -false -0 -Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166 -Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165 -Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60 -Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166 -Circle -16777216 true false 215 106 30 - -flag -false -0 -Rectangle -7500403 true true 60 15 75 300 -Polygon -7500403 true true 90 150 270 90 90 30 -Line -7500403 true 75 135 90 135 -Line -7500403 true 75 45 90 45 - -flower -false -0 -Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135 -Circle -7500403 true true 85 132 38 -Circle -7500403 true true 130 147 38 -Circle -7500403 true true 192 85 38 -Circle -7500403 true true 85 40 38 -Circle -7500403 true true 177 40 38 -Circle -7500403 true true 177 132 38 -Circle -7500403 true true 70 85 38 -Circle -7500403 true true 130 25 38 -Circle -7500403 true true 96 51 108 -Circle -16777216 true false 113 68 74 -Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218 -Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240 - -house -false -0 -Rectangle -7500403 true true 45 120 255 285 -Rectangle -16777216 true false 120 210 180 285 -Polygon -7500403 true true 15 120 150 15 285 120 -Line -16777216 false 30 120 270 120 - -leaf -false -0 -Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195 -Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195 - -line -true -0 -Line -7500403 true 150 0 150 300 - -line half -true -0 -Line -7500403 true 150 0 150 150 - -pentagon -false -0 -Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120 - -person -false -0 -Circle -7500403 true true 110 5 80 -Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90 -Rectangle -7500403 true true 127 79 172 94 -Polygon -7500403 true true 195 90 240 150 225 180 165 105 -Polygon -7500403 true true 105 90 60 150 75 180 135 105 - -plant -false -0 -Rectangle -7500403 true true 135 90 165 300 -Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285 -Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285 -Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210 -Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135 -Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135 -Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60 -Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90 - -sheep -false -15 -Circle -1 true true 203 65 88 -Circle -1 true true 70 65 162 -Circle -1 true true 150 105 120 -Polygon -7500403 true false 218 120 240 165 255 165 278 120 -Circle -7500403 true false 214 72 67 -Rectangle -1 true true 164 223 179 298 -Polygon -1 true true 45 285 30 285 30 240 15 195 45 210 -Circle -1 true true 3 83 150 -Rectangle -1 true true 65 221 80 296 -Polygon -1 true true 195 285 210 285 210 240 240 210 195 210 -Polygon -7500403 true false 276 85 285 105 302 99 294 83 -Polygon -7500403 true false 219 85 210 105 193 99 201 83 - -square -false -0 -Rectangle -7500403 true true 30 30 270 270 - -square 2 -false -0 -Rectangle -7500403 true true 30 30 270 270 -Rectangle -16777216 true false 60 60 240 240 - -star -false -0 -Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108 - -target -false -0 -Circle -7500403 true true 0 0 300 -Circle -16777216 true false 30 30 240 -Circle -7500403 true true 60 60 180 -Circle -16777216 true false 90 90 120 -Circle -7500403 true true 120 120 60 - -tree -false -0 -Circle -7500403 true true 118 3 94 -Rectangle -6459832 true false 120 195 180 300 -Circle -7500403 true true 65 21 108 -Circle -7500403 true true 116 41 127 -Circle -7500403 true true 45 90 120 -Circle -7500403 true true 104 74 152 - -triangle -false -0 -Polygon -7500403 true true 150 30 15 255 285 255 - -triangle 2 -false -0 -Polygon -7500403 true true 150 30 15 255 285 255 -Polygon -16777216 true false 151 99 225 223 75 224 - -truck -false -0 -Rectangle -7500403 true true 4 45 195 187 -Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194 -Rectangle -1 true false 195 60 195 105 -Polygon -16777216 true false 238 112 252 141 219 141 218 112 -Circle -16777216 true false 234 174 42 -Rectangle -7500403 true true 181 185 214 194 -Circle -16777216 true false 144 174 42 -Circle -16777216 true false 24 174 42 -Circle -7500403 false true 24 174 42 -Circle -7500403 false true 144 174 42 -Circle -7500403 false true 234 174 42 - -turtle -true -0 -Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210 -Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105 -Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105 -Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87 -Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210 -Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99 - -wheel -false -0 -Circle -7500403 true true 3 3 294 -Circle -16777216 true false 30 30 240 -Line -7500403 true 150 285 150 15 -Line -7500403 true 15 150 285 150 -Circle -7500403 true true 120 120 60 -Line -7500403 true 216 40 79 269 -Line -7500403 true 40 84 269 221 -Line -7500403 true 40 216 269 79 -Line -7500403 true 84 40 221 269 - -wolf -false -0 -Polygon -16777216 true false 253 133 245 131 245 133 -Polygon -7500403 true true 2 194 13 197 30 191 38 193 38 205 20 226 20 257 27 265 38 266 40 260 31 253 31 230 60 206 68 198 75 209 66 228 65 243 82 261 84 268 100 267 103 261 77 239 79 231 100 207 98 196 119 201 143 202 160 195 166 210 172 213 173 238 167 251 160 248 154 265 169 264 178 247 186 240 198 260 200 271 217 271 219 262 207 258 195 230 192 198 210 184 227 164 242 144 259 145 284 151 277 141 293 140 299 134 297 127 273 119 270 105 -Polygon -7500403 true true -1 195 14 180 36 166 40 153 53 140 82 131 134 133 159 126 188 115 227 108 236 102 238 98 268 86 269 92 281 87 269 103 269 113 - -x -false -0 -Polygon -7500403 true true 270 75 225 30 30 225 75 270 -Polygon -7500403 true true 30 75 75 30 270 225 225 270 -@#$#@#$#@ -NetLogo 6.4.0 -@#$#@#$#@ -@#$#@#$#@ -@#$#@#$#@ -@#$#@#$#@ -@#$#@#$#@ -default -0.0 --0.2 0 0.0 1.0 -0.0 1 1.0 0.0 -0.2 0 0.0 1.0 -link direction -true -0 -Line -7500403 true 150 150 90 180 -Line -7500403 true 150 150 210 180 -@#$#@#$#@ -0 -@#$#@#$#@ From 8e31c77a5fbfba6484742e058cd5e80f6b02a792 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Mon, 4 Nov 2024 16:12:53 +0100 Subject: [PATCH 36/69] Create delete --- 2024-Jarigsma-001/netlogo_implementation/delete | 1 + 1 file changed, 1 insertion(+) create mode 100644 2024-Jarigsma-001/netlogo_implementation/delete diff --git a/2024-Jarigsma-001/netlogo_implementation/delete b/2024-Jarigsma-001/netlogo_implementation/delete new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/2024-Jarigsma-001/netlogo_implementation/delete @@ -0,0 +1 @@ + From e71ab0c4d1e2b1302e12d6437fbb2bae7764b6dc Mon Sep 17 00:00:00 2001 From: AmberHam Date: Mon, 4 Nov 2024 16:13:24 +0100 Subject: [PATCH 37/69] Add files via upload --- .../Preferential Attachment Network.nlogo | 539 ++++++++++++++++++ 1 file changed, 539 insertions(+) create mode 100644 2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo diff --git a/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo b/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo new file mode 100644 index 0000000..aeb632e --- /dev/null +++ b/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo @@ -0,0 +1,539 @@ +breed [nodes node] +globals [old-nodes] +nodes-own [degree] ; the degree attribute will store the number of links each node has + +;; +;; SETUP PROCEDURE +;; +to setup + clear-all + set-default-shape nodes "circle" + set old-nodes [] + + create-nodes number-of-nodes [ + setxy random-xcor random-ycor + set color red + set degree 0 + set old-nodes lput self old-nodes + ] + + reset-ticks +end + +;; +;; MAIN PROCEDURES +;; +to go + make-node + layout + tick +end + +to make-node + create-nodes 1 [ + set color green + set degree 0 + ] + + let new-node nodes with [color = green and degree = 0] + + let partner find-preferential-partner + ask new-node [ + create-link-with partner + set degree degree + 1 + ] + ask partner [ + set degree degree + 1 + ] + + ask nodes [ + if degree > 0 [ + set color red + ] + ] +end + +;; This is the main component of the "preferential attachment" mechanism. +;; Nodes are entered into a 'lottery' where the number of 'tickets' each node has +;; is proportional to its number of links. This creates a mechanism where nodes +;; with more links have a higher probability of being randomly selected. +to-report find-preferential-partner + let tickets [] + + ask nodes [ + if color != green [ + let ticket-count degree + 1 + repeat ticket-count [ + set tickets lput self tickets + ] + ] + ] + + report one-of tickets +end + +;; +;; LAYOUT PROCEDURE +;; +to layout + ask nodes [ + set size (degree + 1) * 0.5 ;node size is proportional to the number of links the node has + ] + + layout-spring (nodes with [any? link-neighbors]) links 0.4 6 1 +end +@#$#@#$#@ +GRAPHICS-WINDOW +210 +10 +828 +629 +-1 +-1 +10.0 +1 +10 +1 +1 +1 +0 +1 +1 +1 +-30 +30 +-30 +30 +0 +0 +1 +ticks +30.0 + +BUTTON +28 +28 +94 +61 +NIL +setup\n +NIL +1 +T +OBSERVER +NIL +NIL +NIL +NIL +1 + +BUTTON +108 +29 +171 +62 +NIL +go +T +1 +T +OBSERVER +NIL +NIL +NIL +NIL +1 + +BUTTON +107 +71 +188 +104 +go once +go +NIL +1 +T +OBSERVER +NIL +NIL +NIL +NIL +1 + +SLIDER +20 +119 +192 +152 +number-of-nodes +number-of-nodes +1 +100 +4.0 +1 +1 +NIL +HORIZONTAL + +@#$#@#$#@ +## WHAT IS IT? + +(a general understanding of what the model is trying to show or explain) + +## HOW IT WORKS + +(what rules the agents use to create the overall behavior of the model) + +## HOW TO USE IT + +(how to use the model, including a description of each of the items in the Interface tab) + +## THINGS TO NOTICE + +(suggested things for the user to notice while running the model) + +## THINGS TO TRY + +(suggested things for the user to try to do (move sliders, switches, etc.) with the model) + +## EXTENDING THE MODEL + +(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.) + +## NETLOGO FEATURES + +(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features) + +## RELATED MODELS + +(models in the NetLogo Models Library and elsewhere which are of related interest) + +## CREDITS AND REFERENCES + +(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links) +@#$#@#$#@ +default +true +0 +Polygon -7500403 true true 150 5 40 250 150 205 260 250 + +airplane +true +0 +Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15 + +arrow +true +0 +Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 + +box +false +0 +Polygon -7500403 true true 150 285 285 225 285 75 150 135 +Polygon -7500403 true true 150 135 15 75 150 15 285 75 +Polygon -7500403 true true 15 75 15 225 150 285 150 135 +Line -16777216 false 150 285 150 135 +Line -16777216 false 150 135 15 75 +Line -16777216 false 150 135 285 75 + +bug +true +0 +Circle -7500403 true true 96 182 108 +Circle -7500403 true true 110 127 80 +Circle -7500403 true true 110 75 80 +Line -7500403 true 150 100 80 30 +Line -7500403 true 150 100 220 30 + +butterfly +true +0 +Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240 +Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240 +Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163 +Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165 +Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225 +Circle -16777216 true false 135 90 30 +Line -16777216 false 150 105 195 60 +Line -16777216 false 150 105 105 60 + +car +false +0 +Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180 +Circle -16777216 true false 180 180 90 +Circle -16777216 true false 30 180 90 +Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89 +Circle -7500403 true true 47 195 58 +Circle -7500403 true true 195 195 58 + +circle +false +0 +Circle -7500403 true true 0 0 300 + +circle 2 +false +0 +Circle -7500403 true true 0 0 300 +Circle -16777216 true false 30 30 240 + +cow +false +0 +Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167 +Polygon -7500403 true true 73 210 86 251 62 249 48 208 +Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123 + +cylinder +false +0 +Circle -7500403 true true 0 0 300 + +dot +false +0 +Circle -7500403 true true 90 90 120 + +face happy +false +0 +Circle -7500403 true true 8 8 285 +Circle -16777216 true false 60 75 60 +Circle -16777216 true false 180 75 60 +Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240 + +face neutral +false +0 +Circle -7500403 true true 8 7 285 +Circle -16777216 true false 60 75 60 +Circle -16777216 true false 180 75 60 +Rectangle -16777216 true false 60 195 240 225 + +face sad +false +0 +Circle -7500403 true true 8 8 285 +Circle -16777216 true false 60 75 60 +Circle -16777216 true false 180 75 60 +Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183 + +fish +false +0 +Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166 +Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165 +Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60 +Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166 +Circle -16777216 true false 215 106 30 + +flag +false +0 +Rectangle -7500403 true true 60 15 75 300 +Polygon -7500403 true true 90 150 270 90 90 30 +Line -7500403 true 75 135 90 135 +Line -7500403 true 75 45 90 45 + +flower +false +0 +Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135 +Circle -7500403 true true 85 132 38 +Circle -7500403 true true 130 147 38 +Circle -7500403 true true 192 85 38 +Circle -7500403 true true 85 40 38 +Circle -7500403 true true 177 40 38 +Circle -7500403 true true 177 132 38 +Circle -7500403 true true 70 85 38 +Circle -7500403 true true 130 25 38 +Circle -7500403 true true 96 51 108 +Circle -16777216 true false 113 68 74 +Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218 +Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240 + +house +false +0 +Rectangle -7500403 true true 45 120 255 285 +Rectangle -16777216 true false 120 210 180 285 +Polygon -7500403 true true 15 120 150 15 285 120 +Line -16777216 false 30 120 270 120 + +leaf +false +0 +Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195 +Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195 + +line +true +0 +Line -7500403 true 150 0 150 300 + +line half +true +0 +Line -7500403 true 150 0 150 150 + +pentagon +false +0 +Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120 + +person +false +0 +Circle -7500403 true true 110 5 80 +Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90 +Rectangle -7500403 true true 127 79 172 94 +Polygon -7500403 true true 195 90 240 150 225 180 165 105 +Polygon -7500403 true true 105 90 60 150 75 180 135 105 + +plant +false +0 +Rectangle -7500403 true true 135 90 165 300 +Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285 +Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285 +Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210 +Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135 +Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135 +Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60 +Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90 + +sheep +false +15 +Circle -1 true true 203 65 88 +Circle -1 true true 70 65 162 +Circle -1 true true 150 105 120 +Polygon -7500403 true false 218 120 240 165 255 165 278 120 +Circle -7500403 true false 214 72 67 +Rectangle -1 true true 164 223 179 298 +Polygon -1 true true 45 285 30 285 30 240 15 195 45 210 +Circle -1 true true 3 83 150 +Rectangle -1 true true 65 221 80 296 +Polygon -1 true true 195 285 210 285 210 240 240 210 195 210 +Polygon -7500403 true false 276 85 285 105 302 99 294 83 +Polygon -7500403 true false 219 85 210 105 193 99 201 83 + +square +false +0 +Rectangle -7500403 true true 30 30 270 270 + +square 2 +false +0 +Rectangle -7500403 true true 30 30 270 270 +Rectangle -16777216 true false 60 60 240 240 + +star +false +0 +Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108 + +target +false +0 +Circle -7500403 true true 0 0 300 +Circle -16777216 true false 30 30 240 +Circle -7500403 true true 60 60 180 +Circle -16777216 true false 90 90 120 +Circle -7500403 true true 120 120 60 + +tree +false +0 +Circle -7500403 true true 118 3 94 +Rectangle -6459832 true false 120 195 180 300 +Circle -7500403 true true 65 21 108 +Circle -7500403 true true 116 41 127 +Circle -7500403 true true 45 90 120 +Circle -7500403 true true 104 74 152 + +triangle +false +0 +Polygon -7500403 true true 150 30 15 255 285 255 + +triangle 2 +false +0 +Polygon -7500403 true true 150 30 15 255 285 255 +Polygon -16777216 true false 151 99 225 223 75 224 + +truck +false +0 +Rectangle -7500403 true true 4 45 195 187 +Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194 +Rectangle -1 true false 195 60 195 105 +Polygon -16777216 true false 238 112 252 141 219 141 218 112 +Circle -16777216 true false 234 174 42 +Rectangle -7500403 true true 181 185 214 194 +Circle -16777216 true false 144 174 42 +Circle -16777216 true false 24 174 42 +Circle -7500403 false true 24 174 42 +Circle -7500403 false true 144 174 42 +Circle -7500403 false true 234 174 42 + +turtle +true +0 +Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210 +Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105 +Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105 +Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87 +Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210 +Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99 + +wheel +false +0 +Circle -7500403 true true 3 3 294 +Circle -16777216 true false 30 30 240 +Line -7500403 true 150 285 150 15 +Line -7500403 true 15 150 285 150 +Circle -7500403 true true 120 120 60 +Line -7500403 true 216 40 79 269 +Line -7500403 true 40 84 269 221 +Line -7500403 true 40 216 269 79 +Line -7500403 true 84 40 221 269 + +wolf +false +0 +Polygon -16777216 true false 253 133 245 131 245 133 +Polygon -7500403 true true 2 194 13 197 30 191 38 193 38 205 20 226 20 257 27 265 38 266 40 260 31 253 31 230 60 206 68 198 75 209 66 228 65 243 82 261 84 268 100 267 103 261 77 239 79 231 100 207 98 196 119 201 143 202 160 195 166 210 172 213 173 238 167 251 160 248 154 265 169 264 178 247 186 240 198 260 200 271 217 271 219 262 207 258 195 230 192 198 210 184 227 164 242 144 259 145 284 151 277 141 293 140 299 134 297 127 273 119 270 105 +Polygon -7500403 true true -1 195 14 180 36 166 40 153 53 140 82 131 134 133 159 126 188 115 227 108 236 102 238 98 268 86 269 92 281 87 269 103 269 113 + +x +false +0 +Polygon -7500403 true true 270 75 225 30 30 225 75 270 +Polygon -7500403 true true 30 75 75 30 270 225 225 270 +@#$#@#$#@ +NetLogo 6.4.0 +@#$#@#$#@ +@#$#@#$#@ +@#$#@#$#@ +@#$#@#$#@ +@#$#@#$#@ +default +0.0 +-0.2 0 0.0 1.0 +0.0 1 1.0 0.0 +0.2 0 0.0 1.0 +link direction +true +0 +Line -7500403 true 150 150 90 180 +Line -7500403 true 150 150 210 180 +@#$#@#$#@ +0 +@#$#@#$#@ From 1ad2752e5718e94022ad69c135b28c1be5bd7a86 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Mon, 4 Nov 2024 16:13:50 +0100 Subject: [PATCH 38/69] Delete 2024-Jarigsma-001/netlogo_implementation/delete --- 2024-Jarigsma-001/netlogo_implementation/delete | 1 - 1 file changed, 1 deletion(-) delete mode 100644 2024-Jarigsma-001/netlogo_implementation/delete diff --git a/2024-Jarigsma-001/netlogo_implementation/delete b/2024-Jarigsma-001/netlogo_implementation/delete deleted file mode 100644 index 8b13789..0000000 --- a/2024-Jarigsma-001/netlogo_implementation/delete +++ /dev/null @@ -1 +0,0 @@ - From e860235b71163ac4d049794debca8e11c65f629f Mon Sep 17 00:00:00 2001 From: AmberHam Date: Mon, 4 Nov 2024 16:37:20 +0100 Subject: [PATCH 39/69] Update NASSA.yml --- 2024-Jarigsma-001/NASSA.yml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/2024-Jarigsma-001/NASSA.yml b/2024-Jarigsma-001/NASSA.yml index 90a4ed0..05ae90c 100644 --- a/2024-Jarigsma-001/NASSA.yml +++ b/2024-Jarigsma-001/NASSA.yml @@ -1,22 +1,15 @@ id: 2024-Jarigsma-001 nassaVersion: 0.5.0 -moduleType: Submodel +moduleType: Algorithm title: Preferential Attachment Network moduleVersion: 1.0.0 contributors: - name: Jarigsma, Amber Esha - roles: [ "Author", "Creator", "Compiler" ] + roles: [ "Author", "Creator"] email: a.e.jarigsma@student.vu.nl orcid: 0009-0008-9842-7913 - - name: Wilensky, Uri - roles: [ "Author", "Copyright Holder" ] - email: uri@northwestern.edu - orcid: 0000-0001-9591-3109 - - name: Troutman, Celina - roles: [ "Author" ] -lastUpdateDate: 2024-10-17 description: > - This submodel implements a preferential attachment algorithm to generate networks where nodes (agents) are connected based on their existing number of links, simulating the "rich-get-richer" effect. It uses a lottery-style partner selection method to form links between nodes, favoring those with more existing connections. This structure can model social networks, citation graphs, or other real-world systems where growth follows a preferential attachment pattern. +This NetLogo algorithm simulates network formation using preferential attachment. New nodes are more likely to connect to existing nodes with higher degrees, reflecting a "lottery" system where popular nodes attract more links. relatedModules: references: moduleReferences: [ Troutman-Wilensky-2007, Wilensky-1999 ] @@ -28,11 +21,12 @@ domainKeywords: subjects: - social networks modellingKeywords: - - network creation + - agent interaction - preferential attachment + - network dynamics programmingKeywords: - - Functional - - Object-oriented + - network simulation + - stochastic implementations: - language: NetLogo softwareDependencies: From d70071eebb6fe6a079d5259d20b08fbc68fa81e1 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Mon, 4 Nov 2024 16:46:06 +0100 Subject: [PATCH 40/69] Update references.bib --- 2024-Jarigsma-001/references.bib | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/2024-Jarigsma-001/references.bib b/2024-Jarigsma-001/references.bib index 30f7c61..6415565 100644 --- a/2024-Jarigsma-001/references.bib +++ b/2024-Jarigsma-001/references.bib @@ -1,15 +1,7 @@ -@misc{Troutman-Wilensky-2007, -title = {NetLogo Language Change model}, -author = {Troutman, C. and Wilensky, U.}, -year = {2007}, +@misc{Wilensky-2005, +title = {NetLogo Preferential Attachment model}, +author = {Wilensky, U.}, +year = {2005} note = {Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL} -howpublished = {\url{http://ccl.northwestern.edu/netlogo/models/LanguageChange}} -} - -@misc{Wilensky-1999, -title = {NetLogo}, -author = {Wilensky, U.} -year = {1999}, -note = {Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL}, -url = {http://ccl.northwestern.edu/netlogo/} +url = {https://ccl.northwestern.edu/netlogo/models/PreferentialAttachment} } From b1f6d0b06475617c5748f61616b8ac6cdafdbbf4 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Mon, 4 Nov 2024 16:46:32 +0100 Subject: [PATCH 41/69] Update NASSA.yml --- 2024-Jarigsma-001/NASSA.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2024-Jarigsma-001/NASSA.yml b/2024-Jarigsma-001/NASSA.yml index 05ae90c..f5d0c87 100644 --- a/2024-Jarigsma-001/NASSA.yml +++ b/2024-Jarigsma-001/NASSA.yml @@ -12,7 +12,7 @@ description: > This NetLogo algorithm simulates network formation using preferential attachment. New nodes are more likely to connect to existing nodes with higher degrees, reflecting a "lottery" system where popular nodes attract more links. relatedModules: references: - moduleReferences: [ Troutman-Wilensky-2007, Wilensky-1999 ] + moduleReferences: [ Wilensky-2005 ] domainKeywords: regions: - global From d9354f47596f5ed71c2c3a313a93ecb118c46ad3 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Fri, 15 Nov 2024 22:19:10 +0100 Subject: [PATCH 42/69] Update LICENSE --- 2024-Jarigsma-001/LICENSE | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/2024-Jarigsma-001/LICENSE b/2024-Jarigsma-001/LICENSE index 0e77b64..b8070a1 100644 --- a/2024-Jarigsma-001/LICENSE +++ b/2024-Jarigsma-001/LICENSE @@ -1,3 +1,7 @@ +MIT License + +Copyright 2024 Amber Esha Jarigsma + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. From 6ce645214b952d4b6f8a49c4da47a593f8178432 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Fri, 15 Nov 2024 22:22:16 +0100 Subject: [PATCH 43/69] Update NASSA.yml --- 2024-Jarigsma-001/NASSA.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2024-Jarigsma-001/NASSA.yml b/2024-Jarigsma-001/NASSA.yml index f5d0c87..5ec55eb 100644 --- a/2024-Jarigsma-001/NASSA.yml +++ b/2024-Jarigsma-001/NASSA.yml @@ -5,7 +5,7 @@ title: Preferential Attachment Network moduleVersion: 1.0.0 contributors: - name: Jarigsma, Amber Esha - roles: [ "Author", "Creator"] + roles: [ "Copyright Holder", "Author", "Creator"] email: a.e.jarigsma@student.vu.nl orcid: 0009-0008-9842-7913 description: > From f7b62e241584019650bc3e1018a1a4b180809c46 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Fri, 15 Nov 2024 22:28:48 +0100 Subject: [PATCH 44/69] Update README.md --- 2024-Jarigsma-001/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/2024-Jarigsma-001/README.md b/2024-Jarigsma-001/README.md index cd7c46f..68659b2 100644 --- a/2024-Jarigsma-001/README.md +++ b/2024-Jarigsma-001/README.md @@ -7,11 +7,11 @@ This submodel implements a preferential attachment algorithm to generate network **MIT** ## References -Troutman, C. and Wilensky, U. (2007). NetLogo Language Change model. http://ccl.northwestern.edu/netlogo/models/LanguageChange. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. - -Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. +Wilensky, U. (2005). NetLogo Preferential Attachment model. http://ccl.northwestern.edu/netlogo/models/PreferentialAttachment. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. ## Further information -Consult Troutman and Wilensky (2007) for an example of how this submodel can be implemented in a model for Language Change. +This model is an algorithm implemented in NetLogo. +Users can choose how many (unattached) nodes to begin the algorithm with. +Node size is proportional to the number of links the node has. -Screenshot 2024-10-21 at 10 49 53 +Screenshot 2024-11-15 at 22 28 25 From a216bccffddf39407045dfd3b6dda50a58ab090d Mon Sep 17 00:00:00 2001 From: AmberHam Date: Fri, 15 Nov 2024 22:29:11 +0100 Subject: [PATCH 45/69] Update README.md --- 2024-Jarigsma-001/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2024-Jarigsma-001/README.md b/2024-Jarigsma-001/README.md index 68659b2..67b2ef0 100644 --- a/2024-Jarigsma-001/README.md +++ b/2024-Jarigsma-001/README.md @@ -1,7 +1,7 @@ # Preferential Attachment Network *by Amber Esha Jarigsma* -This submodel implements a preferential attachment algorithm to generate networks where nodes (agents) are connected based on their existing number of links, simulating the "rich-get-richer" effect. It uses a lottery-style partner selection method to form links between nodes, favoring those with more existing connections. This structure can model social networks, citation graphs, or other real-world systems where growth follows a preferential attachment pattern. +This (sub)model implements a preferential attachment algorithm to generate networks where nodes (agents) are connected based on their existing number of links, simulating the "rich-get-richer" effect. It uses a lottery-style partner selection method to form links between nodes, favoring those with more existing connections. This structure can model social networks, citation graphs, or other real-world systems where growth follows a preferential attachment pattern. ## License **MIT** From dfb7d78965ca13f39f5f741dddef26c5fbe23179 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Fri, 15 Nov 2024 22:30:35 +0100 Subject: [PATCH 46/69] Delete 2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo --- .../Preferential Attachment Network.nlogo | 539 ------------------ 1 file changed, 539 deletions(-) delete mode 100644 2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo diff --git a/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo b/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo deleted file mode 100644 index aeb632e..0000000 --- a/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo +++ /dev/null @@ -1,539 +0,0 @@ -breed [nodes node] -globals [old-nodes] -nodes-own [degree] ; the degree attribute will store the number of links each node has - -;; -;; SETUP PROCEDURE -;; -to setup - clear-all - set-default-shape nodes "circle" - set old-nodes [] - - create-nodes number-of-nodes [ - setxy random-xcor random-ycor - set color red - set degree 0 - set old-nodes lput self old-nodes - ] - - reset-ticks -end - -;; -;; MAIN PROCEDURES -;; -to go - make-node - layout - tick -end - -to make-node - create-nodes 1 [ - set color green - set degree 0 - ] - - let new-node nodes with [color = green and degree = 0] - - let partner find-preferential-partner - ask new-node [ - create-link-with partner - set degree degree + 1 - ] - ask partner [ - set degree degree + 1 - ] - - ask nodes [ - if degree > 0 [ - set color red - ] - ] -end - -;; This is the main component of the "preferential attachment" mechanism. -;; Nodes are entered into a 'lottery' where the number of 'tickets' each node has -;; is proportional to its number of links. This creates a mechanism where nodes -;; with more links have a higher probability of being randomly selected. -to-report find-preferential-partner - let tickets [] - - ask nodes [ - if color != green [ - let ticket-count degree + 1 - repeat ticket-count [ - set tickets lput self tickets - ] - ] - ] - - report one-of tickets -end - -;; -;; LAYOUT PROCEDURE -;; -to layout - ask nodes [ - set size (degree + 1) * 0.5 ;node size is proportional to the number of links the node has - ] - - layout-spring (nodes with [any? link-neighbors]) links 0.4 6 1 -end -@#$#@#$#@ -GRAPHICS-WINDOW -210 -10 -828 -629 --1 --1 -10.0 -1 -10 -1 -1 -1 -0 -1 -1 -1 --30 -30 --30 -30 -0 -0 -1 -ticks -30.0 - -BUTTON -28 -28 -94 -61 -NIL -setup\n -NIL -1 -T -OBSERVER -NIL -NIL -NIL -NIL -1 - -BUTTON -108 -29 -171 -62 -NIL -go -T -1 -T -OBSERVER -NIL -NIL -NIL -NIL -1 - -BUTTON -107 -71 -188 -104 -go once -go -NIL -1 -T -OBSERVER -NIL -NIL -NIL -NIL -1 - -SLIDER -20 -119 -192 -152 -number-of-nodes -number-of-nodes -1 -100 -4.0 -1 -1 -NIL -HORIZONTAL - -@#$#@#$#@ -## WHAT IS IT? - -(a general understanding of what the model is trying to show or explain) - -## HOW IT WORKS - -(what rules the agents use to create the overall behavior of the model) - -## HOW TO USE IT - -(how to use the model, including a description of each of the items in the Interface tab) - -## THINGS TO NOTICE - -(suggested things for the user to notice while running the model) - -## THINGS TO TRY - -(suggested things for the user to try to do (move sliders, switches, etc.) with the model) - -## EXTENDING THE MODEL - -(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.) - -## NETLOGO FEATURES - -(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features) - -## RELATED MODELS - -(models in the NetLogo Models Library and elsewhere which are of related interest) - -## CREDITS AND REFERENCES - -(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links) -@#$#@#$#@ -default -true -0 -Polygon -7500403 true true 150 5 40 250 150 205 260 250 - -airplane -true -0 -Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15 - -arrow -true -0 -Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 - -box -false -0 -Polygon -7500403 true true 150 285 285 225 285 75 150 135 -Polygon -7500403 true true 150 135 15 75 150 15 285 75 -Polygon -7500403 true true 15 75 15 225 150 285 150 135 -Line -16777216 false 150 285 150 135 -Line -16777216 false 150 135 15 75 -Line -16777216 false 150 135 285 75 - -bug -true -0 -Circle -7500403 true true 96 182 108 -Circle -7500403 true true 110 127 80 -Circle -7500403 true true 110 75 80 -Line -7500403 true 150 100 80 30 -Line -7500403 true 150 100 220 30 - -butterfly -true -0 -Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240 -Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240 -Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163 -Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165 -Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225 -Circle -16777216 true false 135 90 30 -Line -16777216 false 150 105 195 60 -Line -16777216 false 150 105 105 60 - -car -false -0 -Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180 -Circle -16777216 true false 180 180 90 -Circle -16777216 true false 30 180 90 -Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89 -Circle -7500403 true true 47 195 58 -Circle -7500403 true true 195 195 58 - -circle -false -0 -Circle -7500403 true true 0 0 300 - -circle 2 -false -0 -Circle -7500403 true true 0 0 300 -Circle -16777216 true false 30 30 240 - -cow -false -0 -Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167 -Polygon -7500403 true true 73 210 86 251 62 249 48 208 -Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123 - -cylinder -false -0 -Circle -7500403 true true 0 0 300 - -dot -false -0 -Circle -7500403 true true 90 90 120 - -face happy -false -0 -Circle -7500403 true true 8 8 285 -Circle -16777216 true false 60 75 60 -Circle -16777216 true false 180 75 60 -Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240 - -face neutral -false -0 -Circle -7500403 true true 8 7 285 -Circle -16777216 true false 60 75 60 -Circle -16777216 true false 180 75 60 -Rectangle -16777216 true false 60 195 240 225 - -face sad -false -0 -Circle -7500403 true true 8 8 285 -Circle -16777216 true false 60 75 60 -Circle -16777216 true false 180 75 60 -Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183 - -fish -false -0 -Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166 -Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165 -Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60 -Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166 -Circle -16777216 true false 215 106 30 - -flag -false -0 -Rectangle -7500403 true true 60 15 75 300 -Polygon -7500403 true true 90 150 270 90 90 30 -Line -7500403 true 75 135 90 135 -Line -7500403 true 75 45 90 45 - -flower -false -0 -Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135 -Circle -7500403 true true 85 132 38 -Circle -7500403 true true 130 147 38 -Circle -7500403 true true 192 85 38 -Circle -7500403 true true 85 40 38 -Circle -7500403 true true 177 40 38 -Circle -7500403 true true 177 132 38 -Circle -7500403 true true 70 85 38 -Circle -7500403 true true 130 25 38 -Circle -7500403 true true 96 51 108 -Circle -16777216 true false 113 68 74 -Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218 -Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240 - -house -false -0 -Rectangle -7500403 true true 45 120 255 285 -Rectangle -16777216 true false 120 210 180 285 -Polygon -7500403 true true 15 120 150 15 285 120 -Line -16777216 false 30 120 270 120 - -leaf -false -0 -Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195 -Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195 - -line -true -0 -Line -7500403 true 150 0 150 300 - -line half -true -0 -Line -7500403 true 150 0 150 150 - -pentagon -false -0 -Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120 - -person -false -0 -Circle -7500403 true true 110 5 80 -Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90 -Rectangle -7500403 true true 127 79 172 94 -Polygon -7500403 true true 195 90 240 150 225 180 165 105 -Polygon -7500403 true true 105 90 60 150 75 180 135 105 - -plant -false -0 -Rectangle -7500403 true true 135 90 165 300 -Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285 -Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285 -Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210 -Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135 -Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135 -Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60 -Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90 - -sheep -false -15 -Circle -1 true true 203 65 88 -Circle -1 true true 70 65 162 -Circle -1 true true 150 105 120 -Polygon -7500403 true false 218 120 240 165 255 165 278 120 -Circle -7500403 true false 214 72 67 -Rectangle -1 true true 164 223 179 298 -Polygon -1 true true 45 285 30 285 30 240 15 195 45 210 -Circle -1 true true 3 83 150 -Rectangle -1 true true 65 221 80 296 -Polygon -1 true true 195 285 210 285 210 240 240 210 195 210 -Polygon -7500403 true false 276 85 285 105 302 99 294 83 -Polygon -7500403 true false 219 85 210 105 193 99 201 83 - -square -false -0 -Rectangle -7500403 true true 30 30 270 270 - -square 2 -false -0 -Rectangle -7500403 true true 30 30 270 270 -Rectangle -16777216 true false 60 60 240 240 - -star -false -0 -Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108 - -target -false -0 -Circle -7500403 true true 0 0 300 -Circle -16777216 true false 30 30 240 -Circle -7500403 true true 60 60 180 -Circle -16777216 true false 90 90 120 -Circle -7500403 true true 120 120 60 - -tree -false -0 -Circle -7500403 true true 118 3 94 -Rectangle -6459832 true false 120 195 180 300 -Circle -7500403 true true 65 21 108 -Circle -7500403 true true 116 41 127 -Circle -7500403 true true 45 90 120 -Circle -7500403 true true 104 74 152 - -triangle -false -0 -Polygon -7500403 true true 150 30 15 255 285 255 - -triangle 2 -false -0 -Polygon -7500403 true true 150 30 15 255 285 255 -Polygon -16777216 true false 151 99 225 223 75 224 - -truck -false -0 -Rectangle -7500403 true true 4 45 195 187 -Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194 -Rectangle -1 true false 195 60 195 105 -Polygon -16777216 true false 238 112 252 141 219 141 218 112 -Circle -16777216 true false 234 174 42 -Rectangle -7500403 true true 181 185 214 194 -Circle -16777216 true false 144 174 42 -Circle -16777216 true false 24 174 42 -Circle -7500403 false true 24 174 42 -Circle -7500403 false true 144 174 42 -Circle -7500403 false true 234 174 42 - -turtle -true -0 -Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210 -Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105 -Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105 -Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87 -Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210 -Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99 - -wheel -false -0 -Circle -7500403 true true 3 3 294 -Circle -16777216 true false 30 30 240 -Line -7500403 true 150 285 150 15 -Line -7500403 true 15 150 285 150 -Circle -7500403 true true 120 120 60 -Line -7500403 true 216 40 79 269 -Line -7500403 true 40 84 269 221 -Line -7500403 true 40 216 269 79 -Line -7500403 true 84 40 221 269 - -wolf -false -0 -Polygon -16777216 true false 253 133 245 131 245 133 -Polygon -7500403 true true 2 194 13 197 30 191 38 193 38 205 20 226 20 257 27 265 38 266 40 260 31 253 31 230 60 206 68 198 75 209 66 228 65 243 82 261 84 268 100 267 103 261 77 239 79 231 100 207 98 196 119 201 143 202 160 195 166 210 172 213 173 238 167 251 160 248 154 265 169 264 178 247 186 240 198 260 200 271 217 271 219 262 207 258 195 230 192 198 210 184 227 164 242 144 259 145 284 151 277 141 293 140 299 134 297 127 273 119 270 105 -Polygon -7500403 true true -1 195 14 180 36 166 40 153 53 140 82 131 134 133 159 126 188 115 227 108 236 102 238 98 268 86 269 92 281 87 269 103 269 113 - -x -false -0 -Polygon -7500403 true true 270 75 225 30 30 225 75 270 -Polygon -7500403 true true 30 75 75 30 270 225 225 270 -@#$#@#$#@ -NetLogo 6.4.0 -@#$#@#$#@ -@#$#@#$#@ -@#$#@#$#@ -@#$#@#$#@ -@#$#@#$#@ -default -0.0 --0.2 0 0.0 1.0 -0.0 1 1.0 0.0 -0.2 0 0.0 1.0 -link direction -true -0 -Line -7500403 true 150 150 90 180 -Line -7500403 true 150 150 210 180 -@#$#@#$#@ -0 -@#$#@#$#@ From 25d8cd08de00993cf8efcfec294a42490e308bbf Mon Sep 17 00:00:00 2001 From: AmberHam Date: Fri, 15 Nov 2024 22:31:25 +0100 Subject: [PATCH 47/69] Add files via upload --- .../Preferential Attachment Network.nlogo | 537 ++++++++++++++++++ 1 file changed, 537 insertions(+) create mode 100644 2024-Jarigsma-001/Preferential Attachment Network.nlogo diff --git a/2024-Jarigsma-001/Preferential Attachment Network.nlogo b/2024-Jarigsma-001/Preferential Attachment Network.nlogo new file mode 100644 index 0000000..0f53f4a --- /dev/null +++ b/2024-Jarigsma-001/Preferential Attachment Network.nlogo @@ -0,0 +1,537 @@ +breed [nodes node] +nodes-own [degree new-node] ; the degree attribute will store the number of links each node has, while the new-node attribute will only be 'true' if the node is new + +;; +;; SETUP PROCEDURE +;; +to setup + clear-all + set-default-shape nodes "circle" + + create-nodes number-of-nodes [ + setxy random-xcor random-ycor + set color red + set degree 0 + ] + + reset-ticks +end + +;; +;; MAIN PROCEDURES +;; +to go + make-node + create-edge + layout + tick +end + +to make-node + create-nodes 1 [ + set degree 0 + set color red + set new-node true + ] +end + +to create-edge + let added-node nodes with [new-node = true] + + let partner find-preferential-partner + ask added-node [ + create-link-with partner + set degree degree + 1 + set new-node false + ] + + ask partner [ + set degree degree + 1 + ] + +end + +;; This is the main component of the "preferential attachment" mechanism. +;; Nodes are entered into a "lottery" where the number of 'connections' each node has +;; is proportional to its number of links. This creates a mechanism where nodes +;; with more links have a higher probability of being randomly selected. +to-report find-preferential-partner + let connections [] + + ask nodes [ + if new-node != true [ + let connections-count degree + 1 + repeat connections-count [ + set connections lput self connections + ] + ] + ] + + report one-of connections +end + +;; +;; LAYOUT PROCEDURE +;; +to layout + ask nodes [ + set size (degree + 1) * 0.5 ;node size is proportional to the number of links the node has + ] + + layout-spring (nodes with [any? link-neighbors]) links 0.4 6 1 +end +@#$#@#$#@ +GRAPHICS-WINDOW +210 +10 +828 +629 +-1 +-1 +10.0 +1 +10 +1 +1 +1 +0 +1 +1 +1 +-30 +30 +-30 +30 +0 +0 +1 +ticks +30.0 + +BUTTON +28 +28 +94 +61 +NIL +setup\n +NIL +1 +T +OBSERVER +NIL +NIL +NIL +NIL +1 + +BUTTON +108 +29 +171 +62 +NIL +go +T +1 +T +OBSERVER +NIL +NIL +NIL +NIL +1 + +BUTTON +107 +71 +188 +104 +go once +go +NIL +1 +T +OBSERVER +NIL +NIL +NIL +NIL +1 + +SLIDER +20 +119 +192 +152 +number-of-nodes +number-of-nodes +1 +100 +4.0 +1 +1 +NIL +HORIZONTAL + +@#$#@#$#@ +## WHAT IS IT? + +(a general understanding of what the model is trying to show or explain) + +## HOW IT WORKS + +(what rules the agents use to create the overall behavior of the model) + +## HOW TO USE IT + +(how to use the model, including a description of each of the items in the Interface tab) + +## THINGS TO NOTICE + +(suggested things for the user to notice while running the model) + +## THINGS TO TRY + +(suggested things for the user to try to do (move sliders, switches, etc.) with the model) + +## EXTENDING THE MODEL + +(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.) + +## NETLOGO FEATURES + +(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features) + +## RELATED MODELS + +(models in the NetLogo Models Library and elsewhere which are of related interest) + +## CREDITS AND REFERENCES + +(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links) +@#$#@#$#@ +default +true +0 +Polygon -7500403 true true 150 5 40 250 150 205 260 250 + +airplane +true +0 +Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15 + +arrow +true +0 +Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 + +box +false +0 +Polygon -7500403 true true 150 285 285 225 285 75 150 135 +Polygon -7500403 true true 150 135 15 75 150 15 285 75 +Polygon -7500403 true true 15 75 15 225 150 285 150 135 +Line -16777216 false 150 285 150 135 +Line -16777216 false 150 135 15 75 +Line -16777216 false 150 135 285 75 + +bug +true +0 +Circle -7500403 true true 96 182 108 +Circle -7500403 true true 110 127 80 +Circle -7500403 true true 110 75 80 +Line -7500403 true 150 100 80 30 +Line -7500403 true 150 100 220 30 + +butterfly +true +0 +Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240 +Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240 +Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163 +Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165 +Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225 +Circle -16777216 true false 135 90 30 +Line -16777216 false 150 105 195 60 +Line -16777216 false 150 105 105 60 + +car +false +0 +Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180 +Circle -16777216 true false 180 180 90 +Circle -16777216 true false 30 180 90 +Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89 +Circle -7500403 true true 47 195 58 +Circle -7500403 true true 195 195 58 + +circle +false +0 +Circle -7500403 true true 0 0 300 + +circle 2 +false +0 +Circle -7500403 true true 0 0 300 +Circle -16777216 true false 30 30 240 + +cow +false +0 +Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167 +Polygon -7500403 true true 73 210 86 251 62 249 48 208 +Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123 + +cylinder +false +0 +Circle -7500403 true true 0 0 300 + +dot +false +0 +Circle -7500403 true true 90 90 120 + +face happy +false +0 +Circle -7500403 true true 8 8 285 +Circle -16777216 true false 60 75 60 +Circle -16777216 true false 180 75 60 +Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240 + +face neutral +false +0 +Circle -7500403 true true 8 7 285 +Circle -16777216 true false 60 75 60 +Circle -16777216 true false 180 75 60 +Rectangle -16777216 true false 60 195 240 225 + +face sad +false +0 +Circle -7500403 true true 8 8 285 +Circle -16777216 true false 60 75 60 +Circle -16777216 true false 180 75 60 +Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183 + +fish +false +0 +Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166 +Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165 +Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60 +Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166 +Circle -16777216 true false 215 106 30 + +flag +false +0 +Rectangle -7500403 true true 60 15 75 300 +Polygon -7500403 true true 90 150 270 90 90 30 +Line -7500403 true 75 135 90 135 +Line -7500403 true 75 45 90 45 + +flower +false +0 +Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135 +Circle -7500403 true true 85 132 38 +Circle -7500403 true true 130 147 38 +Circle -7500403 true true 192 85 38 +Circle -7500403 true true 85 40 38 +Circle -7500403 true true 177 40 38 +Circle -7500403 true true 177 132 38 +Circle -7500403 true true 70 85 38 +Circle -7500403 true true 130 25 38 +Circle -7500403 true true 96 51 108 +Circle -16777216 true false 113 68 74 +Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218 +Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240 + +house +false +0 +Rectangle -7500403 true true 45 120 255 285 +Rectangle -16777216 true false 120 210 180 285 +Polygon -7500403 true true 15 120 150 15 285 120 +Line -16777216 false 30 120 270 120 + +leaf +false +0 +Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195 +Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195 + +line +true +0 +Line -7500403 true 150 0 150 300 + +line half +true +0 +Line -7500403 true 150 0 150 150 + +pentagon +false +0 +Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120 + +person +false +0 +Circle -7500403 true true 110 5 80 +Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90 +Rectangle -7500403 true true 127 79 172 94 +Polygon -7500403 true true 195 90 240 150 225 180 165 105 +Polygon -7500403 true true 105 90 60 150 75 180 135 105 + +plant +false +0 +Rectangle -7500403 true true 135 90 165 300 +Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285 +Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285 +Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210 +Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135 +Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135 +Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60 +Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90 + +sheep +false +15 +Circle -1 true true 203 65 88 +Circle -1 true true 70 65 162 +Circle -1 true true 150 105 120 +Polygon -7500403 true false 218 120 240 165 255 165 278 120 +Circle -7500403 true false 214 72 67 +Rectangle -1 true true 164 223 179 298 +Polygon -1 true true 45 285 30 285 30 240 15 195 45 210 +Circle -1 true true 3 83 150 +Rectangle -1 true true 65 221 80 296 +Polygon -1 true true 195 285 210 285 210 240 240 210 195 210 +Polygon -7500403 true false 276 85 285 105 302 99 294 83 +Polygon -7500403 true false 219 85 210 105 193 99 201 83 + +square +false +0 +Rectangle -7500403 true true 30 30 270 270 + +square 2 +false +0 +Rectangle -7500403 true true 30 30 270 270 +Rectangle -16777216 true false 60 60 240 240 + +star +false +0 +Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108 + +target +false +0 +Circle -7500403 true true 0 0 300 +Circle -16777216 true false 30 30 240 +Circle -7500403 true true 60 60 180 +Circle -16777216 true false 90 90 120 +Circle -7500403 true true 120 120 60 + +tree +false +0 +Circle -7500403 true true 118 3 94 +Rectangle -6459832 true false 120 195 180 300 +Circle -7500403 true true 65 21 108 +Circle -7500403 true true 116 41 127 +Circle -7500403 true true 45 90 120 +Circle -7500403 true true 104 74 152 + +triangle +false +0 +Polygon -7500403 true true 150 30 15 255 285 255 + +triangle 2 +false +0 +Polygon -7500403 true true 150 30 15 255 285 255 +Polygon -16777216 true false 151 99 225 223 75 224 + +truck +false +0 +Rectangle -7500403 true true 4 45 195 187 +Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194 +Rectangle -1 true false 195 60 195 105 +Polygon -16777216 true false 238 112 252 141 219 141 218 112 +Circle -16777216 true false 234 174 42 +Rectangle -7500403 true true 181 185 214 194 +Circle -16777216 true false 144 174 42 +Circle -16777216 true false 24 174 42 +Circle -7500403 false true 24 174 42 +Circle -7500403 false true 144 174 42 +Circle -7500403 false true 234 174 42 + +turtle +true +0 +Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210 +Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105 +Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105 +Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87 +Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210 +Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99 + +wheel +false +0 +Circle -7500403 true true 3 3 294 +Circle -16777216 true false 30 30 240 +Line -7500403 true 150 285 150 15 +Line -7500403 true 15 150 285 150 +Circle -7500403 true true 120 120 60 +Line -7500403 true 216 40 79 269 +Line -7500403 true 40 84 269 221 +Line -7500403 true 40 216 269 79 +Line -7500403 true 84 40 221 269 + +wolf +false +0 +Polygon -16777216 true false 253 133 245 131 245 133 +Polygon -7500403 true true 2 194 13 197 30 191 38 193 38 205 20 226 20 257 27 265 38 266 40 260 31 253 31 230 60 206 68 198 75 209 66 228 65 243 82 261 84 268 100 267 103 261 77 239 79 231 100 207 98 196 119 201 143 202 160 195 166 210 172 213 173 238 167 251 160 248 154 265 169 264 178 247 186 240 198 260 200 271 217 271 219 262 207 258 195 230 192 198 210 184 227 164 242 144 259 145 284 151 277 141 293 140 299 134 297 127 273 119 270 105 +Polygon -7500403 true true -1 195 14 180 36 166 40 153 53 140 82 131 134 133 159 126 188 115 227 108 236 102 238 98 268 86 269 92 281 87 269 103 269 113 + +x +false +0 +Polygon -7500403 true true 270 75 225 30 30 225 75 270 +Polygon -7500403 true true 30 75 75 30 270 225 225 270 +@#$#@#$#@ +NetLogo 6.4.0 +@#$#@#$#@ +@#$#@#$#@ +@#$#@#$#@ +@#$#@#$#@ +@#$#@#$#@ +default +0.0 +-0.2 0 0.0 1.0 +0.0 1 1.0 0.0 +0.2 0 0.0 1.0 +link direction +true +0 +Line -7500403 true 150 150 90 180 +Line -7500403 true 150 150 210 180 +@#$#@#$#@ +0 +@#$#@#$#@ From 5c8c5cbd8a9ba427e36f3332865718986404f79a Mon Sep 17 00:00:00 2001 From: AmberHam Date: Fri, 15 Nov 2024 22:32:23 +0100 Subject: [PATCH 48/69] Delete 2024-Jarigsma-001/Preferential Attachment Network.nlogo --- .../Preferential Attachment Network.nlogo | 537 ------------------ 1 file changed, 537 deletions(-) delete mode 100644 2024-Jarigsma-001/Preferential Attachment Network.nlogo diff --git a/2024-Jarigsma-001/Preferential Attachment Network.nlogo b/2024-Jarigsma-001/Preferential Attachment Network.nlogo deleted file mode 100644 index 0f53f4a..0000000 --- a/2024-Jarigsma-001/Preferential Attachment Network.nlogo +++ /dev/null @@ -1,537 +0,0 @@ -breed [nodes node] -nodes-own [degree new-node] ; the degree attribute will store the number of links each node has, while the new-node attribute will only be 'true' if the node is new - -;; -;; SETUP PROCEDURE -;; -to setup - clear-all - set-default-shape nodes "circle" - - create-nodes number-of-nodes [ - setxy random-xcor random-ycor - set color red - set degree 0 - ] - - reset-ticks -end - -;; -;; MAIN PROCEDURES -;; -to go - make-node - create-edge - layout - tick -end - -to make-node - create-nodes 1 [ - set degree 0 - set color red - set new-node true - ] -end - -to create-edge - let added-node nodes with [new-node = true] - - let partner find-preferential-partner - ask added-node [ - create-link-with partner - set degree degree + 1 - set new-node false - ] - - ask partner [ - set degree degree + 1 - ] - -end - -;; This is the main component of the "preferential attachment" mechanism. -;; Nodes are entered into a "lottery" where the number of 'connections' each node has -;; is proportional to its number of links. This creates a mechanism where nodes -;; with more links have a higher probability of being randomly selected. -to-report find-preferential-partner - let connections [] - - ask nodes [ - if new-node != true [ - let connections-count degree + 1 - repeat connections-count [ - set connections lput self connections - ] - ] - ] - - report one-of connections -end - -;; -;; LAYOUT PROCEDURE -;; -to layout - ask nodes [ - set size (degree + 1) * 0.5 ;node size is proportional to the number of links the node has - ] - - layout-spring (nodes with [any? link-neighbors]) links 0.4 6 1 -end -@#$#@#$#@ -GRAPHICS-WINDOW -210 -10 -828 -629 --1 --1 -10.0 -1 -10 -1 -1 -1 -0 -1 -1 -1 --30 -30 --30 -30 -0 -0 -1 -ticks -30.0 - -BUTTON -28 -28 -94 -61 -NIL -setup\n -NIL -1 -T -OBSERVER -NIL -NIL -NIL -NIL -1 - -BUTTON -108 -29 -171 -62 -NIL -go -T -1 -T -OBSERVER -NIL -NIL -NIL -NIL -1 - -BUTTON -107 -71 -188 -104 -go once -go -NIL -1 -T -OBSERVER -NIL -NIL -NIL -NIL -1 - -SLIDER -20 -119 -192 -152 -number-of-nodes -number-of-nodes -1 -100 -4.0 -1 -1 -NIL -HORIZONTAL - -@#$#@#$#@ -## WHAT IS IT? - -(a general understanding of what the model is trying to show or explain) - -## HOW IT WORKS - -(what rules the agents use to create the overall behavior of the model) - -## HOW TO USE IT - -(how to use the model, including a description of each of the items in the Interface tab) - -## THINGS TO NOTICE - -(suggested things for the user to notice while running the model) - -## THINGS TO TRY - -(suggested things for the user to try to do (move sliders, switches, etc.) with the model) - -## EXTENDING THE MODEL - -(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.) - -## NETLOGO FEATURES - -(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features) - -## RELATED MODELS - -(models in the NetLogo Models Library and elsewhere which are of related interest) - -## CREDITS AND REFERENCES - -(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links) -@#$#@#$#@ -default -true -0 -Polygon -7500403 true true 150 5 40 250 150 205 260 250 - -airplane -true -0 -Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15 - -arrow -true -0 -Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 - -box -false -0 -Polygon -7500403 true true 150 285 285 225 285 75 150 135 -Polygon -7500403 true true 150 135 15 75 150 15 285 75 -Polygon -7500403 true true 15 75 15 225 150 285 150 135 -Line -16777216 false 150 285 150 135 -Line -16777216 false 150 135 15 75 -Line -16777216 false 150 135 285 75 - -bug -true -0 -Circle -7500403 true true 96 182 108 -Circle -7500403 true true 110 127 80 -Circle -7500403 true true 110 75 80 -Line -7500403 true 150 100 80 30 -Line -7500403 true 150 100 220 30 - -butterfly -true -0 -Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240 -Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240 -Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163 -Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165 -Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225 -Circle -16777216 true false 135 90 30 -Line -16777216 false 150 105 195 60 -Line -16777216 false 150 105 105 60 - -car -false -0 -Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180 -Circle -16777216 true false 180 180 90 -Circle -16777216 true false 30 180 90 -Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89 -Circle -7500403 true true 47 195 58 -Circle -7500403 true true 195 195 58 - -circle -false -0 -Circle -7500403 true true 0 0 300 - -circle 2 -false -0 -Circle -7500403 true true 0 0 300 -Circle -16777216 true false 30 30 240 - -cow -false -0 -Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167 -Polygon -7500403 true true 73 210 86 251 62 249 48 208 -Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123 - -cylinder -false -0 -Circle -7500403 true true 0 0 300 - -dot -false -0 -Circle -7500403 true true 90 90 120 - -face happy -false -0 -Circle -7500403 true true 8 8 285 -Circle -16777216 true false 60 75 60 -Circle -16777216 true false 180 75 60 -Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240 - -face neutral -false -0 -Circle -7500403 true true 8 7 285 -Circle -16777216 true false 60 75 60 -Circle -16777216 true false 180 75 60 -Rectangle -16777216 true false 60 195 240 225 - -face sad -false -0 -Circle -7500403 true true 8 8 285 -Circle -16777216 true false 60 75 60 -Circle -16777216 true false 180 75 60 -Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183 - -fish -false -0 -Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166 -Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165 -Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60 -Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166 -Circle -16777216 true false 215 106 30 - -flag -false -0 -Rectangle -7500403 true true 60 15 75 300 -Polygon -7500403 true true 90 150 270 90 90 30 -Line -7500403 true 75 135 90 135 -Line -7500403 true 75 45 90 45 - -flower -false -0 -Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135 -Circle -7500403 true true 85 132 38 -Circle -7500403 true true 130 147 38 -Circle -7500403 true true 192 85 38 -Circle -7500403 true true 85 40 38 -Circle -7500403 true true 177 40 38 -Circle -7500403 true true 177 132 38 -Circle -7500403 true true 70 85 38 -Circle -7500403 true true 130 25 38 -Circle -7500403 true true 96 51 108 -Circle -16777216 true false 113 68 74 -Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218 -Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240 - -house -false -0 -Rectangle -7500403 true true 45 120 255 285 -Rectangle -16777216 true false 120 210 180 285 -Polygon -7500403 true true 15 120 150 15 285 120 -Line -16777216 false 30 120 270 120 - -leaf -false -0 -Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195 -Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195 - -line -true -0 -Line -7500403 true 150 0 150 300 - -line half -true -0 -Line -7500403 true 150 0 150 150 - -pentagon -false -0 -Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120 - -person -false -0 -Circle -7500403 true true 110 5 80 -Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90 -Rectangle -7500403 true true 127 79 172 94 -Polygon -7500403 true true 195 90 240 150 225 180 165 105 -Polygon -7500403 true true 105 90 60 150 75 180 135 105 - -plant -false -0 -Rectangle -7500403 true true 135 90 165 300 -Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285 -Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285 -Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210 -Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135 -Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135 -Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60 -Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90 - -sheep -false -15 -Circle -1 true true 203 65 88 -Circle -1 true true 70 65 162 -Circle -1 true true 150 105 120 -Polygon -7500403 true false 218 120 240 165 255 165 278 120 -Circle -7500403 true false 214 72 67 -Rectangle -1 true true 164 223 179 298 -Polygon -1 true true 45 285 30 285 30 240 15 195 45 210 -Circle -1 true true 3 83 150 -Rectangle -1 true true 65 221 80 296 -Polygon -1 true true 195 285 210 285 210 240 240 210 195 210 -Polygon -7500403 true false 276 85 285 105 302 99 294 83 -Polygon -7500403 true false 219 85 210 105 193 99 201 83 - -square -false -0 -Rectangle -7500403 true true 30 30 270 270 - -square 2 -false -0 -Rectangle -7500403 true true 30 30 270 270 -Rectangle -16777216 true false 60 60 240 240 - -star -false -0 -Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108 - -target -false -0 -Circle -7500403 true true 0 0 300 -Circle -16777216 true false 30 30 240 -Circle -7500403 true true 60 60 180 -Circle -16777216 true false 90 90 120 -Circle -7500403 true true 120 120 60 - -tree -false -0 -Circle -7500403 true true 118 3 94 -Rectangle -6459832 true false 120 195 180 300 -Circle -7500403 true true 65 21 108 -Circle -7500403 true true 116 41 127 -Circle -7500403 true true 45 90 120 -Circle -7500403 true true 104 74 152 - -triangle -false -0 -Polygon -7500403 true true 150 30 15 255 285 255 - -triangle 2 -false -0 -Polygon -7500403 true true 150 30 15 255 285 255 -Polygon -16777216 true false 151 99 225 223 75 224 - -truck -false -0 -Rectangle -7500403 true true 4 45 195 187 -Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194 -Rectangle -1 true false 195 60 195 105 -Polygon -16777216 true false 238 112 252 141 219 141 218 112 -Circle -16777216 true false 234 174 42 -Rectangle -7500403 true true 181 185 214 194 -Circle -16777216 true false 144 174 42 -Circle -16777216 true false 24 174 42 -Circle -7500403 false true 24 174 42 -Circle -7500403 false true 144 174 42 -Circle -7500403 false true 234 174 42 - -turtle -true -0 -Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210 -Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105 -Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105 -Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87 -Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210 -Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99 - -wheel -false -0 -Circle -7500403 true true 3 3 294 -Circle -16777216 true false 30 30 240 -Line -7500403 true 150 285 150 15 -Line -7500403 true 15 150 285 150 -Circle -7500403 true true 120 120 60 -Line -7500403 true 216 40 79 269 -Line -7500403 true 40 84 269 221 -Line -7500403 true 40 216 269 79 -Line -7500403 true 84 40 221 269 - -wolf -false -0 -Polygon -16777216 true false 253 133 245 131 245 133 -Polygon -7500403 true true 2 194 13 197 30 191 38 193 38 205 20 226 20 257 27 265 38 266 40 260 31 253 31 230 60 206 68 198 75 209 66 228 65 243 82 261 84 268 100 267 103 261 77 239 79 231 100 207 98 196 119 201 143 202 160 195 166 210 172 213 173 238 167 251 160 248 154 265 169 264 178 247 186 240 198 260 200 271 217 271 219 262 207 258 195 230 192 198 210 184 227 164 242 144 259 145 284 151 277 141 293 140 299 134 297 127 273 119 270 105 -Polygon -7500403 true true -1 195 14 180 36 166 40 153 53 140 82 131 134 133 159 126 188 115 227 108 236 102 238 98 268 86 269 92 281 87 269 103 269 113 - -x -false -0 -Polygon -7500403 true true 270 75 225 30 30 225 75 270 -Polygon -7500403 true true 30 75 75 30 270 225 225 270 -@#$#@#$#@ -NetLogo 6.4.0 -@#$#@#$#@ -@#$#@#$#@ -@#$#@#$#@ -@#$#@#$#@ -@#$#@#$#@ -default -0.0 --0.2 0 0.0 1.0 -0.0 1 1.0 0.0 -0.2 0 0.0 1.0 -link direction -true -0 -Line -7500403 true 150 150 90 180 -Line -7500403 true 150 150 210 180 -@#$#@#$#@ -0 -@#$#@#$#@ From 0e6459f742583a92d654084fe1044089d55ec413 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Fri, 15 Nov 2024 22:33:03 +0100 Subject: [PATCH 49/69] Create delete --- 2024-Jarigsma-001/netlogo_implementation/delete | 1 + 1 file changed, 1 insertion(+) create mode 100644 2024-Jarigsma-001/netlogo_implementation/delete diff --git a/2024-Jarigsma-001/netlogo_implementation/delete b/2024-Jarigsma-001/netlogo_implementation/delete new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/2024-Jarigsma-001/netlogo_implementation/delete @@ -0,0 +1 @@ + From 58dfd8fe5f3e702ef40bdb617368873b7ce05a58 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Fri, 15 Nov 2024 22:33:20 +0100 Subject: [PATCH 50/69] Add files via upload --- .../Preferential Attachment Network.nlogo | 537 ++++++++++++++++++ 1 file changed, 537 insertions(+) create mode 100644 2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo diff --git a/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo b/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo new file mode 100644 index 0000000..0f53f4a --- /dev/null +++ b/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo @@ -0,0 +1,537 @@ +breed [nodes node] +nodes-own [degree new-node] ; the degree attribute will store the number of links each node has, while the new-node attribute will only be 'true' if the node is new + +;; +;; SETUP PROCEDURE +;; +to setup + clear-all + set-default-shape nodes "circle" + + create-nodes number-of-nodes [ + setxy random-xcor random-ycor + set color red + set degree 0 + ] + + reset-ticks +end + +;; +;; MAIN PROCEDURES +;; +to go + make-node + create-edge + layout + tick +end + +to make-node + create-nodes 1 [ + set degree 0 + set color red + set new-node true + ] +end + +to create-edge + let added-node nodes with [new-node = true] + + let partner find-preferential-partner + ask added-node [ + create-link-with partner + set degree degree + 1 + set new-node false + ] + + ask partner [ + set degree degree + 1 + ] + +end + +;; This is the main component of the "preferential attachment" mechanism. +;; Nodes are entered into a "lottery" where the number of 'connections' each node has +;; is proportional to its number of links. This creates a mechanism where nodes +;; with more links have a higher probability of being randomly selected. +to-report find-preferential-partner + let connections [] + + ask nodes [ + if new-node != true [ + let connections-count degree + 1 + repeat connections-count [ + set connections lput self connections + ] + ] + ] + + report one-of connections +end + +;; +;; LAYOUT PROCEDURE +;; +to layout + ask nodes [ + set size (degree + 1) * 0.5 ;node size is proportional to the number of links the node has + ] + + layout-spring (nodes with [any? link-neighbors]) links 0.4 6 1 +end +@#$#@#$#@ +GRAPHICS-WINDOW +210 +10 +828 +629 +-1 +-1 +10.0 +1 +10 +1 +1 +1 +0 +1 +1 +1 +-30 +30 +-30 +30 +0 +0 +1 +ticks +30.0 + +BUTTON +28 +28 +94 +61 +NIL +setup\n +NIL +1 +T +OBSERVER +NIL +NIL +NIL +NIL +1 + +BUTTON +108 +29 +171 +62 +NIL +go +T +1 +T +OBSERVER +NIL +NIL +NIL +NIL +1 + +BUTTON +107 +71 +188 +104 +go once +go +NIL +1 +T +OBSERVER +NIL +NIL +NIL +NIL +1 + +SLIDER +20 +119 +192 +152 +number-of-nodes +number-of-nodes +1 +100 +4.0 +1 +1 +NIL +HORIZONTAL + +@#$#@#$#@ +## WHAT IS IT? + +(a general understanding of what the model is trying to show or explain) + +## HOW IT WORKS + +(what rules the agents use to create the overall behavior of the model) + +## HOW TO USE IT + +(how to use the model, including a description of each of the items in the Interface tab) + +## THINGS TO NOTICE + +(suggested things for the user to notice while running the model) + +## THINGS TO TRY + +(suggested things for the user to try to do (move sliders, switches, etc.) with the model) + +## EXTENDING THE MODEL + +(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.) + +## NETLOGO FEATURES + +(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features) + +## RELATED MODELS + +(models in the NetLogo Models Library and elsewhere which are of related interest) + +## CREDITS AND REFERENCES + +(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links) +@#$#@#$#@ +default +true +0 +Polygon -7500403 true true 150 5 40 250 150 205 260 250 + +airplane +true +0 +Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15 + +arrow +true +0 +Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 + +box +false +0 +Polygon -7500403 true true 150 285 285 225 285 75 150 135 +Polygon -7500403 true true 150 135 15 75 150 15 285 75 +Polygon -7500403 true true 15 75 15 225 150 285 150 135 +Line -16777216 false 150 285 150 135 +Line -16777216 false 150 135 15 75 +Line -16777216 false 150 135 285 75 + +bug +true +0 +Circle -7500403 true true 96 182 108 +Circle -7500403 true true 110 127 80 +Circle -7500403 true true 110 75 80 +Line -7500403 true 150 100 80 30 +Line -7500403 true 150 100 220 30 + +butterfly +true +0 +Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240 +Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240 +Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163 +Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165 +Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225 +Circle -16777216 true false 135 90 30 +Line -16777216 false 150 105 195 60 +Line -16777216 false 150 105 105 60 + +car +false +0 +Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180 +Circle -16777216 true false 180 180 90 +Circle -16777216 true false 30 180 90 +Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89 +Circle -7500403 true true 47 195 58 +Circle -7500403 true true 195 195 58 + +circle +false +0 +Circle -7500403 true true 0 0 300 + +circle 2 +false +0 +Circle -7500403 true true 0 0 300 +Circle -16777216 true false 30 30 240 + +cow +false +0 +Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167 +Polygon -7500403 true true 73 210 86 251 62 249 48 208 +Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123 + +cylinder +false +0 +Circle -7500403 true true 0 0 300 + +dot +false +0 +Circle -7500403 true true 90 90 120 + +face happy +false +0 +Circle -7500403 true true 8 8 285 +Circle -16777216 true false 60 75 60 +Circle -16777216 true false 180 75 60 +Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240 + +face neutral +false +0 +Circle -7500403 true true 8 7 285 +Circle -16777216 true false 60 75 60 +Circle -16777216 true false 180 75 60 +Rectangle -16777216 true false 60 195 240 225 + +face sad +false +0 +Circle -7500403 true true 8 8 285 +Circle -16777216 true false 60 75 60 +Circle -16777216 true false 180 75 60 +Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183 + +fish +false +0 +Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166 +Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165 +Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60 +Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166 +Circle -16777216 true false 215 106 30 + +flag +false +0 +Rectangle -7500403 true true 60 15 75 300 +Polygon -7500403 true true 90 150 270 90 90 30 +Line -7500403 true 75 135 90 135 +Line -7500403 true 75 45 90 45 + +flower +false +0 +Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135 +Circle -7500403 true true 85 132 38 +Circle -7500403 true true 130 147 38 +Circle -7500403 true true 192 85 38 +Circle -7500403 true true 85 40 38 +Circle -7500403 true true 177 40 38 +Circle -7500403 true true 177 132 38 +Circle -7500403 true true 70 85 38 +Circle -7500403 true true 130 25 38 +Circle -7500403 true true 96 51 108 +Circle -16777216 true false 113 68 74 +Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218 +Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240 + +house +false +0 +Rectangle -7500403 true true 45 120 255 285 +Rectangle -16777216 true false 120 210 180 285 +Polygon -7500403 true true 15 120 150 15 285 120 +Line -16777216 false 30 120 270 120 + +leaf +false +0 +Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195 +Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195 + +line +true +0 +Line -7500403 true 150 0 150 300 + +line half +true +0 +Line -7500403 true 150 0 150 150 + +pentagon +false +0 +Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120 + +person +false +0 +Circle -7500403 true true 110 5 80 +Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90 +Rectangle -7500403 true true 127 79 172 94 +Polygon -7500403 true true 195 90 240 150 225 180 165 105 +Polygon -7500403 true true 105 90 60 150 75 180 135 105 + +plant +false +0 +Rectangle -7500403 true true 135 90 165 300 +Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285 +Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285 +Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210 +Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135 +Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135 +Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60 +Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90 + +sheep +false +15 +Circle -1 true true 203 65 88 +Circle -1 true true 70 65 162 +Circle -1 true true 150 105 120 +Polygon -7500403 true false 218 120 240 165 255 165 278 120 +Circle -7500403 true false 214 72 67 +Rectangle -1 true true 164 223 179 298 +Polygon -1 true true 45 285 30 285 30 240 15 195 45 210 +Circle -1 true true 3 83 150 +Rectangle -1 true true 65 221 80 296 +Polygon -1 true true 195 285 210 285 210 240 240 210 195 210 +Polygon -7500403 true false 276 85 285 105 302 99 294 83 +Polygon -7500403 true false 219 85 210 105 193 99 201 83 + +square +false +0 +Rectangle -7500403 true true 30 30 270 270 + +square 2 +false +0 +Rectangle -7500403 true true 30 30 270 270 +Rectangle -16777216 true false 60 60 240 240 + +star +false +0 +Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108 + +target +false +0 +Circle -7500403 true true 0 0 300 +Circle -16777216 true false 30 30 240 +Circle -7500403 true true 60 60 180 +Circle -16777216 true false 90 90 120 +Circle -7500403 true true 120 120 60 + +tree +false +0 +Circle -7500403 true true 118 3 94 +Rectangle -6459832 true false 120 195 180 300 +Circle -7500403 true true 65 21 108 +Circle -7500403 true true 116 41 127 +Circle -7500403 true true 45 90 120 +Circle -7500403 true true 104 74 152 + +triangle +false +0 +Polygon -7500403 true true 150 30 15 255 285 255 + +triangle 2 +false +0 +Polygon -7500403 true true 150 30 15 255 285 255 +Polygon -16777216 true false 151 99 225 223 75 224 + +truck +false +0 +Rectangle -7500403 true true 4 45 195 187 +Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194 +Rectangle -1 true false 195 60 195 105 +Polygon -16777216 true false 238 112 252 141 219 141 218 112 +Circle -16777216 true false 234 174 42 +Rectangle -7500403 true true 181 185 214 194 +Circle -16777216 true false 144 174 42 +Circle -16777216 true false 24 174 42 +Circle -7500403 false true 24 174 42 +Circle -7500403 false true 144 174 42 +Circle -7500403 false true 234 174 42 + +turtle +true +0 +Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210 +Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105 +Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105 +Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87 +Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210 +Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99 + +wheel +false +0 +Circle -7500403 true true 3 3 294 +Circle -16777216 true false 30 30 240 +Line -7500403 true 150 285 150 15 +Line -7500403 true 15 150 285 150 +Circle -7500403 true true 120 120 60 +Line -7500403 true 216 40 79 269 +Line -7500403 true 40 84 269 221 +Line -7500403 true 40 216 269 79 +Line -7500403 true 84 40 221 269 + +wolf +false +0 +Polygon -16777216 true false 253 133 245 131 245 133 +Polygon -7500403 true true 2 194 13 197 30 191 38 193 38 205 20 226 20 257 27 265 38 266 40 260 31 253 31 230 60 206 68 198 75 209 66 228 65 243 82 261 84 268 100 267 103 261 77 239 79 231 100 207 98 196 119 201 143 202 160 195 166 210 172 213 173 238 167 251 160 248 154 265 169 264 178 247 186 240 198 260 200 271 217 271 219 262 207 258 195 230 192 198 210 184 227 164 242 144 259 145 284 151 277 141 293 140 299 134 297 127 273 119 270 105 +Polygon -7500403 true true -1 195 14 180 36 166 40 153 53 140 82 131 134 133 159 126 188 115 227 108 236 102 238 98 268 86 269 92 281 87 269 103 269 113 + +x +false +0 +Polygon -7500403 true true 270 75 225 30 30 225 75 270 +Polygon -7500403 true true 30 75 75 30 270 225 225 270 +@#$#@#$#@ +NetLogo 6.4.0 +@#$#@#$#@ +@#$#@#$#@ +@#$#@#$#@ +@#$#@#$#@ +@#$#@#$#@ +default +0.0 +-0.2 0 0.0 1.0 +0.0 1 1.0 0.0 +0.2 0 0.0 1.0 +link direction +true +0 +Line -7500403 true 150 150 90 180 +Line -7500403 true 150 150 210 180 +@#$#@#$#@ +0 +@#$#@#$#@ From d8799083ad18c8101a42eb836ba4fd89e1aad678 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Fri, 15 Nov 2024 22:33:49 +0100 Subject: [PATCH 51/69] Delete 2024-Jarigsma-001/netlogo_implementation/delete --- 2024-Jarigsma-001/netlogo_implementation/delete | 1 - 1 file changed, 1 deletion(-) delete mode 100644 2024-Jarigsma-001/netlogo_implementation/delete diff --git a/2024-Jarigsma-001/netlogo_implementation/delete b/2024-Jarigsma-001/netlogo_implementation/delete deleted file mode 100644 index 8b13789..0000000 --- a/2024-Jarigsma-001/netlogo_implementation/delete +++ /dev/null @@ -1 +0,0 @@ - From 50b4613d175d8a3e7e21ee3ce611f15b91d08d8e Mon Sep 17 00:00:00 2001 From: AmberHam Date: Sat, 23 Nov 2024 19:29:10 +0100 Subject: [PATCH 52/69] Update NASSA.yml --- 2024-Jarigsma-001/NASSA.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2024-Jarigsma-001/NASSA.yml b/2024-Jarigsma-001/NASSA.yml index 5ec55eb..fb68dd7 100644 --- a/2024-Jarigsma-001/NASSA.yml +++ b/2024-Jarigsma-001/NASSA.yml @@ -17,7 +17,7 @@ domainKeywords: regions: - global periods: - - contemporary + subjects: - social networks modellingKeywords: From 98a66632614e3836126cc5a23f3ad078c2a2372c Mon Sep 17 00:00:00 2001 From: AmberHam Date: Sat, 23 Nov 2024 19:36:44 +0100 Subject: [PATCH 53/69] Update README.md --- 2024-Jarigsma-001/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2024-Jarigsma-001/README.md b/2024-Jarigsma-001/README.md index 67b2ef0..721772a 100644 --- a/2024-Jarigsma-001/README.md +++ b/2024-Jarigsma-001/README.md @@ -1,7 +1,7 @@ # Preferential Attachment Network *by Amber Esha Jarigsma* -This (sub)model implements a preferential attachment algorithm to generate networks where nodes (agents) are connected based on their existing number of links, simulating the "rich-get-richer" effect. It uses a lottery-style partner selection method to form links between nodes, favoring those with more existing connections. This structure can model social networks, citation graphs, or other real-world systems where growth follows a preferential attachment pattern. +This (sub)model implements a preferential attachment algorithm to generate networks where nodes (agents) are connected based on their existing number of links, simulating the "rich-get-richer" effect. It uses a lottery-style partner selection method to form links between nodes, favoring those with more existing connections. This structure can model social networks, trade networks in ancient societies, settlement hierarchies, or other real-world systems where growth follows a preferential attachment pattern. ## License **MIT** From 673c39bf0b519bbbab76a411c3f809737c302789 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Sat, 23 Nov 2024 20:01:00 +0100 Subject: [PATCH 54/69] module submission: 2024-Jarigsma-001 --- .../Preferential Attachment Network.nlogo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo b/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo index 0f53f4a..1c3ba4c 100644 --- a/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo +++ b/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo @@ -1,4 +1,4 @@ -breed [nodes node] +breed [nodes node] nodes-own [degree new-node] ; the degree attribute will store the number of links each node has, while the new-node attribute will only be 'true' if the node is new ;; From d2ec83f2dc6093f9dbdaf8d1c5a79a6d656adf4c Mon Sep 17 00:00:00 2001 From: AmberHam Date: Wed, 27 Nov 2024 16:13:17 +0100 Subject: [PATCH 55/69] Update 2024-Jarigsma-001/NASSA.yml Co-authored-by: Andreas Angourakis --- 2024-Jarigsma-001/NASSA.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2024-Jarigsma-001/NASSA.yml b/2024-Jarigsma-001/NASSA.yml index fb68dd7..b86004b 100644 --- a/2024-Jarigsma-001/NASSA.yml +++ b/2024-Jarigsma-001/NASSA.yml @@ -1,5 +1,5 @@ id: 2024-Jarigsma-001 -nassaVersion: 0.5.0 +nassaVersion: 0.5.1 moduleType: Algorithm title: Preferential Attachment Network moduleVersion: 1.0.0 From 0e69719ad436637c1905c07a40b2a43bd535ab08 Mon Sep 17 00:00:00 2001 From: Andreas Angourakis Date: Thu, 28 Nov 2024 12:44:00 +0100 Subject: [PATCH 56/69] Update NASSA.yml Non-compulsory fields that are empty should be deleted. Alternatively, to keep them as placeholders, they could have a null value with `null` or `~`. Making a note of this in the guide. --- 2024-Jarigsma-001/NASSA.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/2024-Jarigsma-001/NASSA.yml b/2024-Jarigsma-001/NASSA.yml index b86004b..ef1109d 100644 --- a/2024-Jarigsma-001/NASSA.yml +++ b/2024-Jarigsma-001/NASSA.yml @@ -10,14 +10,11 @@ contributors: orcid: 0009-0008-9842-7913 description: > This NetLogo algorithm simulates network formation using preferential attachment. New nodes are more likely to connect to existing nodes with higher degrees, reflecting a "lottery" system where popular nodes attract more links. -relatedModules: references: moduleReferences: [ Wilensky-2005 ] domainKeywords: regions: - global - periods: - subjects: - social networks modellingKeywords: From 4837b55033b0bab3159bd2aae40d23bc268430b2 Mon Sep 17 00:00:00 2001 From: Andreas Angourakis Date: Thu, 28 Nov 2024 12:47:15 +0100 Subject: [PATCH 57/69] Update NASSA.yml correcting indenting of line 12 --- 2024-Jarigsma-001/NASSA.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2024-Jarigsma-001/NASSA.yml b/2024-Jarigsma-001/NASSA.yml index ef1109d..8b9da30 100644 --- a/2024-Jarigsma-001/NASSA.yml +++ b/2024-Jarigsma-001/NASSA.yml @@ -9,7 +9,7 @@ contributors: email: a.e.jarigsma@student.vu.nl orcid: 0009-0008-9842-7913 description: > -This NetLogo algorithm simulates network formation using preferential attachment. New nodes are more likely to connect to existing nodes with higher degrees, reflecting a "lottery" system where popular nodes attract more links. + This NetLogo algorithm simulates network formation using preferential attachment. New nodes are more likely to connect to existing nodes with higher degrees, reflecting a "lottery" system where popular nodes attract more links. references: moduleReferences: [ Wilensky-2005 ] domainKeywords: From 3c092bad268952216f38071ac2ffa41609188fc7 Mon Sep 17 00:00:00 2001 From: Andreas Angourakis Date: Thu, 28 Nov 2024 12:49:52 +0100 Subject: [PATCH 58/69] Update NASSA.yml adding compulsory field `lastUpdateDate` --- 2024-Jarigsma-001/NASSA.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/2024-Jarigsma-001/NASSA.yml b/2024-Jarigsma-001/NASSA.yml index 8b9da30..02f78b8 100644 --- a/2024-Jarigsma-001/NASSA.yml +++ b/2024-Jarigsma-001/NASSA.yml @@ -8,6 +8,7 @@ contributors: roles: [ "Copyright Holder", "Author", "Creator"] email: a.e.jarigsma@student.vu.nl orcid: 0009-0008-9842-7913 +lastUpdateDate: 2024-11-28 description: > This NetLogo algorithm simulates network formation using preferential attachment. New nodes are more likely to connect to existing nodes with higher degrees, reflecting a "lottery" system where popular nodes attract more links. references: From a01c0ddf0f21c56d38d095dfc7851510334d3be7 Mon Sep 17 00:00:00 2001 From: Andreas Angourakis Date: Thu, 28 Nov 2024 12:54:37 +0100 Subject: [PATCH 59/69] Update NASSA.yml docsDir and other directory or file references present in template should be deleted if not present in the current module. Making note of this in guide. --- 2024-Jarigsma-001/NASSA.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/2024-Jarigsma-001/NASSA.yml b/2024-Jarigsma-001/NASSA.yml index 02f78b8..f6ae34f 100644 --- a/2024-Jarigsma-001/NASSA.yml +++ b/2024-Jarigsma-001/NASSA.yml @@ -29,5 +29,4 @@ implementations: - language: NetLogo softwareDependencies: - NetLogo >= v6.4.0 -docsDir: documentation/ license: MIT From 566f1f6292360da129866186099b085b2f04e535 Mon Sep 17 00:00:00 2001 From: Andreas Angourakis Date: Thu, 28 Nov 2024 12:57:28 +0100 Subject: [PATCH 60/69] Update references.bib adding missing comas separating BibTex fields --- 2024-Jarigsma-001/references.bib | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2024-Jarigsma-001/references.bib b/2024-Jarigsma-001/references.bib index 6415565..4354945 100644 --- a/2024-Jarigsma-001/references.bib +++ b/2024-Jarigsma-001/references.bib @@ -1,7 +1,7 @@ @misc{Wilensky-2005, title = {NetLogo Preferential Attachment model}, author = {Wilensky, U.}, -year = {2005} -note = {Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL} +year = {2005}, +note = {Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL}, url = {https://ccl.northwestern.edu/netlogo/models/PreferentialAttachment} } From 64dcb839e52107b794657fafbba050e9f359ed00 Mon Sep 17 00:00:00 2001 From: Andreas Angourakis Date: Thu, 28 Nov 2024 13:28:52 +0100 Subject: [PATCH 61/69] Update CHANGELOG.md start the module with v1.0.0 and mention it in CHANGELOG --- 2024-Jarigsma-001/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/2024-Jarigsma-001/CHANGELOG.md b/2024-Jarigsma-001/CHANGELOG.md index 8b13789..99be325 100644 --- a/2024-Jarigsma-001/CHANGELOG.md +++ b/2024-Jarigsma-001/CHANGELOG.md @@ -1 +1,2 @@ - +## 1.0.0 +- Creation of the module. From 40163b2cf141e99a0c2bc65bb81b3788d019c4ba Mon Sep 17 00:00:00 2001 From: Andreas Angourakis Date: Thu, 28 Nov 2024 14:51:05 +0100 Subject: [PATCH 62/69] Update Preferential Attachment Network.nlogo Recommendations: - Code style: - adding a few extra lines of comment for pedagogic purposes - `create-edge` -> `create-preferential-attachment`, to be more specific and consistent with the algorithm terminology. - `find-preferential-partner` -> `preferential-partner,` because while verbs are good for procedures, this reporter procedure will return a partner directly, instead, for example, of setting it as a variable internally. - Refactoring: - For improving re-usability, delimiting the preferential attachment algorithm as a node-level procedure `create-preferential-attachment` (partner finding + creating link + increasing degree) instead of the global-level procedure `create-edge`. - For optimising, skipping unnecessary separation of `make-node` and `create-edge` (and the intermediary variable `new-node`) by using `create-preferential-attachment` directly inside `create-node 1 [ ... ]` (line 34) and using `other node` in `` (line 60) to ensure that the new node is not accounted as a potential partner of itself. --- .../Preferential Attachment Network.nlogo | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo b/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo index 1c3ba4c..05a051d 100644 --- a/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo +++ b/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo @@ -1,5 +1,5 @@ breed [nodes node] -nodes-own [degree new-node] ; the degree attribute will store the number of links each node has, while the new-node attribute will only be 'true' if the node is new +nodes-own [degree] ; the degree attribute will store the number of links each node has, while the new-node attribute will only be 'true' if the node is new ;; ;; SETUP PROCEDURE @@ -22,7 +22,6 @@ end ;; to go make-node - create-edge layout tick end @@ -31,19 +30,18 @@ to make-node create-nodes 1 [ set degree 0 set color red - set new-node true + + create-preferential-attachment ] end -to create-edge - let added-node nodes with [new-node = true] - - let partner find-preferential-partner - ask added-node [ - create-link-with partner - set degree degree + 1 - set new-node false - ] +;; Add an edge using the preferential attachment mechanism +to create-preferential-attachment + let partner preferential-partner + + ;; Create the link and update degrees + create-link-with partner + set degree degree + 1 ask partner [ set degree degree + 1 @@ -55,19 +53,18 @@ end ;; Nodes are entered into a "lottery" where the number of 'connections' each node has ;; is proportional to its number of links. This creates a mechanism where nodes ;; with more links have a higher probability of being randomly selected. -to-report find-preferential-partner +to-report preferential-partner let connections [] - - ask nodes [ - if new-node != true [ + + ;; Build a weighted list based on degree + ask other nodes [ let connections-count degree + 1 repeat connections-count [ set connections lput self connections ] ] - ] - - report one-of connections + + report one-of connections ;; return one randomly chosen partner end ;; From 72f09653a8dc9c043658784fef20582efac500a7 Mon Sep 17 00:00:00 2001 From: Andreas Angourakis Date: Thu, 28 Nov 2024 15:00:44 +0100 Subject: [PATCH 63/69] Update Preferential Attachment Network.nlogo `number-of-nodes` -> `initial-number-nodes` --- .../Preferential Attachment Network.nlogo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo b/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo index 05a051d..94c334c 100644 --- a/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo +++ b/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo @@ -8,7 +8,7 @@ to setup clear-all set-default-shape nodes "circle" - create-nodes number-of-nodes [ + create-nodes initial-number-nodes [ setxy random-xcor random-ycor set color red set degree 0 @@ -161,8 +161,8 @@ SLIDER 119 192 152 -number-of-nodes -number-of-nodes +initial-number-nodes +initial-number-nodes 1 100 4.0 From d4be3231819867b2fb30148b410ebd6cee71236e Mon Sep 17 00:00:00 2001 From: AmberHam Date: Sat, 30 Nov 2024 11:26:24 +0100 Subject: [PATCH 64/69] Update 2024-Jarigsma-001/README.md Co-authored-by: Andreas Angourakis --- 2024-Jarigsma-001/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2024-Jarigsma-001/README.md b/2024-Jarigsma-001/README.md index 721772a..123c945 100644 --- a/2024-Jarigsma-001/README.md +++ b/2024-Jarigsma-001/README.md @@ -1,7 +1,7 @@ # Preferential Attachment Network *by Amber Esha Jarigsma* -This (sub)model implements a preferential attachment algorithm to generate networks where nodes (agents) are connected based on their existing number of links, simulating the "rich-get-richer" effect. It uses a lottery-style partner selection method to form links between nodes, favoring those with more existing connections. This structure can model social networks, trade networks in ancient societies, settlement hierarchies, or other real-world systems where growth follows a preferential attachment pattern. +This algorithm is a version of preferential attachment algorithm, generating networks where nodes (agents) are connected based on their existing number of links, simulating the "rich-get-richer" effect. It uses a lottery-style partner selection method to form links between nodes, favoring those with more existing connections. This structure can model social networks, trade networks in ancient societies, settlement hierarchies, or other real-world systems where growth follows a preferential attachment pattern. ## License **MIT** From c905a862d7fc2320a2e5756a485a9e4ca5f5bcd9 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Sat, 30 Nov 2024 11:34:48 +0100 Subject: [PATCH 65/69] Update NASSA.yml --- 2024-Jarigsma-001/NASSA.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/2024-Jarigsma-001/NASSA.yml b/2024-Jarigsma-001/NASSA.yml index f6ae34f..50048c7 100644 --- a/2024-Jarigsma-001/NASSA.yml +++ b/2024-Jarigsma-001/NASSA.yml @@ -13,6 +13,15 @@ description: > This NetLogo algorithm simulates network formation using preferential attachment. New nodes are more likely to connect to existing nodes with higher degrees, reflecting a "lottery" system where popular nodes attract more links. references: moduleReferences: [ Wilensky-2005 ] +inputs: + - name: initial-number-nodes + type: integer + unit: nodes + description: the number of unconnected nodes existing before preferential attachment is applied. +outputs: + - name: network + type: object (agent and link sets) + description: nodes (turtles, breed nodes) and edges (links) between nodes, formed with iterations of preferential attachment. domainKeywords: regions: - global From b6b2258a5e49097760ce01715961fbfc49449397 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Sun, 1 Dec 2024 15:12:47 +0100 Subject: [PATCH 66/69] Update Preferential Attachment Network.nlogo --- .../Preferential Attachment Network.nlogo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo b/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo index 94c334c..1309363 100644 --- a/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo +++ b/2024-Jarigsma-001/netlogo_implementation/Preferential Attachment Network.nlogo @@ -1,5 +1,5 @@ breed [nodes node] -nodes-own [degree] ; the degree attribute will store the number of links each node has, while the new-node attribute will only be 'true' if the node is new +nodes-own [degree] ; the degree attribute will store the number of links each node has ;; ;; SETUP PROCEDURE From 36f784e33d274179ca73bb54e92365e8b95c28e0 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Sun, 1 Dec 2024 15:58:43 +0100 Subject: [PATCH 67/69] Update README.md --- 2024-Jarigsma-001/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/2024-Jarigsma-001/README.md b/2024-Jarigsma-001/README.md index 123c945..da90745 100644 --- a/2024-Jarigsma-001/README.md +++ b/2024-Jarigsma-001/README.md @@ -7,8 +7,19 @@ This algorithm is a version of preferential attachment algorithm, generating net **MIT** ## References +For an alternative approach to implementing a preferential attachment network, see: Wilensky, U. (2005). NetLogo Preferential Attachment model. http://ccl.northwestern.edu/netlogo/models/PreferentialAttachment. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. +In this model, partner selection is determined through the selection of a random link, with one of the two nodes at either end of the link serving as the new partner. This method simplifies the implementation by leveraging existing network properties, eliminating the need to explicitly calculate or store node degrees. In contrast, the implementation described here generates a weighted list of nodes based on their degrees, from which a partner is selected. While Wilensky’s approach reduces computational complexity, it sacrifices some of the flexibility and reusability offered by this more modular design, which separates key functions and explicitly tracks node attributes. + +Additionally, the nw extension in NetLogo provides a built-in procedure, nw:generate-preferential-attachment, for generating scale-free networks based on the Barabási–Albert algorithm. However, as this is part of an extension and not written in NetLogo's native language, it may be less transparent and customisable compared to explicit implementations. + +This implementation draws inspiration from Wilensky (2005) and the foundational work it cites. For further background on preferential attachment and scale-free networks, see: + +Albert-László Barabási. Linked: The New Science of Networks. Perseus Publishing, Cambridge, Massachusetts, pages 79–92. + +Albert-László Barabási & Reka Albert. "Emergence of Scaling in Random Networks." Science, Vol. 286, Issue 5439, 15 October 1999, pages 509–512. + ## Further information This model is an algorithm implemented in NetLogo. Users can choose how many (unattached) nodes to begin the algorithm with. From bce4f6495298c2c08dc66fba69fe7e24ac30f691 Mon Sep 17 00:00:00 2001 From: AmberHam Date: Sun, 1 Dec 2024 15:59:12 +0100 Subject: [PATCH 68/69] Update README.md From b8fb5ed0ead13feec35f1f022030e99c7d39dc61 Mon Sep 17 00:00:00 2001 From: Andreas Angourakis Date: Mon, 2 Dec 2024 18:44:40 +0100 Subject: [PATCH 69/69] Update references.bib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding Barabási's references to .bib file --- 2024-Jarigsma-001/references.bib | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/2024-Jarigsma-001/references.bib b/2024-Jarigsma-001/references.bib index 4354945..bb47e28 100644 --- a/2024-Jarigsma-001/references.bib +++ b/2024-Jarigsma-001/references.bib @@ -1,3 +1,28 @@ +@book{barabasi_new_2002, + address = {Cambridge}, + title = {The {New} {Science} of {Networks}}, + language = {en}, + publisher = {Perseus Publishing}, + author = {Barabasi, Albert-Laszlo}, + year = {2002} +} + +@article{barabasi_emergence_1999, + title = {Emergence of {Scaling} in {Random} {Networks}}, + volume = {286}, + url = {https://www.science.org/doi/10.1126/science.286.5439.509}, + doi = {10.1126/science.286.5439.509}, + abstract = {Systems as diverse as genetic networks or the World Wide Web are best described as networks with complex topology. A common property of many large networks is that the vertex connectivities follow a scale-free power-law distribution. This feature was found to be a consequence of two generic mechanisms: (i) networks expand continuously by the addition of new vertices, and (ii) new vertices attach preferentially to sites that are already well connected. A model based on these two ingredients reproduces the observed stationary scale-free distributions, which indicates that the development of large networks is governed by robust self-organizing phenomena that go beyond the particulars of the individual systems.}, + number = {5439}, + urldate = {2024-12-02}, + journal = {Science}, + author = {Barabási, Albert-László and Albert, Réka}, + month = oct, + year = {1999}, + note = {Publisher: American Association for the Advancement of Science}, + pages = {509--512} +} + @misc{Wilensky-2005, title = {NetLogo Preferential Attachment model}, author = {Wilensky, U.},