1 /*
2  *  cConstSchedule.h
3  *  Avida
4  *
5  *  Called "const_schedule.hh" prior to 12/2/05.
6  *  Copyright 1999-2011 Michigan State University. All rights reserved.
7  *  Copyright 1993-2003 California Institute of Technology.
8  *
9  *
10  *  This file is part of Avida.
11  *
12  *  Avida is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
13  *  as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
14  *
15  *  Avida is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
17  *
18  *  You should have received a copy of the GNU Lesser General Public License along with Avida.
19  *  If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef cConstSchedule_h
24 #define cConstSchedule_h
25 
26 #ifndef cSchedule_h
27 #include "cSchedule.h"
28 #endif
29 #ifndef tArray_h
30 #include "tArray.h"
31 #endif
32 
33 class cMerit;
34 
35 /**
36  * This class rotates between all items to schedule, giving each equal time.
37  **/
38 class cConstSchedule : public cSchedule
39 {
40 private:
41   int last_id;
42   tArray<bool> is_active;
43 
44   cConstSchedule(); // @not_implemented
45   cConstSchedule(const cConstSchedule&); // @not_implemented
46   cConstSchedule& operator=(const cConstSchedule&); // @not_implemented
47 
48 public:
cConstSchedule(int _item_count)49   cConstSchedule(int _item_count)
50     : cSchedule(_item_count), last_id(0), is_active(_item_count)
51   {
52     is_active.SetAll(false);
53   }
~cConstSchedule()54   ~cConstSchedule() { ; }
55 
56   bool OK();
57 
58   virtual void Adjust(int item_id, const cMerit& merit, int deme_id = 0);
59 
60   int GetNextID();
61 };
62 
63 
64 #endif
65