This is a report for NetLogo 6.4, running on Macs and PCs.
A colleague and I have written a procedure to output patch information to a CSV file to use in behaviorspace experiments (copied below). This works most of the time. But sometimes, when a new run starts (I assume that runs on parallel processors are patched together at this point), it inserts extra spaces, characters, or newlines. This does not happen every time the run changes but does sometimes.
Here is an example of 2 lines from the CSV output. The first line is correct, the second one is not. behaviorspace-run-number is the last number in each line. The second line switches from run 3 to run 5
-1,-8,10,1,12,14,18,3,
10,-2,-4,10,1,12,19,16,5,
There are extra commas added to both lines and a spurious 10 added to the beginning of the second line. Run 8 ends after the second line and a new run starts.
Here is another example
-1,4,10,5,12,21,14,8
-1,10,10,5,16,17,8,814,15,16,5
No extra commas are added but spurious 14,15,16,5 is added to the end of the 2nd line.
This seems to be serious bug producing incorrect output with parallel processing.
Here is our output code
to save-patches
;; saves the values of all patches to a CSV file for a BehaviorSpace experiment
;; create a file name base on experiment name
let filebase "patches"
let filename (word filebase "_" behaviorspace-experiment-name ".csv")
;; set up output CSV and column headers
ifelse file-exists? filename
[] ;; if the file and headers have already been created, don't do it again
[file-open filename ;; If file does not exist, create it and add column headers
let header ""
set header (word header "pxcor,pycor,tolerance,interaction_dist,p-point,p-limace,p-flake, run-number")
file-print header
file-close]
;; output patch information to CSV file
file-open filename
let p ""
ask patches [set p (word pxcor "," pycor "," tolerance "," interaction-dist "," p-point "," p-limace "," p-flake "," behaviorspace-run-number)
file-print p]
file-close
end