00001
00006 #ifndef _EvolutionaryMethodLayer_h
00007 #define _EvolutionaryMethodLayer_h
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "../methods/EvolutionaryMethodIteration.h"
00018 #include "PlotControl.h"
00019 #include "XyResultLayer.h"
00020
00021
00022
00023
00024 class EvolutionaryMethodLayer
00025 : public XyResultLayer
00026 {
00027 public:
00028
00029 friend class DrawDeceasedAction;
00030 friend class OnlyBestAction;
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00048 EvolutionaryMethodLayer(const PlotControl& plotControl,
00049 const Result& result,
00050 CountedPtr<PlotLayer> cpFunctionLayer);
00051
00054 EvolutionaryMethodLayer(const EvolutionaryMethodLayer& from);
00055
00056
00059 ~EvolutionaryMethodLayer(void);
00060
00061
00062
00063
00064
00065
00066 virtual void Draw(wxDC& dc) const;
00067
00068 virtual vector<ToolbarTool> CreateTools(PlotControl* pPlotControl);
00069
00070 virtual Region IterationBoundingBox(unsigned iterationNumber) const;
00071
00074 static std::auto_ptr<ResultLayer> Create(
00075 const PlotControl& plotControl,
00076 const Result& result,
00077 CountedPtr<PlotLayer> cpFunctionLayer);
00078
00079
00080
00081
00082
00083 protected:
00084 private:
00085
00086 void DrawIteration(wxDC& dc,
00087 unsigned iterationNumber,
00088 bool highlight) const;
00089
00090 void DrawDeceased
00091 ( wxDC& dc,
00092 const EvolutionaryMethodIteration& iteration) const;
00093
00094 void DrawSurvivors
00095 ( wxDC& dc,
00096 const EvolutionaryMethodIteration& iteration) const;
00097
00098 void DrawMutants
00099 ( wxDC& dc,
00100 const EvolutionaryMethodIteration& iteration) const;
00101
00102 void DrawChildren
00103 ( wxDC& dc,
00104 const EvolutionaryMethodIteration& iteration) const;
00105
00106 void DrawStartingBest
00107 ( wxDC& dc,
00108 const EvolutionaryMethodIteration& iteration,
00109 bool highlight) const;
00110
00111 void DrawEndBest
00112 ( wxDC& dc,
00113 const EvolutionaryMethodIteration& iteration,
00114 bool highlight) const;
00115
00116 void DrawImprovementLine
00117 ( wxDC& dc,
00118 const EvolutionaryMethodIteration& iteration,
00119 bool highlight) const;
00120
00121 void DrawChromosomeContainer(wxDC& dc,
00122 const EvolutionaryMethodIteration::ChromosomeContainer& container,
00123 AttributeDatabase::AttributeType attribute) const;
00124
00125
00126
00127
00128
00129 bool mDrawDeceased;
00130 bool mDrawOnlyBest;
00131
00132 const static void* mRegistrationDummy;
00133
00134 };
00135
00136
00137
00138
00139
00140
00141
00142 #endif // _EvolutionaryMethodLayer_h