cellular encoding

This commit is contained in:
2016-05-18 22:57:06 +02:00
parent 86def08f41
commit 237c7741d2
11 changed files with 1032 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
#pragma once
#include "./Instruction.h"
#include "../Cell.h"
#include "../CelularEncoding.h"
namespace NeuralNetworks {
namespace ConstructiveAlgorithms {
namespace CelularEncoding {
namespace Instruction{
class Wait : public Instruction{
public:
Wait(bool terminal = false) : _numberOfNodes(terminal? 0 : 1) {
}
virtual void run(Cell &cell, CelularEncoding &, const std::vector<double> &) override {
cell.setCodePointer(cell.getCodePointer()->c1);
}
virtual std::size_t numberOfNodes() const override {
return _numberOfNodes;
}
virtual std::string toString() const override {
return "Wait";
}
protected:
std::size_t _numberOfNodes;
};
}
}
}
}