1 /* 2 * cDefaultRunDriver.h 3 * Avida 4 * 5 * Created by David on 12/11/05. 6 * Copyright 1999-2011 Michigan State University. All rights reserved. 7 * 8 * 9 * This file is part of Avida. 10 * 11 * Avida is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License 12 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 13 * 14 * Avida is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 16 * 17 * You should have received a copy of the GNU Lesser General Public License along with Avida. 18 * If not, see <http://www.gnu.org/licenses/>. 19 * 20 */ 21 22 #ifndef cDefaultRunDriver_h 23 #define cDefaultRunDriver_h 24 25 #include "avida/core/WorldDriver.h" 26 27 class cString; 28 class cWorld; 29 30 using namespace Avida; 31 32 33 class cDefaultRunDriver : public WorldDriver 34 { 35 private: 36 cDefaultRunDriver(); // @not_implemented 37 cDefaultRunDriver(const cDefaultRunDriver&); // @not_implemented 38 cDefaultRunDriver& operator=(const cDefaultRunDriver&); // @not_implemented 39 40 protected: 41 cWorld* m_world; 42 bool m_done; // This is set to true when run should finish. 43 bool m_fastforward; 44 double m_last_generation; 45 int m_generation_same_update_count; 46 int m_generation_update_fastforward_threshold; 47 int m_population_fastforward_threshold; 48 49 public: 50 cDefaultRunDriver(cWorld* world); 51 ~cDefaultRunDriver(); 52 53 void Run(); 54 55 // Driver Actions SignalBreakpoint()56 void SignalBreakpoint() { return; } SetDone()57 void SetDone() { m_done = true; } SetPause()58 void SetPause() { return; } 59 60 void RaiseException(const cString& in_string); 61 void RaiseFatalException(int exit_code, const cString& in_string); 62 63 // Notifications 64 void NotifyComment(const cString& in_string); 65 void NotifyWarning(const cString& in_string); 66 ClearFastForward()67 void ClearFastForward() { m_fastforward = false; m_generation_same_update_count = 0; } 68 void UpdateFastForward (double inGeneration, int population); GetFastForward()69 bool GetFastForward() { return m_fastforward; } 70 71 }; 72 73 #endif 74