Skip to content

Commit

Permalink
Reporter for research-time added
Browse files Browse the repository at this point in the history
* Our runs are supposed to end at the time when scientists finally converge, even though they might practically last longer. A snapshot of the research-time the scientists spent investigating each theory must therefore be stored at the point when researchers converge.
* This snapshot of research-time is stored via the convergence-reporters together with- and in the same way as- other variables which are recorded at the point of convergence
* The default BehaviorSpace experiment then uses this reporter to record the research time for each theory
* Documentation for the two new globals has been added
  • Loading branch information
daimpi committed Oct 26, 2018
1 parent be1c77e commit 645b6db
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,20 @@ When the network is a de facto complete network, scientists might be able to uti

If the `exit-condition` reporter is evaluated the variable will be set to `true` in case the the exit-condition is met, `false` otherwise. Positive evaluation of the exit-condition marks the end of a run.

#### g-myscientists

* format: list
* example: [3 7]

Reflects how many scientist are currently researching each theory: the first entry in the list is for theory one the 2nd entry for theory two.

#### g-research-time

* format: list
* example: [350 129]

Records how much each theory has been researched over the course of the run: each round each researcher who pulls from the slot machine for a given theory increases the counter for this theory by one. The first entry in the list is for theory one the 2nd entry for theory two.


### Turtles-own

Expand Down
19 changes: 18 additions & 1 deletion SocNetABM.nlogo
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ end
to init-converge-reporters
set converge-reporters (list [ -> average-belief 0 true]
[ -> average-cum-successes 0 true] [ -> average-confidence true]
[ -> average-signal 0 true])
[ -> average-signal 0 true] [ -> research-time 0 true])
end


Expand Down Expand Up @@ -891,6 +891,21 @@ When the network is a de facto complete network, scientists might be able to uti

If the `exit-condition` reporter is evaluated the variable will be set to `true` in case the the exit-condition is met, `false` otherwise. Positive evaluation of the exit-condition marks the end of a run.

#### g-myscientists

* format: list
* example: [3 7]

Reflects how many scientist are currently researching each theory: the first entry in the list is for theory one the 2nd entry for theory two.

#### g-research-time

* format: list
* example: [350 129]

Records how much each theory has been researched over the course of the run: each round each researcher who pulls from the slot machine for a given theory increases the counter for this theory by one. The first entry in the list is for theory one the 2nd entry for theory two.


### Turtles-own

#### cur-best-th
Expand Down Expand Up @@ -1335,6 +1350,8 @@ NetLogo 6.0.4
<metric>frequency-converged "th2"</metric>
<metric>center-of-convergence "th1"</metric>
<metric>center-of-convergence "th2"</metric>
<metric>research-time "th1" false</metric>
<metric>research-time "th2" false</metric>
<steppedValueSet variable="scientists" first="3" step="1" last="11"/>
<enumeratedValueSet variable="th1-signal">
<value value="0.5"/>
Expand Down
21 changes: 21 additions & 0 deletions protocol.nls
Original file line number Diff line number Diff line change
Expand Up @@ -540,3 +540,24 @@ to compute-popularity
let th-2-scientist scientists - th-1-scientist
set g-myscientists (list th-1-scientist th-2-scientist)
end





; reports the time scientists spent researching each theory before they finally
; converged
; arguments:
; - th# = theory, type: string
; - rec? = recording?, type: boolean
to-report research-time [th# rec?]
let identifier "restime"
ifelse rec? [
report (fput identifier g-research-time)
][
set th# translate-from-string th#
let res-time but-first first filter [curitem ->
first curitem = identifier] converge-reporters-values
report item th# res-time
]
end

0 comments on commit 645b6db

Please sign in to comment.