Yon J
Yon J

Reputation: 11

Matching list with agentset, or converting list into agentset or vice versa in NetLogo

I have a model of customers and servers interacting; which is a kind of queueing model. But customers have to visit in the specific order.

I put that order with choosers ; which is just a number. and finally made a list with it.

e.g. C1order = ["server 0", "server 1" ...]

It means Customer 1 have to visit server 0 first, server 1 second, and so on.

I set customers to visit first (C1order). and after the first visit, I'll use but-first C1order.

So next time, I could make it visit next server.

and next-server is agentset. So, as C1order is a list, cannot match with agentset("server 0" does not means server 0).

How can I program it?

I've tried so many ways, like, next-server with [ label = "customer 0"] or let new-next-server (list next-server).

But it failed. What can I do? Thank you in advance!

My netlogo version is 6.2.0

Upvotes: 0

Views: 57

Answers (1)

JenB
JenB

Reputation: 17678

the list as you've created it ["server 0".... is a list of character strings. What you want is a list of agents, something like (list server 1 server 2 server 3)

Upvotes: 1

Related Questions