cday41 / paz-search

Automatically exported from code.google.com/p/paz-search
0 stars 0 forks source link

Map Switching/Restart Bug #79

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Bob,

I found a bug with map switching on restarts. This bug is similar to one we had 
before where it is messing up when the current year does not match the first 
year of the simulation. So you need to look at how map switching is being 
treated in years beyond the first. I can't pin it down further than that since 
I am not familiar with the log files (map, maps, mapManager.txt).

Here is my setup:
2 year simulation
10 day dispersal (this could be shorter)
3 food maps:
First food map is for the first day only, 0 chance of catching any prey
Second food map is for the second day only, 100% chance of catching prey that 
is not energetically favorable (i.e. disperser still loses energy)
Third food map comes in 48 hours after the start of the simulation and lasts 
the rest of the season, 100% chance of catching prey that is energetically 
favorable (i.e. disperser gains energy)
So look at the 2013Female000000.txt. On the first day of dispersal you can see 
the 0 for ProbFoodCap. Starting at 3/16/2013, 6:00 PM, you can see the 
ProbFoodCap go up to 1, but it still loses energy slowly. At 3/17/2013, 6:00 
PM, you can see the animal start to gain energy as the third map kicks in. That 
map lasts the rest of the season. Note that I restarted at several points and 
everything worked fine.

Now look at the 2014Female000046.txt. This is the same run as before but now in 
the second year. It starts off as normal, 0 for ProbFoodCap. I restarted the 
run at 3/15/2014, 9:00 PM. You can see the ProbFoodCap jump up to 1 (summing 
the partial timesteps), but only for two timesteps -- at 3/15, 11:00 PM it goes 
back down to 0. So it loaded the wrong map for two timesteps. 

I also restarted the run at 3/16/2014, 9:00 PM. That should be the second food 
map where they are still losing energy. But you can see the jump in energy from 
9 to 10 PM, so it loaded the third map instead of the second. But once again 
only for a couple timesteps.

Then look at 3/17/2014, 8:00 PM. Here the ProbFoodCap goes down to 0 for the 
duration of the run. When it should be the third food map where it has a prob 
of 1 and is gaining energy.

--------------------------------------------------------------------------------
-----------

I attached the logs from the point of when I restarted during the second year. 
So you can look at what might be going on.

I also attached the modified food maps I used and the xml. So you can try for 
yourself. Just replace the normal food maps with these ones (keep the old ones 
somewhere safe of course).

Let me know if you have any questions.
Alex

Original issue reported on code.google.com by ran...@mwwb.net on 6 Apr 2014 at 3:37

Attachments:

GoogleCodeExporter commented 9 years ago
*Copied from the email I sent. Attached are maps and xml. Note that these food 
maps are unique for this issue.*

There are 3 food maps that get switched out. The simulation starts at 3/15, 6 
PM. The second map switches in on 3/16, 6 PM. The third at 3/17, 6 PM. The 
first map has a 0 chance for ProbFoodCap. The second has a 1 chance for 
ProbFoodCap but the disperser still loses energy. The third map has a 1 chance 
and the disperser gains energy (mostly, partial timesteps can obscure this). So 
you should be able to pick out what map is loaded pretty easily.

I said in the issue that I thought it was a first year/second year kind of 
thing. Ignore that. After more testing I see the issue in the first year as 
well. It's not a problem with backing up and reloading multiple times but just 
reloading in general. Also I said before it defaulted to the first one but it's 
not always doing that. I am seeing it default to the one before it is supposed 
to be right now.

So basically I am having a killer time trying to figure out what is happening 
here. I wasn't able to replicate the situation I put up on codes. But I did 
find something you should be able to replicate. Basically if you restart after 
the third map should be loaded it reverts to the second map. Hopefully you can 
make some sense of it. This probably isn't the only case where we have a 
problem with map switching but it's what I could find this afternoon.

Here's directions to replicate:
Launch the MapSwitch.xml. Save out at 52 iterations. [This will take maybe 10 
minutes to get there.] Restart from there. This will be a couple timesteps 
after the third map switched in.
You will see the animal gaining energy (loaded the correct map) for 2 timesteps 
after the restart. Then it suddenly reverts to the second for the rest of the 
simulation year (animals losing energy). If you backed up again and reloaded 
within that same year you can repeatedly see this happen.

Original comment by acohe...@gmail.com on 27 May 2014 at 8:12

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by acohe...@gmail.com on 5 Jun 2014 at 7:19