agents scheduling issue

73 views
Skip to first unread message

naab...@gmail.com

unread,
Oct 7, 2020, 4:09:03 PM10/7/20
to ProjectMesa
Hi,
Is there a way to let agents of one type waiting for an agent of another type to be activated?
Thanks


WouterD

unread,
Oct 8, 2020, 6:58:39 AM10/8/20
to ProjectMesa
I see that I didn't reply in groups previously.

In your step function (in model) you can activate different agent types by self.schedule.step_type('agent name').

def step(self):
       self.schedule.step_type(Agent_type1)
       self.schedule.step_type(Agent_type2)
       ...
I hope this helps :)



nada gh

unread,
Oct 9, 2020, 7:56:17 AM10/9/20
to WouterD, ProjectMesa
Thanks WouterD,
I got this message "RandomActivation' object has no attribute 'step_type'"

--
Project repos: github.com/projectmesa
---
You received this message because you are subscribed to a topic in the Google Groups "ProjectMesa" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/projectmesa/ECnZCulUNoE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to projectmesa...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectmesa/523198e3-7194-4635-8797-a30019eca215n%40googlegroups.com.

WouterD

unread,
Oct 9, 2020, 8:05:56 AM10/9/20
to ProjectMesa
Aaah yes, it has to be imported.

from schedule import RandomActivationByType

and  when you initialize your model, in __init__:
self.schedule = RandomActivationByType(self)

Hope it works now :p
Op vrijdag 9 oktober 2020 om 13:56:17 UTC+2 schreef naab...@gmail.com:

nada gh

unread,
Oct 9, 2020, 8:54:42 AM10/9/20
to WouterD, ProjectMesa
Thanks. However, I can't find RandomActivationByType in the time.py module!

You received this message because you are subscribed to the Google Groups "ProjectMesa" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectmesa...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectmesa/a5c5cd4a-c869-41ad-aa1d-d21aaa87f73cn%40googlegroups.com.

WouterD

unread,
Oct 9, 2020, 9:03:48 AM10/9/20
to ProjectMesa
I took it from the wolf sheep model I think. There it is called RandomActivationByBreed :)

Op vrijdag 9 oktober 2020 om 14:54:42 UTC+2 schreef naab...@gmail.com:
Reply all
Reply to author
Forward
0 new messages