|
From: | Steve Railsback |
Subject: | Re: [Swarm-Modelling] status_access_violation question |
Date: | Mon, 06 Oct 2003 17:24:54 -0700 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 |
address@hidden wrote:
Hello, I am currently in the midst of coding my first involved swarm model, which I am going to use in my dissertation research on early hominid food sharing. I've just run across a problem that I'm unable to solve with my limited experience. After I compile the executable (share.exe) and run it at the command prompt, the simulation runs successfully for anywhere from 50 to 700 time steps. However, though it runs as it should, the model always bails with the following error message at some (seemingly random) point: 0 [main] share 1000 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
Yeah, these kind of errors are not so clear to find. In general, it means you are trying to use memory that isn't allocated--trying to store something in an array at a location bigger than the array size, trying to access a location in a Grid2D object that's beyond its boundaries, etc. When it happens after a model has run for a while, perhaps one of your agents is wandering off the edge of the world, etc.
You could try putting print statements wherever you use an array or space object, to print out the location you're trying to access before you actually do access it. Check carefully for logic errors that could cause the code to try to read a variable or array location that doesn't exist.
Steve R. -- Lang Railsback & Assoc. 250 California Ave. Arcata CA USA 95521 707-822-0453; fax 822-1868
[Prev in Thread] | Current Thread | [Next in Thread] |