#include #include #include "apstring.h" #include "environ.h" #include "display.h" #include "simulate.h" #include "filemaker.h" #include "systimer.h" int main() { // Create the desired file FileMaker makeEnv("fish.dat", 40, 40, 160, 1440); // 100 x 100, 0 predators, 4 prey cout << "Done filling environment" << endl; // replace filename below with appropriate file (full path if necessary) ifstream input("fish.dat"); Environment env(input); cout << "Done loading environment" << endl; // Display display(100,100); // for graphics display Display display; // for text display apstring s; Simulation sim; int step; int numSteps; display.Show(env); cout << "--- initialized --- " << endl; cout << "How many steps: "; cin >> numSteps; getline(cin,s); SysTimer time; time.start(); for (step = 0; step < numSteps/* && env.GetFishCount() > 0*/; step++) { sim.Step(env); //display.Show(env); //cout << " step " << step << " (press return)"; //getline(cin,s); } time.stop(); display.Show(env); // if (step < numSteps) // cout << "Simulation terminated early. There are no fish left." << endl; cout << "Time: " << time.elapsedTime() << endl; cout << "Hit RETURN to terminate..."; cin.ignore(); return 0; }