I'm a first year Computer Science student and I've been given a very simple project to improve a Fox and Rabbit simulation. Its basically a grid of Fox and Rabbit object, foxes eat rabbits, breed and die, rabbits just breed and die. The basic running of the program has been provided to me. Basically it originally just consists of a window with no controls with the view of the field showing all the Fox and Rabbit objects.
Anyway I've coded a simple GUI to control the program and have hit upon a very strange snag. The window is, for some reason, not showing each step as it happens. When I click the button I have coded to run the simulation for 500 steps the program skips straight to the end of the series of steps instead of showing the populations changing over time. I've checked the code for the simulator viewer and there is a repaint method used to redraw the window after each step of the simulation and when i called the system from a main method the window showed the program running through each step. I don't understand how that's any different to me pressing a GUI button to call the same method. Any ideas as to what's going on?
Anyway I've coded a simple GUI to control the program and have hit upon a very strange snag. The window is, for some reason, not showing each step as it happens. When I click the button I have coded to run the simulation for 500 steps the program skips straight to the end of the series of steps instead of showing the populations changing over time. I've checked the code for the simulator viewer and there is a repaint method used to redraw the window after each step of the simulation and when i called the system from a main method the window showed the program running through each step. I don't understand how that's any different to me pressing a GUI button to call the same method. Any ideas as to what's going on?