I'm currently experimenting with JGAP 3.6 to generate levels for a simple dungeon game. The problem involves using a Chromosome representation where each Gene contains an integer value which represents the type of a room e.g 0 = Starting room, 1 = Monster room, and so forth.
The problem is, I want to make sure that there is only one Starting room in a level (Only one Gene with value of 0 in a Chromosome). I've read the javadocs specifically the Chromosome and Gene class yet found no straightforward way to do this. I've also considered using custom-made Gene but it seems useless because I figured this kind of 'validation' needs to be done by the Chromosome class and not the Gene class.
My current workaround plan for the problem is by giving a large penalty during fitness evaluation for Chromosomes that doesn't satisfy said condition. Any thoughts, solutions, suggestions, or comments? Thank you