The short answer is not easily. Two options come to mind, parse the world file with a python/grep/sed/whatever script and use the result in your build process. Or keep on connecting until you dont get a reply on a port and thats how many robots you have.


2009/6/22 <>
Is there a way that I can get the number of robot
instances from the .cfg / .world files automatically?

i.e. I have .cfg and .world files with X robots.  In my C
files I have written functions to create X number of
robots.  But I have to specify the value of X directly in
the C code.  Is there any way I can get this value
automatically from Player / Stage, or the .cfg/.world
files?  I'm trying to automate a batch processing job
where I can run through a loop and alter the number of
robots from a counter, but I need to manually specific the
number of robots at the start of my C program.  I'd like
to be able to get it directly from Stage to avoid



Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!;215844324;13503038;v?
Playerstage-users mailing list

This email is intended for the addressee only and may contain privileged and/or confidential information