forked from d9w/WindFLO
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWindFarmLayoutEvaluator.java
More file actions
85 lines (77 loc) · 3.21 KB
/
WindFarmLayoutEvaluator.java
File metadata and controls
85 lines (77 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/**
* The class WindFarmLayoutEvaluator is an interface to easily exchange the
* evaluation function of the wind farm layouts. The evaluator has to be initialized
* with a wind scenario before being used to evaluate any layouts with the
* evaluation function. After evaluation, the output data (energy output per
* turbine, per direction, etc.) are available by the means of the corresponding
* getters. Each time the evaluation function is used, a global counter is
* increased. This counter is available with the function getNumberOfEvaluation.
*/
public abstract class WindFarmLayoutEvaluator {
protected static int nEvals=0;
protected WindScenario scenario;
/**
* Initializes the evaluator with a wind scenario
* This method doesn't increase the number of evaluations counter.
* @param scenario
*/
public abstract void initialize(WindScenario scenario);
/**
* 2015 WIND FARM LAYOUT OPTIMIZATION EVALUATION FUNCTION
*
* Evaluates a given layout and returns its cost of energy
* Calling this method increases the number of evaluations counter.
* @param layout The layout to evaluate
* @return the cost of energy (positive)
* and max_double if the layout is invalid
*/
public abstract double evaluate(double[][] layout);
/**
* 2014 WIND FARM LAYOUT OPTIMIZATION EVALUATION FUNCTION
*
* Evaluates a given layout and returns its wake free ratio
* This method increases the number of evaluations counter.
* @param layout The layout to evaluate
* @return The wake free ratio of the layout
* or a negative value is the layout is invalid
*/
public abstract double evaluate_2014(double[][] layout);
/**
* Returns the energy outputs per wind turbine and per direction of the last
* layout evaluated, ordered as in the layout vector provided to the
* evaluation method and the wind scenario wind directions.
* A layout must have been evaluated before this method is called. This
* method doesn't increase the number of evaluation counter.
* @return The energy outputs; null if no layout have been evaluated
*/
public abstract double[][] getEnergyOutputs();
/**
* Returns the wake free ratio per wind turbine of the last layout
* evaluated, ordered as in the layout vector provided in the evaluation
* method.
* A layout must have been evaluated before this method is called. This
* method doesn't increase the number of evaluation counter.
* @return The wake free ratio per turbine
*/
public abstract double[] getTurbineFitnesses();
/**
* Returns the global energy output of the last layout evaluated.
* A layout must have been evaluated before this method is called.
* This method doesn't increase the number of evaluation counter.
* @return The global energy output
*/
public abstract double getEnergyOutput();
/**
* Returns the global wake free ratio of the last layout evaluated.
* A layout must have been evaluated before this method is called.
* This method doesn't increase the number of evaluation counter.
* @return The global wake free ratio
*/
public abstract double getWakeFreeRatio();
/**
* Returns the global number of time the evaluation function has been called.
*/
public static int getNumberOfEvaluation() {
return nEvals;
}
}