#ifndef SOLVER_H #define SOLVER_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "Individ.h" #include "history.h" struct dataSet{ QVector withFeedbackVect; QVector withoutFeedbackVect; QVector xRange; QVector meanE; QVector meanF; QVector meanC2; QVector individ; QVector individFeedback; //int maxIters; double maxWithFeedVal; double maxWithoutFeedVal; }; class Solver : public QObject { Q_OBJECT public: Solver(QObject *parent = 0); ~Solver(); void solveModel(float c1, float c2, float c3, float c4, float c5, float sigC1, float sigC2, float sigC3, float sigC4, float sigC5, float e, float sigE, float sigX0, float delX0, float sigX, float Xopt, int popSize, int maxSteps, int N, int flag, int iter, int modelCount); double solveF(int x, int y, int a, double b); double solveG(int x, int y, int c, double d); void initialization(std::vector& population, int N_feedback); void mutationSimple(std::vector& population); void mutationComplex(std::vector& population); void selection(std::vector& population, float renewRate); void printStatistics(const std::vector& population, int i, int iters, int currentStep); private: QVector predatorSolveVal; QVector preySolveVal; QVector withFeedbackVect; QVector withoutFeedbackVect; QVector firstXVect; QVector meanE; QVector meanF; QVector meanC2; QVector individ; QVector individFeedback; QVector withFeedbackVectAvg; QVector withoutFeedbackVectAvg; QVector meanEAvg; QVector meanFAvg; QVector meanC2Avg; QVector individAvg; QVector individFeedbackAvg; std::vector population; QVector > popVect; double maxWithFeedVal; double maxWithoutFeedVal; int withFeedback; int withoutFeedback; int N_forFeedback; float meanC2Feedback; float meanEFeedBack; float meanENonFeedBack; int newIters; int addSteps; int itersFlag; int modCount; dataSet vectors; QVector singleModelHistory; double lastXopt; signals: void sendFeedVectors(QVector withFeed, QVector withoutFeed, QVector xValsVect ,double maxWithFeed, double maxWithoutFeed); void sendMeanVectors(int iters, QVector meanEV, QVector meanFV, QVector meanC2V, QVector individV, QVector individFeedbackV); void sendHistory(QVector history, int iters); void sendItersForProgressBar(int iters); public slots: }; #endif // SOLVER_H