I have an issue with load-data command. I manage to setup my model, shows up quite nicely. Then I need to load the data before I press "go". It does not work though and I have no idea why. So I already defined my turtles as part of the setup and by the following code, I am trying to give the turtles properties from the csv document, but it says: "Expected a literal value. (line number 1841, character 5) error while turtle 1606 running file-read called by procedure load-data called by button "load-data" " There are exactly 1841 respondents btw. I tried txt instead but no change. I ran out of ideas quite quickly.
Pretty please, does anyone have any idea what I might be doing wrong? I am quite new to this and pretty desperate since I am working completely on my own and my thesis advisor is not responding...
to load-data
file-open "Pokus2.csv"
while [not file-at-end?] [
ask turtles [
set n-turtles file-read
set behaviour file-read
set attitude file-read
set size 1.5]
ask turtles [setxy random-xcor random-ycor]
ask turtles
[if behaviour <= 0.33 [set pcolor red]
if behaviour = 0.34 and behaviour < 0.66 [set pcolor orange]
if behaviour >= 0.67 [set pcolor green]
]
]
file-close
show "file read"
end