@Override
	public Program mutate(Program program) throws InvalidProgramException {
		if (!(program instanceof ProgramImpl)) {
			throw new InvalidProgramException();
		}
		Random randomGenerator = new Random();
		ProgramImpl program1 = (ProgramImpl) program.clone();
		List<Reaction> reactions = program1.getReactions();
		Double kineticRate = randomGenerator.nextDouble();
		Reaction newReaction = null;
		int attempts = 0;
		do {
			newReaction = new Reaction(ruleRepository.getRandomRule(),
					kineticRate);
			attempts++;
		} while (reactions.contains(newReaction) && attempts < ruleRepository.getNumberOfRules() * 2);
		if (!reactions.contains(newReaction)) {
			program1.addReaction(newReaction);
		}
		return program1;
	}