arrays - Trouble Writing to file -
arrays - Trouble Writing to file -
i'm having problem finishing off model. concept questions asked range of turtles. each turtle represents single domain of knowledge , each question should contain multiple random domains of knowledge. turtles id matches 1 of domains in question asked answer. reply rated based on turtle's abilities , expertise.
i hoping have bones of code i'm unable verify until can output excel. can tell me i'm going wrong 'write' instructions? when run model, no file updated or created. , can spot other defects in code?
thanks, john
globals [question answer] turtles-own [abilities expertise expert ] setup clear-all file-open "/users/johnhayes/projectfile.csv" create-turtles 500 set question [] set reply [] reset-ticks end go inquire turtles [initialise-turtles] create-question set reply [] inquire turtles [give-an-answer] evaluate show (list "relevance quality" answer) stop tick if ticks >= 1000 [file-close stop] print-answers end initialise-turtles ; turtle proc 1 set abilities (random 10) ; abilities assigned randomly each turtle. set expertise (random 10) ; expertise assigned randomly each turtle. set expert (false) end create-question set question n-of 500 turtles end give-an-answer ; turtle proc 2 if member? self question [ set expert true ] ; mark expert end evaluate ; turtle proc 3 allow expert-group no-turtles set expert-group (turtles [expert = true]) show (list ([abilities] of expert-group)) show (list ([expertise] of expert-group)) set reply lput (sum [abilities] of expert-group) reply set reply lput (sum[expertise] of expert-group) reply end print-answers file-open "/users/johnhayes/projectfile.csv" file-print reply file-close end
'\' escape character in netlogo have read \ have double up.
file-open "/users/johnhayes/projectfile.csv"
becomes
file-open "\\users\\johnhayes\\projectfile.csv"
then project open or created.
you may want using behaviorspace output found under tools , allows have output various runs of model in 1 .csv click on new , follow instructions.
in case utilize reply reporter.
edit slash dyslexia.
arrays file netlogo
Comments
Post a Comment