Buggy code:
public class ComplicatedPlan { public static void main ( String [ ] args ) { CommandGene [ ] commands = new CommandGene [ 12 ] ; int [ ] depths = new int [ 12 ] ; 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 . DeleteServerL2 ( gpConf ) ; depths [ 2 ] = 2 ; commands [ 3 ] = new actions . IncreaseDatabaseBThreads ( gpConf ) ; depths [ 3 ] = 2 ; commands [ 4 ] = new actions . AddServerL1 ( gpConf ) ; depths [ 4 ] = 2 ; commands [ 5 ] = new org . jgap . gp . function . SubProgram ( gpConf , new Class [ ] { CommandGene . VoidClass , CommandGene . VoidClass } , true ) ; depths [ 5 ] = 1 ; commands [ 6 ] = new actions . IncreaseDatabaseBThreads ( gpConf ) ; depths [ 6 ] = 2 ; commands [ 7 ] = new actions . IncreaseDatabaseBThreads ( gpConf ) ; depths [ 7 ] = 2 ; commands [ 8 ] = new actions . IfSuccessElse ( gpConf ) ; depths [ 8 ] = 1 ; commands [ 9 ] = new actions . DeleteServerL1 ( gpConf ) ; depths [ 9 ] = 2 ; commands [ 10 ] = new actions . IncreaseDatabaseAThreads ( gpConf ) ; depths [ 10 ] = 2 ; commands [ 11 ] = new actions . IncreaseDatabaseBThreads ( gpConf ) ; depths [ 11 ] = 2 ; ProgramChromosome chromosome = new ProgramChromosome ( gpConf , 12 ) ; 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 ) ) ) ) ; EvaluateFitness ef = new EvaluateFitness ( ) ; Plan generatedPlan = ef . createPlan ( chromosome , 0 ) ; System . out . println ( ( "Our<seq2seq4repair_space>plan:<seq2seq4repair_space>" + ( generatedPlan . planString ( ) ) ) ) ; System . out . println ( ( "Copy:<seq2seq4repair_space>" + ( generatedPlan . getStartNode ( ) . deepCopy ( ) . planString ( ) ) ) ) ; <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 ) ;