aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/backend/resources
diff options
context:
space:
mode:
Diffstat (limited to 'src/jcgp/backend/resources')
-rw-r--r--src/jcgp/backend/resources/ModifiableResources.java8
-rw-r--r--src/jcgp/backend/resources/Resources.java14
2 files changed, 21 insertions, 1 deletions
diff --git a/src/jcgp/backend/resources/ModifiableResources.java b/src/jcgp/backend/resources/ModifiableResources.java
index 3dab2aa..5df26e2 100644
--- a/src/jcgp/backend/resources/ModifiableResources.java
+++ b/src/jcgp/backend/resources/ModifiableResources.java
@@ -3,6 +3,7 @@ package jcgp.backend.resources;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import jcgp.backend.function.FunctionSet;
+import jcgp.backend.modules.problem.BestFitness;
import jcgp.backend.parameters.IntegerParameter;
import jcgp.backend.parameters.ParameterStatus;
import jcgp.backend.parameters.monitors.IntegerMonitor;
@@ -137,6 +138,13 @@ public class ModifiableResources extends Resources {
}
/**
+ * @param newOrientation the new orientation to set.
+ */
+ public void setFitnessOrientation(BestFitness newOrientation) {
+ this.fitnessOrientation = newOrientation;
+ }
+
+ /**
* @return the rows parameter.
*/
public IntegerParameter getRowsParameter() {
diff --git a/src/jcgp/backend/resources/Resources.java b/src/jcgp/backend/resources/Resources.java
index ebd6fb2..59a29ea 100644
--- a/src/jcgp/backend/resources/Resources.java
+++ b/src/jcgp/backend/resources/Resources.java
@@ -4,6 +4,7 @@ import java.util.Random;
import jcgp.backend.function.Function;
import jcgp.backend.function.FunctionSet;
+import jcgp.backend.modules.problem.BestFitness;
import jcgp.backend.parameters.IntegerParameter;
/**
@@ -15,6 +16,8 @@ import jcgp.backend.parameters.IntegerParameter;
* the actual parameter values can be obtained using getter methods. Note that, for code brevity,
* this class's getters do not start with the word "get". For instance, to get the number of rows,
* one would use {@code rows()} instead of {@code getRows()} which doesn't exist.
+ * The fitness orientation of the problem being solved can also be retrieved using {@code fitnessOrientation()}.
+ * Evolutionary strategies will typically use this to perform selection.
* <br><br>
* In addition to parameters, this class also offers utility methods. Any necessary random numbers
* should be obtained using {@code getRandomInt()} and {@code getRandomDouble()} as these methods
@@ -23,7 +26,7 @@ import jcgp.backend.parameters.IntegerParameter;
* Finally, printing to the console should be done via the resources using the report and print
* methods, so that these prints also get sent to the GUI console (if one is present).
*
- * @see Parameter, Console, FunctionSet
+ * @see jcgp.backend.parameters.Parameter
* @author Eduardo Pedroni
*
*/
@@ -37,6 +40,8 @@ public class Resources {
protected Console console;
+ protected BestFitness fitnessOrientation;
+
/**
* @return the number of rows.
*/
@@ -135,6 +140,13 @@ public class Resources {
return reportInterval.get();
}
+ /**
+ * @return the fitness orientation.
+ */
+ public BestFitness fitnessOrientation() {
+ return fitnessOrientation;
+ }
+
/*
* Utility functions
*/