aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/backend/parameters/monitors/DoubleMonitor.java
diff options
context:
space:
mode:
authorEduardo Pedroni <ep625@york.ac.uk>2014-05-01 13:05:27 +0100
committerEduardo Pedroni <ep625@york.ac.uk>2014-05-01 13:05:27 +0100
commit36f4393bcc9e55afa2334baa33e603ce839741a1 (patch)
treed9a1d55d0d3553193a3fc11a92f11515762d202f /src/jcgp/backend/parameters/monitors/DoubleMonitor.java
parent4c8de2402f2878cde7587c7f3bbf4ffaea86efd4 (diff)
Did more commenting, implemented reflection and statistics
Diffstat (limited to 'src/jcgp/backend/parameters/monitors/DoubleMonitor.java')
-rw-r--r--src/jcgp/backend/parameters/monitors/DoubleMonitor.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/jcgp/backend/parameters/monitors/DoubleMonitor.java b/src/jcgp/backend/parameters/monitors/DoubleMonitor.java
new file mode 100644
index 0000000..36b0e22
--- /dev/null
+++ b/src/jcgp/backend/parameters/monitors/DoubleMonitor.java
@@ -0,0 +1,45 @@
+package jcgp.backend.parameters.monitors;
+
+import jcgp.backend.parameters.DoubleParameter;
+
+/**
+ * This is a special type of {@code DoubleParameter} which
+ * cannot be modified in the GUI (if the GUI is in use).
+ *
+ * @author Eduardo Pedroni
+ *
+ */
+public class DoubleMonitor extends DoubleParameter {
+
+ /**
+ * Creates a new instance of this class, assuming the monitor
+ * is not critical.
+ *
+ * @param value the initial value for this monitor.
+ * @param name the name of this monitor, for GUI display.
+ */
+ public DoubleMonitor(double value, String name) {
+ super(value, name, true, false);
+ }
+
+ /**
+ * Creates a new instance of this class.
+ *
+ * @param value the initial value for this monitor.
+ * @param name the name of this monitor, for GUI display.
+ * @param critical true if the monitor is critical.
+ */
+ public DoubleMonitor(double value, String name, boolean critical) {
+ super(value, name, true, critical);
+ }
+
+ @Override
+ public void validate(Number newValue) {
+ /*
+ * Blank by default.
+ * Instances should override this as necessary.
+ *
+ */
+ }
+
+}