Buggy code:
public class ComplicatedPlan3 { static int size = 15 ; public static void main ( String [ ] args ) { CommandGene [ ] commands = new CommandGene [ ComplicatedPlan3 . size ] ; int [ ] depths = new int [ ComplicatedPlan3 . size ] ; GPConfiguration gpConf = null ; try { gpConf = new GPConfiguration ( ) ; } catch ( InvalidConfigurationException e ) { e . printStackTrace ( ) ; System . exit ( 1 ) ; } IGPFitnessEvaluator prismEvaluationFunction = new EvaluateFitness ( ) ; gpConf . setGPFitnessEvaluator ( prismEvaluationFunction ) ; gpConf . setMaxInitDepth ( 2 ) ; try { gpConf . setPopulationSize ( 50 ) ; } catch ( InvalidConfigurationException e ) { e . printStackTrace ( ) ; } gpConf . setCrossoverProb ( 0.9F ) ; gpConf . setReproductionProb ( 0.1F ) ; gpConf . setNewChromsPercent ( 0.3F ) ; gpConf . setStrictProgramCreation ( true ) ; gpConf . setUseProgramCache ( true ) ; gpConf . setNoCommandGeneCloning ( false ) ; try { gpConf . setFitnessFunction ( ( ( GPFitnessFunction ) ( prismEvaluationFunction ) ) ) ; } catch ( InvalidConfigurationException e ) { e . printStackTrace ( ) ; } try { commands [ 0 ] = new actions . IfSuccessElse ( gpConf ) ; depths [ 0 ] = 0 ; commands [ 1 ] = new actions . IfSuccessElse ( gpConf ) ; depths [ 1 ] = 1 ; commands [ 2 ] = new actions . IfSuccessElse ( gpConf ) ; depths [ 2 ] = 2 ; commands [ 3 ] = new actions . AddServerL2 ( gpConf ) ; depths [ 3 ] = 3 ; commands [ 4 ] = new actions . IncreaseDatabaseBThreads ( gpConf ) ; depths [ 4 ] = 3 ; commands [ 5 ] = new actions . DeleteServerL2 ( gpConf ) ; depths [ 5 ] = 3 ; commands [ 6 ] = new actions . AddServerL1 ( gpConf ) ; depths [ 6 ] = 2 ; commands [ 7 ] = new actions . IncreaseDatabaseAThreads ( gpConf ) ; depths [ 7 ] = 2 ; commands [ 8 ] = new org . jgap . gp . function . SubProgram ( gpConf , new Class [ ] { CommandGene . VoidClass , CommandGene . VoidClass } , true ) ; depths [ 8 ] = 1 ; commands [ 9 ] = new actions . IncreaseDatabaseAThreads ( gpConf ) ; depths [ 9 ] = 2 ; commands [ 10 ] = new actions . AddServerL1 ( gpConf ) ; depths [ 10 ] = 2 ; commands [ 11 ] = new actions . IfSuccessElse ( gpConf ) ; depths [ 11 ] = 1 ; commands [ 12 ] = new actions . AddServerL1 ( gpConf ) ; depths [ 12 ] = 2 ; commands [ 13 ] = new actions . IncreaseDatabaseBThreads ( gpConf ) ; depths [ 13 ] = 2 ; commands [ 14 ] = new actions . DeleteServerL2 ( gpConf ) ; depths [ 14 ] = 2 ; ProgramChromosome chromosome = new ProgramChromosome ( gpConf , ComplicatedPlan3 . size ) ; chromosome . setFunctions ( commands ) ; Field depthArray = chromosome . getClass ( ) . getDeclaredField ( "m_depth" ) ; depthArray . setAccessible ( true ) ; depthArray . set ( chromosome , depths ) ; System . out . println ( ( "Created<seq2seq4repair_space>plan:<seq2seq4repair_space>" + ( chromosome . toStringNorm ( 0 ) ) ) ) ; Thread . sleep ( 500 ) ; EvaluateFitness ef = new EvaluateFitness ( ) ; Plan generatedPlan = ef . createPlan ( chromosome , 0 ) ; System . out . println ( ( ( "Our<seq2seq4repair_space>plan:<seq2seq4repair_space>" + ( generatedPlan . planString ( ) ) ) + "\n" ) ) ; <START_BUG> ef . makePrismFileFromChromosome ( chromosome ) ; <END_BUG> System . out . println ( "finished<seq2seq4repair_space>generating<seq2seq4repair_space>files" ) ; ArrayList < ArrayList < CommandGene > > planList = ef . generatePossiblePlanExecutions ( chromosome ) ; for ( int i = 0 ; i < ( planList . size ( ) ) ; i ++ ) { boolean isPlanFeasible = ef . checkPlanFeasibility ( planList . get ( i ) ) ; ArrayList < CommandGene > testPlan = planList . get ( i ) ; System . out . print ( "A<seq2seq4repair_space>plan:<seq2seq4repair_space>" ) ; for ( int j = 0 ; j < ( testPlan . size ( ) ) ; j ++ ) { System . out . print ( ( ( testPlan . get ( j ) . toString ( ) ) + ",<seq2seq4repair_space>" ) ) ; } System . out . print ( "\n" ) ; if ( ! isPlanFeasible ) { System . out . println ( "Plan<seq2seq4repair_space>failed" ) ; System . exit ( 1 ) ; } } System . out . println ( "All<seq2seq4repair_space>plans<seq2seq4repair_space>succeeded" ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } }

Fix:
ef . makePrismFileFromPlan ( generatedPlan , chromosome ) ;