Something like:
agents = []
for i in range( 100 ):
agents.append( MyAgent( '
agent_no_%d...@127.0.0.1' % i, 'secret' ) )
Or is the number needed inside the agent, e.g. as an attribute? If you
don't need the attribute, you can access the name of the agents
through the attribute .name. If you need the attribute, you need to
extend __init__ in your class, e.g.:
class MyAgent( Agent ):
def __init__( self, num, *args, **kwargs ):
Agent.__init__( *args, **kwargs )
self.number = num
Then you can instance agents as:
a = MyAgent( 1, '
age...@127.0.0.1', 'secret' )
Best,
M.
--
Markus Schatten, PhD
Assistant professor and head of Artificial Intelligence Lab
University of Zagreb
Faculty of Organization and Informatics
Pavlinska 2, 42000 Varazdin, Croatia
http://www.foi.hr/nastavnici/schatten.markus/index.html
http://www.researchgate.net/profile/Markus_Schatten1
http://ai.foi.hr
> --
> You received this message because you are subscribed to the Google Groups
> "spade-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
spade-users...@googlegroups.com.
> To post to this group, send email to
spade...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.