~swaits/differential-evolution

76f95a74b9cb93eaece9a7e26f2b38b0aca58a25 — swaits 17 years ago 4fdf985




        
2 files changed, 40 insertions(+), 0 deletions(-)

A pso.cpp
A pso.h
A pso.cpp => pso.cpp +6 -0
@@ 0,0 1,6 @@
#include "pso.h"

int main()
{
	return 0;
}

A pso.h => pso.h +34 -0
@@ 0,0 1,34 @@
#ifndef __pso_h__
#define __pso_h__

namespace PSO
{
	template <unsigned int DIM, unsigned int POP=(DIM*10)>
	class Engine
	{
	public:

		Engine();
		virtual ~Engine();

		void Reset();

		const double* GetBest() const;

		void SetRange(double minimum, double maximum);
		void SetRange(const Vector<DIM>& minimum, const Vector<DIM>& maximum);
		
		virtual double CalculateError(const double testcase[DIM], bool& stop) = 0;

		bool Solve(unsigned int maxgenerations = 1000000000);

	private:


	};

};


#endif // __pso_h__