aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/backend/resources
diff options
context:
space:
mode:
authorEduardo Pedroni <ep625@york.ac.uk>2014-04-18 09:08:41 +0100
committerEduardo Pedroni <ep625@york.ac.uk>2014-04-18 09:08:41 +0100
commit88314e71f908efcfc38da3b800319c171a6ccceb (patch)
treedf42e3af2652dff815d1269bb81906a7af51e089 /src/jcgp/backend/resources
parente7d7e8506a511d78f9e323ac09587f79ad503f42 (diff)
Added parsers, did a bit of testing, switched to java8
Diffstat (limited to 'src/jcgp/backend/resources')
-rw-r--r--src/jcgp/backend/resources/ModifiableResources.java14
-rw-r--r--src/jcgp/backend/resources/Resources.java18
2 files changed, 18 insertions, 14 deletions
diff --git a/src/jcgp/backend/resources/ModifiableResources.java b/src/jcgp/backend/resources/ModifiableResources.java
index 689f846..3841963 100644
--- a/src/jcgp/backend/resources/ModifiableResources.java
+++ b/src/jcgp/backend/resources/ModifiableResources.java
@@ -19,6 +19,10 @@ public class ModifiableResources extends Resources {
super();
}
+ public void setValues(String filePath) {
+
+ }
+
/**
* @param rows the rows to set
*/
@@ -106,8 +110,8 @@ public class ModifiableResources extends Resources {
/**
* @param report the report to set
*/
- public void setReport(int report) {
- this.report.set(report);
+ public void setReportInterval(int report) {
+ this.reportInterval.set(report);
}
/**
@@ -197,10 +201,10 @@ public class ModifiableResources extends Resources {
/**
* @return the report
*/
- public IntegerParameter getReportParameter() {
- return report;
+ public IntegerParameter getReportIntervalParameter() {
+ return reportInterval;
}
-
+
public void setFunctionSet(FunctionSet functionSet) {
this.functionSet = functionSet;
setArity(functionSet.getMaxArity());
diff --git a/src/jcgp/backend/resources/Resources.java b/src/jcgp/backend/resources/Resources.java
index c83fa35..0bf1ee1 100644
--- a/src/jcgp/backend/resources/Resources.java
+++ b/src/jcgp/backend/resources/Resources.java
@@ -21,7 +21,7 @@ import jcgp.backend.resources.parameters.ParameterStatus;
public class Resources {
protected IntegerParameter rows, columns, inputs, outputs, populationSize,
levelsBack, currentGeneration, generations, currentRun, runs,
- arity, seed, report;
+ arity, seed, reportInterval;
protected Random numberGenerator = new Random();
protected FunctionSet functionSet;
@@ -124,10 +124,10 @@ public class Resources {
}
/**
- * @return the report
+ * @return the report interval
*/
- public int report() {
- return report.get();
+ public int reportInterval() {
+ return reportInterval.get();
}
private void createBaseParameters() {
@@ -273,7 +273,7 @@ public class Resources {
});
numberGenerator.setSeed(seed.get());
- report = new IntegerParameter(1, "Report", false, false) {
+ reportInterval = new IntegerParameter(1, "Report interval", false, false) {
@Override
public void validate(Number newValue) {
if (newValue.intValue() > generations.get()) {
@@ -325,8 +325,8 @@ public class Resources {
* These are affected by parameter report
*/
public void reportln(String s) {
- if (report.get() > 0) {
- if (currentGeneration.get() % report.get() == 0) {
+ if (reportInterval.get() > 0) {
+ if (currentGeneration.get() % reportInterval.get() == 0) {
System.out.println(s);
if (console != null) {
console.println(s);
@@ -336,8 +336,8 @@ public class Resources {
}
public void report(String s) {
- if (report.get() > 0) {
- if (currentGeneration.get() % report.get() == 0) {
+ if (reportInterval.get() > 0) {
+ if (currentGeneration.get() % reportInterval.get() == 0) {
System.out.print(s);
if (console != null) {
console.print(s);