diff options
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 |