Saturday 18 October 2008

Tips on setting up Polyworld

I just got Polyworld working on my PC!

Larry Yaeger provides step by step instructions but there are a few things you should keep in mind as you follow Yaeger's instructions. I am writing from the perspective of a Windows user so there are a few extra steps.

Polyworld currently only works on Linux and Mac. I wanted to quickly try out Polyworld so I decided to use VMware and Ubuntu. The following are tips on setting up Ubuntu:


Building Polyworld requires a few packages to be present on your machine. For some reason I could not get internet access with Ubuntu so I had to manually install the packages. I recommend that you use Ubuntu's graphical tools to set up these packages. However, the first time around, I downloaded the source files and didn't even know about Ubuntu's graphical tools.

The following are some tips on installing the "GNU Scientific Library" (gsl), gnuplot and Qt:

  • For the "make install" step use the command "sudo make install" and use "user" for the password.
  • gnuplot 4.2.4 worked.
  • gsl 1.11 worked.
  • Qt 4.3.1 worked. The latest version, 4.4.3 did not work.
  • Building Qt takes a long time.
  • I recommend you use Ubuntu's package installer if you have internet access.

The VMware Ubuntu image did not have the required OpenGL files. of The following are some tips on installing OpenGL:


The following are some tips on setting up Polyworld:

  • Use CVS to get the latest version of the sourc code. Version 1.5.2 is difficult to get working.
  • Make sure you set up the environment variables for Qt before you call "qmake". Qmake is a great program that generates Makefiles for the program "make."
  • For the "make install" step, use "sudo make install". The password is "user".
  • Make a copy of "worldfile_nominal" and call it "worldfile."
  • In "worldfile," reduce "minnumcritters" from 90 to 9.
  • In "worldfile," Reduce "maxnumcritters" from 300 to 30.
  • In "worldfile," Reduce "initnumcritters" from 150 to 15.
  • To run Polyworld use the command, "./Polyworld -geometry 250x250". Thanks go to Strick.

If you need help, Larry Yaeger is very helpful.

I found running Polyworld on Ubuntu through VMware quite slow, even with a smaller number of critters. This could also be due to my university machine not having a graphics card, running Ubuntu through VMware or both. Even so, it has been useful to quickly set up and gain experience with Polyworld.

6 comments:

  1. Thanks for your help! I was so close to running polyworld but couldn't quite get it. After fixing some errors that are in the cvs source*, I compiled the app but it wouldnt run. I didnt see any mention of the worldfile until you mentioned it here. Thanks!

    * I had to do 2 things. First I had to add #include < stdio.h > to every file, which was like 5 or 6 files, that the compiler complained about "sprintf" not being in scope. The second thing I had to do was change the char * declaration to a const char * in /src/tools/pwtxt/main.cp line 180.

    ReplyDelete
  2. Hi Blaine!

    You're most welcomed. Good luck with your experiments with Polyworld :)

    ReplyDelete
  3. Binh,
    I'm curious as to what kind of cpu usage you were seeing with polyworld? I have a dual core phenom II but I am only pegging like 50% of each cpu. When I decrease the critter counts by 10 (30/9/15) the cpu usage goes higher. I'm wondering if this is a GPU bottleneck - ie with more critters there is more GPU used for rendering so the CPU has less work but with less critters the CPU has more work. I'm not sure about this...

    when you run polyworld does your CPU max out?

    Thanks!
    Blaine

    ReplyDelete
  4. Hi Blaine,

    There is a graphics bottleneck because polyworld renders in non-immediate mode.

    Once I changed to immediate mode, the bottleneck became a processing bottleneck due to the number and size of agent neural networks.

    I usually run with about 250 agents and that makes my CPU work at full capacity.

    ReplyDelete
  5. When I run in polyworld folder, ./Polyworld It says: no such file or directory. Im in debian, i had no problems in build and make. Help.

    ReplyDelete
  6. Hi Daniel, I'll take a look at the problem an get back to you as soon as possible.

    ReplyDelete