William Li
William Li

Reputation: 23

How can use NetLogo to simulate the outcome of a function

assuming I got a function like Y= 0.5*a+0.23*b+0.52*c+0.3

a is a continuous variable, b and c are categorical variables(like 1 or 0)

I wanna create multiple agents that can hatch the number of Y (round up to an integer) with different b and c

Honestly, I am new to Netlogo and I am not very familiar with coding.

I went through the three tutorials of the user manual, but I still have no clue to do that.

three tutorials of the user manual.

Thank you

Upvotes: 0

Views: 65

Answers (1)

JenB
JenB

Reputation: 17678

This does what you said. But I don't think it's actually what you mean.

to testme
  clear-all
  let a 5
  let b 10
  let c 20
  let Y ceiling (0.5 * a + 0.23 * b + 0.52 * c + 0.3)
  print Y
  create-turtles Y
  [ setxy random-xcor random-ycor
  ]
end

Upvotes: 2

Related Questions