[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
putValue$atX$Y conundrum
From: |
Tee Toth-Fejel |
Subject: |
putValue$atX$Y conundrum |
Date: |
Thu, 11 Jan 2001 12:42:52 -0500 |
What's the story with Diffuse2dImpl.putValue$atX$Y?
I included two printout statements in the java heatbugs demo, and it shows
that the putValue$atX$Y doesn't seem to be doing it's job.
Here are the two output statements in the method I changed:
public Object addHeat$X$Y (int moreHeat, int x, int y) {
int heatHere;
heatHere = getValueAtX$Y (x, y); // read the heat
if (moreHeat <= maxHeat - heatHere) // would add be too big?
heatHere = heatHere + moreHeat; // no, just add
else
heatHere = maxHeat; // yes, use max
System.out.println("HeatSpace.addHeat: Put local heat="+heatHere+"
x="+x+
" this="+this);
putValue$atX$Y (heatHere, x, y); // set the heat
System.out.println("HeatSpace.addHeat: check at x="+x+" y"+y+
" is heat=" + getValueAtX$Y(x, y));
return this;
}
Here is the result:
C:\JHEATB~1.1>java StartHeatbugs | tee
HeatSpace.addHeat: Put local heat=4081 x=1 address@hidden
HeatSpace.addHeat: check at x=1 y1 is heat=0
HeatSpace.addHeat: Put local heat=6595 x=65 address@hidden
HeatSpace.addHeat: check at x=65 y60 is heat=0
HeatSpace.addHeat: Put local heat=8720 x=40 address@hidden
HeatSpace.addHeat: check at x=40 y39 is heat=0
HeatSpace.addHeat: Put local heat=4108 x=7 address@hidden
HeatSpace.addHeat: check at x=7 y30 is heat=0
HeatSpace.addHeat: Put local heat=6036 x=64 address@hidden
HeatSpace.addHeat: check at x=64 y45 is heat=0
HeatSpace.addHeat: Put local heat=6715 x=4 address@hidden
HeatSpace.addHeat: check at x=4 y64 is heat=0
.......
HeatSpace.addHeat: Put local heat=18997 x=41 address@hidden
HeatSpace.addHeat: check at x=41 y41 is heat=14886
HeatSpace.addHeat: Put local heat=16468 x=43 address@hidden
HeatSpace.addHeat: check at x=43 y44 is heat=9965
HeatSpace.addHeat: Put local heat=24970 x=77 address@hidden
HeatSpace.addHeat: check at x=77 y66 is heat=17909
HeatSpace.addHeat: Put local heat=12613 x=68 address@hidden
HeatSpace.addHeat: check at x=68 y69 is heat=5334
HeatSpace.addHeat: Put local heat=22113 x=25 address@hidden
HeatSpace.addHeat: check at x=25 y9 is heat=13748
HeatSpace.addHeat: Put local heat=12361 x=65 address@hidden
HeatSpace.addHeat: check at x=65 y62 is heat=7658
HeatSpace.addHeat: Put local heat=23283 x=22 address@hidden
HeatSpace.addHeat: check at x=22 y76 is heat=15176
HeatSpace.addHeat: Put local heat=18036 x=22 address@hidden
HeatSpace.addHeat: check at x=22 y2 is heat=9419
HeatSpace.addHeat: Put local heat=17099 x=59 address@hidden
HeatSpace.addHeat: check at x=59 y25 is heat=9648
HeatSpace.addHeat: Put local heat=13284 x=3 address@hidden
HeatSpace.addHeat: check at x=3 y49 is heat=6208
What is going on here?
When I run the jheatbugs demo, the values and colors change, so apparently
they are changing *somehow*, but not apparently from putValue$atX$Y. Why
doesn't the value change when I do the put? The documentation for
Diffuse2dImpl says:
"public Object putValue$atX$Y(int v,
int x,
int y)
Put the given integer to (x,y) overwriting whatever was there."
Thanks for any help that you can give.
Tihamer "Tee" Toth-Fejel Member of Technical Staff
(734) 623-2544 address@hidden http://www.erim.org/
Center for Electronic Commerce, Environmental Research Institute of Michigan
==================================
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.
- putValue$atX$Y conundrum,
Tee Toth-Fejel <=