Go to the documentation of this file.00001 #ifndef RobustLHSR_
00002 #define RobustLHSR_
00003
00004 #include "Robust.h"
00005
00006 class RobustLHSR:public Robust
00007 {
00008 public:
00009 RobustLHSR(unsigned sampleSetSize_, double stdInputNoise_):Robust(sampleSetSize_, stdInputNoise_) { evalsUsed = 0; }
00010 virtual ~RobustLHSR();
00011
00012 void robustSimulate(int* xnom, int nnom) { robustSimulate(NULL, xnom, nnom); }
00013
00014 unsigned getEvalsUsed() { return evalsUsed; }
00015 void updateTotalGen(unsigned& totalGen, unsigned currGen, unsigned evaluations, unsigned lambda);
00016
00017 protected:
00018 struct Point
00019 {
00020 vector<double> R;
00021 vector<int> Z, D;
00022
00023 Point(vector<double>* R_, vector<int>* Z_, vector<int>* D_)
00024 {
00025 if (R_ != NULL)
00026 R = (*R_);
00027
00028 if (Z_ != NULL)
00029 Z = (*Z_);
00030
00031 if (D_ != NULL)
00032 D = (*D_);
00033 }
00034 };
00035
00036 struct ArchiveTuple:public Point
00037 {
00038 vector<double> F;
00039
00040 ArchiveTuple(Point& point, vector<double>* F_):ReferencePoint(&point.R, &point.Z, &point.D)
00041 {
00042 F = (*F_);
00043 }
00044 };
00045
00046 unsigned evalsUsed;
00047 vector<ArchiveTuple*> archive;
00048
00049 vector<Point*> referenceSet;
00050 vector<int> selectedArchiveTuples;
00051 vector<Point*> candidates;
00052
00053 void robustSimulate(Individual* I, int* xnom, int numVar);
00054
00056 void archiveSelection(Individual* I, int* xnom, int numVar);
00057
00059 void LHS(Individual* I, int* xnom, int numVar);
00060
00062 unsigned getClosestArchiveTuple(unsigned refSetIndex);
00063
00066 double EuclidianDistanceD(unsigned refSetIndex, unsigned archiveIndex);
00067
00069 bool noCloserRefPoint(refSetIndex, archiveIndex);
00070
00072 double weightD(vector<int>& D, Individual* I, int* xnom);
00073
00074 void cleanupAfterSim();
00075 };
00076
00077 #endif