00001 #ifndef _REFINERAPPROX_H_
00002 #define _REFINERAPPROX_H_
00003
00004 #include "CentralLB.h"
00005 #include "Refiner.h"
00006
00007 #ifndef INFTY
00008 #define INFTY 999999
00009 #endif
00010
00011 class processorInfo;
00012
00013 class RefinerApprox:public Refiner {
00014 public:
00015 RefinerApprox(double _overload): Refiner(_overload) {
00016 overLoad = _overload; computes=0; processors=0;
00017 };
00018 ~RefinerApprox() {};
00019 void Refine(int count, CentralLB::LDStats* stats, int* cur_p, int* new_p, int percentMoves=100);
00020
00021 protected:
00022 void create(int count, CentralLB::LDStats* stats, int* cur_p);
00023 void reinitAssignment();
00024 virtual int refine(double opt);
00025 void multirefine(int num_moves);
00026 int getNumLargeComputes(double opt);
00027 double getLargestCompute();
00028 int computeA(processorInfo *p,double opt);
00029 int computeB(processorInfo *p,double opt);
00030 int numMoves();
00031 void printStats(int newStats);
00032 Set * removeBiggestSmallComputes(int num,processorInfo * p,double opt);
00033 Set * removeBigComputes(int num,processorInfo * p,double opt);
00034 };
00035
00036 #endif
00037
00038