swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Heatbug.java question


From: David Smith
Subject: Re: Heatbug.java question
Date: Thu, 13 Jan 2000 16:36:02 -0700 (MST)


On Thu, 13 Jan 2000, Benedikt Stefansson wrote:

> David Smith wrote:
> 
> > The confusing thing is that findExtremeType$X$Y() is used for something
> > very different from its apparent purpose. Its return type is long. It
> > returns the heat value of the optimum neighbor, but that value falls into
> > the bit bucket because it is never used. I don't see where the function
> > is used anywere else in jheatbugs either.
> 
> What you have stumbled upon is actually a good example of the difference 
> between the object
> oriented mindset and the traditional programming mindset.
...
> 
> Another thing. In this particular case the return value from 
> findExtremeType$X$Y really has no
> purpose, because the method does its job by setting values in the object that 
> it is passed. One
> purpose of the return value might be to flag whether a location was found and 
> set or not, but
> the code does not make use of it if I recall correctly.
> 
I took a hack at converting the findExtremeType method to return a 
HeatCell, then using the returned cell's coordinates. But it crashes 
after 9 steps with a null pointer exception. I don't know why.

David Smith

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]