Saturday 21 March 2009

more updates

While I wait to have another discussion about my FiS within the application, I moved on to "tune up" parts of the ecosystem itself. While doing so, an architecture problem was uncovered. This problem related to how much vegetation and water could be present within the ecosystem at any one time. While on its own it does not appear to be very problematic, however since it had been continually build ontop of and the fact that several other components of the ecosystem were dependant on this a solution had to be found. The solution I was looking for would allow a limitless number of plants and lakes to be formed, simply creating new instances of the respective classes on the fly as the program ran. Two attemps at solving this earlier on were through the use of the STL - namely lists and maps. Therefore much of the day has been spent tyring to implment these as solutions. However, in the end, a much more straight forward solution was devised.

If the plant life was allowed to become unlimited, then the ecosystem itself may become to overpopulated resulting in the death of everything. Therefore an array of 100 pointers to the vegetation class was created which would remain nulled untill a new plant appears. Since the herbivores will always be eating, there will never be the full 100 plants on screen which means when one dies off completely, it can be remade in a new location, giving the impression of freely growing vegetation.

Some basic tests have been carried out with this approach, a new tree has been grown at the end of each system day. This method itself seems to be working fine, however a slighty annoying bug has developed which results occasionally in 2 plants being created instead off one as well as the positions of the lakes changing when a new tree appears.

With the dissertation, the Methodology section is almost finished, all that needs to be added to it is the end of the FIS section. Once that is done, I will need to go back and include the FIS into the RQ aswell as the literature review section as these were written before the FIS was included into the project.

EDIT:
Fixed the problem of the lakes changing position aswell as the vegetation. As it turns out, one of the positional arrays was not large enough so for some reason the data was then moving into a different array altering the positions of the lakes

No comments: