diff options
author | Eduardo Pedroni <ep625@york.ac.uk> | 2014-04-07 15:58:30 +0100 |
---|---|---|
committer | Eduardo Pedroni <ep625@york.ac.uk> | 2014-04-07 15:58:30 +0100 |
commit | 226365bd6a0f56143ffbce7379857ff3e126fbaf (patch) | |
tree | 4582b16a5519c94b121a369104157859dc97cba1 /src/jcgp/backend/resources | |
parent | 67ace66f66ffaa00e1bd1495c0d406c801e59c5c (diff) |
Refactoring resources for (hopefully) the last time
Diffstat (limited to 'src/jcgp/backend/resources')
-rw-r--r-- | src/jcgp/backend/resources/ModifiableResources.java | 17 | ||||
-rw-r--r-- | src/jcgp/backend/resources/Resources.java | 36 |
2 files changed, 34 insertions, 19 deletions
diff --git a/src/jcgp/backend/resources/ModifiableResources.java b/src/jcgp/backend/resources/ModifiableResources.java index 90c2f03..a221f73 100644 --- a/src/jcgp/backend/resources/ModifiableResources.java +++ b/src/jcgp/backend/resources/ModifiableResources.java @@ -40,4 +40,21 @@ public class ModifiableResources extends Resources { this.console = console; } + /* + * Console functionality + */ + public void println(String s) { + System.out.println(s); + if (console != null) { + console.println(s); + } + } + + public void print(String s) { + System.out.print(s); + if (console != null) { + console.print(s); + } + } + } diff --git a/src/jcgp/backend/resources/Resources.java b/src/jcgp/backend/resources/Resources.java index d1f396a..13e0c51 100644 --- a/src/jcgp/backend/resources/Resources.java +++ b/src/jcgp/backend/resources/Resources.java @@ -266,31 +266,29 @@ public class Resources { return functionSet; } -// /* -// * Test cases -// */ -// public TestCase getTestCase(int index) { -// return testCases[index]; -// } -// -// public int getTestCaseCount() { -// return testCases.length; -// } - /* * Console functionality + * These are affected by parameter report */ - public void println(String s) { - System.out.println(s); - if (console != null) { - console.println(s); + public void reportln(String s) { + if (getInt("report") > 0) { + if (getInt("currentGen") % getInt("report") == 0) { + System.out.println(s); + if (console != null) { + console.println(s); + } + } } } - public void print(String s) { - System.out.print(s); - if (console != null) { - console.print(s); + public void report(String s) { + if (getInt("report") > 0) { + if (getInt("currentGen") % getInt("report") == 0) { + System.out.print(s); + if (console != null) { + console.print(s); + } + } } } }
\ No newline at end of file |