file renaming

This commit is contained in:
2014-10-02 18:42:19 +02:00
parent 8c1b406259
commit c2ddda35d9
11 changed files with 171 additions and 146 deletions

View File

@@ -1,15 +0,0 @@
#ifndef _GENETICS_H_
#define _GENETICS_H_
namespace S
{
class Genetics
{
public:
protected:
private:
};
}
#endif

1
src/Genetics Symbolic link
View File

@@ -0,0 +1 @@
././Genetics.h

View File

@@ -1,2 +1,9 @@
#include "Genetics"
S::XXY S::Genetics::getSolution()
{
while(1)
{
}
}

View File

@@ -1 +0,0 @@
./Genetics

33
src/Genetics.h Normal file
View File

@@ -0,0 +1,33 @@
#ifndef _GENETICS_H_
#define _GENETICS_H_
namespace S
{
class XXY
{
};
class PossibleSolution
{
public:
virtual void mutate()=0;
virtual PossibleSolution& combine(const PossibleSolution &s)=0;
virtual double getFitness()=0;
private:
};
template <typename _T>
class Genetics
{
public:
XXY getSolution(_T);
protected:
private:
};
}
#endif

View File

@@ -1,61 +0,0 @@
#ifndef _NN_H_
#define _NN_H_
#include "Problem"
#include "Solution"
#include "Neuron"
#include <cstdarg>
#include <vector>
namespace S
{
class Network
{
public:
virtual Solution solve(const S::Problem&)=0;
virtual void learn(const S::Problem & p, const S::Solution &s)=0;
protected:
private:
};
class ACyclicNetwork : public Network
{
public:
protected:
private:
};
class Layer
{
public:
Layer(int a);
~Layer();
Solution solve(const std::vector<bool> &input);
Neuron* operator[](int neuron) const;
int size() const {return neurons.size();};
protected:
std::vector<Neuron*> neurons;
};
// template <typename _NT>
class FeedForwardNetwork : public ACyclicNetwork
{
public:
template<typename... Args>inline FeedForwardNetwork(Args &&... args) {pass((addLayer(args),1)...);};
//inline FeedForwardNetwork(std::vector<int> q);
~FeedForwardNetwork();
virtual Solution solve(const S::Problem& p) override;
virtual void learn(const S::Problem & p, const S::Solution &s) override;
const Layer* operator[](int layer);
protected:
template<typename... Args> inline void pass(Args&&...) {};
void addLayer(int neurons);
private:
Layer* first;
Layer* last ;
std::vector<Layer*> layers;
};
}
#endif

1
src/Network Symbolic link
View File

@@ -0,0 +1 @@
././Network.h

View File

@@ -1 +0,0 @@
./Network

61
src/Network.h Normal file
View File

@@ -0,0 +1,61 @@
#ifndef _NN_H_
#define _NN_H_
#include "Problem"
#include "Solution"
#include "Neuron"
#include <cstdarg>
#include <vector>
namespace S
{
class Network
{
public:
virtual Solution solve(const S::Problem&)=0;
virtual void learn(const S::Problem & p, const S::Solution &s)=0;
protected:
private:
};
class ACyclicNetwork : public Network
{
public:
protected:
private:
};
class Layer
{
public:
Layer(int a);
~Layer();
Solution solve(const std::vector<bool> &input);
Neuron* operator[](int neuron) const;
int size() const {return neurons.size();};
protected:
std::vector<Neuron*> neurons;
};
// template <typename _NT>
class FeedForwardNetwork : public ACyclicNetwork
{
public:
template<typename... Args>inline FeedForwardNetwork(Args &&... args) {pass((addLayer(args),1)...);};
//inline FeedForwardNetwork(std::vector<int> q);
~FeedForwardNetwork();
virtual Solution solve(const S::Problem& p) override;
virtual void learn(const S::Problem & p, const S::Solution &s) override;
const Layer* operator[](int layer);
protected:
template<typename... Args> inline void pass(Args&&...) {};
void addLayer(int neurons);
private:
Layer* first;
Layer* last ;
std::vector<Layer*> layers;
};
}
#endif

View File

@@ -1,25 +0,0 @@
#ifndef _NEURON_H_
#define _NEURON_H_
#include <vector>
namespace S{
class Neuron
{
public:
Neuron();
double getPotential() const;
void setPotential(double p);
double getWeight(unsigned int) const;
void setWeight(unsigned int i,double p);
bool activates(const std::vector<bool>);
protected:
double potential;
private:
std::vector<double> weights;
};
class SimpleNeuron: public Neuron
{
};
}
#endif

1
src/Neuron Symbolic link
View File

@@ -0,0 +1 @@
././Neuron.h

View File

@@ -1 +0,0 @@
./Neuron

25
src/Neuron.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef _NEURON_H_
#define _NEURON_H_
#include <vector>
namespace S{
class Neuron
{
public:
Neuron();
double getPotential() const;
void setPotential(double p);
double getWeight(unsigned int) const;
void setWeight(unsigned int i,double p);
bool activates(const std::vector<bool>);
protected:
double potential;
private:
std::vector<double> weights;
};
class SimpleNeuron: public Neuron
{
};
}
#endif

View File

@@ -1,19 +0,0 @@
#ifndef _P_H_
#define _P_H_
#include <vector>
namespace S
{
class Problem
{
public:
Problem();
operator std::vector<bool>() const;
protected:
virtual std::vector<bool> representation() const =0;
private:
};
}
#endif

1
src/Problem Symbolic link
View File

@@ -0,0 +1 @@
././Problem.h

View File

@@ -1 +0,0 @@
./Problem

19
src/Problem.h Normal file
View File

@@ -0,0 +1,19 @@
#ifndef _P_H_
#define _P_H_
#include <vector>
namespace S
{
class Problem
{
public:
Problem();
operator std::vector<bool>() const;
protected:
virtual std::vector<bool> representation() const =0;
private:
};
}
#endif

View File

@@ -1,21 +0,0 @@
#ifndef _SOL_H_
#define _SOL_H_
#include <vector>
#include "Problem"
namespace S
{
class Solution
{
public:
Solution(std::vector<bool> solution);
int size();
bool operator[] (int pos);
operator std::vector<bool>();
protected:
std::vector<bool> solution;
};
}
#endif

1
src/Solution Symbolic link
View File

@@ -0,0 +1 @@
././Solution.h

View File

@@ -1 +0,0 @@
./Solution

21
src/Solution.h Normal file
View File

@@ -0,0 +1,21 @@
#ifndef _SOL_H_
#define _SOL_H_
#include <vector>
#include "Problem"
namespace S
{
class Solution
{
public:
Solution(std::vector<bool> solution);
int size();
bool operator[] (int pos);
operator std::vector<bool>();
protected:
std::vector<bool> solution;
};
}
#endif