ECF 1.5
SchedulingEvalOp.h
1#ifndef SchedulingEvalOp_h
2#define SchedulingEvalOp_h
3
4#include "matrice.h"
5
6class SchedulingEvalOp : public EvaluateOp
7{
8public:
9 FitnessP evaluate(IndividualP individual);
10 void registerParameters(StateP);
11 bool initialize(StateP);
13
14protected:
15
16 enum environment
17 { SINGLE,
18 UNIFORM,
19 UNRELATED,
20 JOBSHOP
21 };
22
23 unsigned int edited,total,nItems;
24// RPN Evaluator;
25 //void write(std::string &output);
26 //void ReadTerminals(void);
27 //void DefineNodeNames(void);
28 void ReadConstraints(Matrica &Constraints, int set, int jobs, Matrica &Precedence);
29 void MakeSetup(Matrica &Duration, int set, int jobs, double faktor, Matrica &Setup);
30 double NodeLevel(int set, int node);
31 //void StartTerminalStatistic(Beagle::GP::Context& ioContext, double dSubsetSize=0);
32 //void GetTerminalStatistic(double *pValues);
33 //void UpdateTerminalStatistic(double &dFitness);
34 //void ReadIndividual(Beagle::GP::Individual& inIndividual);
35 //void CalcTimedTerminals(uint &nNiz, uint &nPoslova, uint &nJob, double &dClock, uint nMachine=0, uint nMachines=1);
36 double EvaluateSingle(TreeP);
37 //void EvaluateUniform(double &dRawFitness);
38 //void EvaluateUnrelated(double &dRawFitness);
39 //void EvaluateJobShop(double &dRawFitness);
40 //int Before(const void *arg1, const void *arg2);
41
42protected:
43 unsigned int sets,max_jobs,total_jobs,max_machines,max_length;
44 unsigned int m_fitness; // koja fitnes funkcija? definicije u nodes.h
45 unsigned int m_BestSubset; // koliko najboljih jedinki gledamo za statistiku terminala
46 unsigned int m_SubsetSize; // vlastita proracunata velicina (default vrijednost)
47 unsigned int m_InSubset; // koliko ih trenutno ima u matrici
48 unsigned int m_WorstInSubset; // koji je najlosiji
49 double m_WorstSubsetFitness; // fitnes najlosije jedinke u podskupu najboljih
50 double m_BestSubsetFitness; // treba li komentar?
51 environment m_Environment; // okruzenje: single, uniform, unrelated, job shop
52 unsigned int m_SortSet; // oznaka skupa za potrebe qsort-a
53 unsigned int m_PopSize; // ukupna velicina populacije
54
55 bool m_Normalized; // je li fitnes normiran brojem i trajanjem poslova
56 bool m_Evaluation; // pisanje rezultata za svaki skup u datoteku
57 bool m_TermUsage; // prikupljanje statistike koristenja terminala
58 bool m_editing; // editiranje?
59 bool m_LEF; // limited error fitness (1 ili 0)
60 double m_LEFVal; // vrijednost za LEF
61 bool m_setup; // postoje li trajanja postavljanja izmedyu poslova
62 double m_setup_faktor; // prosjecni odnos izmedju trajanja postavljanja i trajanja posla
63 bool m_dynamic; // dinamicka okolina?
64 bool m_constrained; // ogranicenja u rasporedu?
65 bool m_stsampling; // stochastic sampling?
66 double m_sampling; // koliki postotak test skupova se uzima
67 bool *pSamples; // koji tocno skupovi idu
68 bool m_Idleness; // uzimamo li u obzir i cekanje operacija (job shop)
69 bool *pRasporedjen;
70 double *pVrijednosti, *pArray, *pSlack, *pSlackSpeed, *pArrival, *pLevel, *pSetupAvg;
71 double *pOperationReady, *pJobReady, *pTotalWorkRemaining, *pTotalWorkDone, *pTotalMachineWork;
72 double *pMachineWorkRemaining, *pMachineValues;
73 unsigned int *pIndex, *pUsed, *pLastJob, *pPTimeMinMachine, *pMachineScheduled, *pOperationsScheduled;
74 unsigned int *pOperationsWaiting;
75 Matrica N,Duration,Deadline,WeightT,WeightF,WeightE,WeightN,Ready,Constraints,Machines,Speed;
76 Matrica SP,SD,Fitness,Schedule,Precedence,Level,Setup,Terminals,MachineReady,PTimeAvg,PTimeMinMachine;
77 Matrica SortedReady, Values, Durations, MachineIndex;
78 std::string in_file;
79};
80typedef boost::shared_ptr<SchedulingEvalOp> SchedulingEvalOpP;
81
82#endif // SchedulingEvalOp_h
Evaluation base class.
Definition: EvaluateOp.h:17
Fitness base class.
Definition: Fitness.h:16
bool initialize(StateP)
Initialize the evaluator. Called before first evaluation occurs.
FitnessP evaluate(IndividualP individual)
Evaluate a single individual. Method must create and return a Fitness object.
void registerParameters(StateP)
Register evaluator parameters. Called before EvaluateOp::initialize method.
Definition: nodes.h:92