source: proiecte/GAIIA/Evaluator.h @ 122

Last change on this file since 122 was 122, checked in by (none), 14 years ago
File size: 1.5 KB
Line 
1#ifndef EVALUATOR_H
2#define EVALUATIR_H
3
4#include <vector>
5#include "Genetic.h"
6#include "Graf.h"
7
8using namespace std;
9
10/**
11* class containing information about one task execution - start time, end time & the index of the associated processor
12*/
13class TaskInfo {
14        public:
15                /**
16                * the minimum start time of execution
17                */
18                int start;
19         
20                /**
21                * the maximum end time of execution
22                */
23                int end;
24
25                /**
26                * the index of the associated processor
27                */
28                int proc_index;
29        public:
30                /**
31                * the default constructor
32                */
33                TaskInfo();
34};
35
36
37/**
38* class that implements the chromosomes of one population
39*/
40class Evaluator{
41                       
42        public:
43                /**
44                * the input graph of tasks
45                */
46                TaskGraf tasks;
47
48                /**
49                * the input graph of processors
50                */
51                ProcesorGraf procs;
52
53                /**
54                * the list of current time for each task
55                */
56                int *proc_time;
57
58                /**
59                * the list of "task-processor" associations
60                */
61                TaskInfo *task_info;
62        public:
63                /**
64                * the default constructor
65                */
66                Evaluator();
67         
68                /**
69                * the constructor
70                *
71                * @param TG the input graph of tasks
72                * @param PG the input graph of processors
73                */
74                Evaluator(TaskGraf &TG, ProcesorGraf &PG);
75
76                /**
77                * Method that evaluates one chromosome, computing its makespan, T1, T2, T3
78                *
79                * @param ch the chromosome we want to evaluate
80                */
81                void evaluateIndividual(Chromosome &ch);
82
83                /**
84                * Method that evaluates one population's performance
85                *
86                * @param ch the list of chromosomes
87                */
88                void evaluatePopulation(vector<Chromosome> &ch);                 
89};
90
91
92#endif
Note: See TracBrowser for help on using the repository browser.