import java.util.Random;

public class ChromozomeHW {
	
	private char[] chromozome;
	private int fitness;
	private int size;
	
	public ChromozomeHW(int size){
		
		this.size = size;
		this.fitness = 0;
		chromozome = new char[this.size];
		Random rand = new Random();
		
		for (int i=0; i<this.size; i++){
			chromozome[i] = (char) (rand.nextInt(90) + 32);
		}
		
	}
	
	public ChromozomeHW(char[] chromozome, int size){
		
		this.size=size;
		this.chromozome = chromozome;
		this.fitness = 0;
	}
	
	public void printChromozome(){
		System.out.println(this.chromozome);
	}
	
	public int getFitness(){
		return this.fitness;
	}

	public void setFitness(int fitness){
		this.fitness = fitness;
	}
	
	public char[] getGenes(){
		return this.chromozome;
	}
	
	public int getSize(){
		return this.size;
	}
	
	public char getSingleGene(int position){
		return this.chromozome[position];
	}
	
	public void setSingleGene(int position, char gene){
		this.chromozome[position]=gene;
	}
}
