aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/backend/population/Gene.java
blob: a22abc6cef3a58dcdf7dce7706c8a0372a64a8e3 (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
package jcgp.backend.population;

/**
 * This abstract class defines a generic CGP gene.
 * Three types of gene exist, primarily: {@code Input}, {@code Node} and {@code Output}.
 * <br><br>
 * In practice, this class facilitates support for a graphical user interface. An arbitrary
 * object can be associate with each gene using {@code setGUIObject(...)} and retrieved using
 * {@code getGUIObject()}. 
 * 
 * @author Eduardo Pedroni
 *
 */
public abstract class Gene {

	private Object guiObject;
	
	/**
	 * Sets a new GUI object.
	 * 
	 * @param guiObject the object to set.
	 */
	public void setGUIObject(Object guiObject) {
		this.guiObject = guiObject;
	}
	
	/**
	 * @return the current GUI object associated with this instance.
	 */
	public Object getGUIObject() {
		return guiObject;
	}
}