Main Page | Recent changes | View source | Page history

Printable version | All content dual-licensed under the GNU FDL and the Creative Commons Share-alike Attribution license. | Privacy policy

Not logged in
Log in | Help
 

User talk:Huangxifa

From SwarmWiki

I'm using Swarm2.1.1 in Windows2000,programme with java. I have two questions:

  • Globals.env.uniformIntRand.getIntegerWithMin$withMax(min,max)

If we use this method to get an integer within min and max,though we cann't predict which value we will get,but it showed that every time you run the application include,it will return the same values.So it is not random,yes?

  • In the "jheatbugs2.1" example,if I want to destroy a Agent(i.e bug) from the heatbuglist,I detect one place to see if it has a bug in it using
"if((world.getObjectAtX$Y(doorX,doorY))!=null)" ,if true,then I do two things:
"heatbugList.remove(world.getObjectAtX$Y(doorX,doorY));" and "world.putObject$atX$Y (null, doorX, doorY);". 

But I find myself wrong,and I don't know why. could you tell me? thanks.

(I'm a Chinese student not very good at English.Please don't mind.)

You should subscribe to the Swarm: Mailing lists and ask your questions there . --Alex 08:11 8 Apr 2004 (EDT)

[Main Page]
Main page
About SwarmWiki
News
Recent changes
Random page
Help

View source
New section
View user page
Page history
What links here
Related changes
User contributions

Special pages