-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Hi all,
I wonder the rationale behind the decision that an unimplemented primitive in NetLogo Web shall report an error rather than a warning. When I created a model with behavior space support, I was forced to remove all file-related primitives before deploying it in NLW; that means I have to maintain two different versions, even when the file-related primitives will never trigger in NLW.
Hence, it resonates with my previous proposal of a unified API in the devel core meeting - that is, if I want to maintain a single version, I have to use Send-To at this moment. Yet, the send-to extension does not meet my intention to utilize file streaming - when I have to run 10,000s of experiments in behavior space, I cannot achieve what I have done in the following code:
; print-spreadsheet: When running in the behavior space, generate output for it.
; The output is in CSV and pre-processed to feed into Stata.
to print-spreadsheet
file-open "Spreadsheet.csv"
if (not file-exists? "Spreadsheet.csv")
[ file-print mini-csv:to-row [ "1-Testing" "2-Quarantine" "3-Face-Covering" "4-Lockdown" "Serial" "Days" "Population" "Infected" "Detected" "Deceased" "Lockdown-Days" "Average-Workforce" "Average-Mask-Per-Capita" ] ]
let mappings [ "A" "B" "C" "D" "E" ]
file-print mini-csv:to-row (list
((position first do-we-need-more-testing mappings) + 1)
((position first should-we-quarantine-contacts mappings) + 1)
((position first face-covering-is-needed mappings) + 1)
((position first lockdown-is-necessary mappings) + 1)
behaviorspace-run-number (ticks / 1200) original-population accumulated-infected accumulated-detected accumulated-deceased accumulated-lockdown
(accumulated-workforce / (ticks / 1200)) (accumulated-masks / original-population / (ticks / 1200)))
file-close
endThanks!
Best,
John Chen