cday41 / paz-search

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

Bug when running with no residents #76

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Found a little bug for you. When you start a run with no initial residents, it 
stalls as soon as the first animal establishes a home range. My guess is that 
this is happening because the "Resident" folder isn't created if there are no 
initial residents. So the fix would be to create that if it doesn't exist. 
Otherwise the file is trying to move to a directory that doesn't exist.

I have confirmed it with two different sets of input. If you want to try for 
yourself you can use the Ridenour_noresidents.xml. Within that xml you probably 
want to change the release map from Ridenour_setupresidents to 
Ridenour_setupresidents2 since that lowers the number of dispersers from 30-ish 
to 4. 

PS upon stalling the errorlog.txt shows a whole bunch of these.

2014-04-03 17:14:13,165 DEBUG  - System.IO.DirectoryNotFoundException: Could 
not find a part of the path 
'C:\Users\cohen10\Desktop\RidenourT\Resident\2013Female000000.txt'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
   at System.IO.File.Copy(String sourceFileName, String destFileName)
   at SEARCH.TextFileWriter.RelocateFile() in f:\Search\SEARCH\TextFileWriter.cs:line 86
   at SEARCH.AnimalManager.doTimeStep(HourlyModifier inHM, DailyModifier inDM, DateTime currTime, Boolean DoTextOutPut, Map currSocialMap) in f:\Search\SEARCH\AnimalManager.cs:line 298
2014-04-03 17:14:13,199 DEBUG  - System.Runtime.InteropServices.COMException 
(0x80040202): The operation was attempted on an empty geometry.
   at ESRI.ArcGIS.Geometry.PointClass.get_X()
   at SEARCH.Mover.step(Double stepLength, Double turnAngle, IPoint start, Double heading) in f:\Search\SEARCH\Mover.cs:line 242
   at SEARCH.Mover.move(Double& percentTimeStep, Animal inA) in f:\Search\SEARCH\Mover.cs:line 107

Alex

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

GoogleCodeExporter commented 9 years ago
Problem: When a run has no initial residents on the social map, a "Resident" 
folder is not created. Since dispersers are set to move to that folder upon 
establishing a home this effectively stalls a run.

To recreate:
Use the attached maps and xml (if you put them directly into C: you don't even 
need to change any file pointers). Just launch a run. No extra arguments needed,

You will see:
On or around the 4th timestep the first animal will establish a home. After 
this you will see the next timestep show up in the command prompt (but this 
timestep will never complete). From there the simulation will stall. Sometimes 
another animal will establish during that timestep too but in either case no 
new timesteps will run. However, the logs in C:/AnimalLogs will get tons of 
output written suddenly to them. You will see the errorlog.txt showing tons of 
errors about not finding the resident folder as I copied into the original 
issue description.

If you manually created the Resident folder while the run was going it would 
not stall at this point.

So you just need to create a Resident folder at the beginning of a simulation 
no matter what.

Original comment by acohe...@gmail.com on 27 May 2014 at 6:54

Attachments:

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
Not essential to fix for my or Casey's simulations right now.

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

GoogleCodeExporter commented 9 years ago

Original comment by ran...@mwwb.net on 10 Aug 2014 at 8:13