aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/modules/fitness/TestCase.java
blob: 0cb09f18d695c210522a6da808008c88f57a12e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package jcgp.modules.fitness;

import jcgp.exceptions.ParameterMismatchException;
import jcgp.parameters.Parameters;

public class TestCase {

	private Object[] inputs;
	private Object[] outputs;
	
	public TestCase(Object[] inputs, Object[] outputs) throws ParameterMismatchException {
		if (inputs.length == Parameters.getInputs()) {
			this.inputs = inputs;
		} else {
			throw new ParameterMismatchException();
		}
		
		if (outputs.length == Parameters.getOutputs()) {
			this.outputs = outputs;
		} else {
			throw new ParameterMismatchException();
		}
		
	}
	
	public Object getInput(int index) {
		return inputs[index];
	}
	
	public Object getOutput(int index) {
		return outputs[index];
	}
	
	public Object[] getInputs() {
		return inputs;
	}
	
	public Object[] getOutputs() {
		return outputs;
	}
	
}