forked from Sedictious/lifeLike
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugin.h
30 lines (25 loc) · 818 Bytes
/
plugin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
* Copyright (c) 2019 - Eleftheria Chatziargyriou
* Copyright (c) 2019 - Marcos Cardinot <marcos@cardinot.net>
*
* This source code is licensed under the MIT license found in
* the LICENSE file in the root directory of this source tree.
*/
#ifndef LIFELIKE_H
#define LIFELIKE_H
#include <QBitArray>
#include <plugininterface.h>
namespace evoplex {
class LifeLike: public AbstractModel
{
public:
bool init() override;
bool algorithmStep() override;
private:
int m_liveAttrId; // the id of the 'live' node's attribute
QBitArray m_birthLst; // the bitstream representing the neighbours needed for cell birth
QBitArray m_survivalLst; // the bitstream representing the neighbours needed for cell survival
QBitArray ruleToBitArray(int rule) const;
};
} // evoplex
#endif // LIFELIKE_H