All Downloads are FREE. Search and download functionalities are using the official Maven repository.

umcg.genetica.containers.Chromosome Maven / Gradle / Ivy

There is a newer version: 1.0.7
Show newest version
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package umcg.genetica.containers;

import java.util.ArrayList;
import java.util.HashMap;

/**
 *
 * @author harmjan
 */
public class Chromosome {
    private String name;
    private HashMap geneHash;
    private ArrayList genes;
    
    public Chromosome(String name){
        
        this.name = name;
    }
    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the genes
     */
    public HashMap getGenesHash() {
        return geneHash;
    }

    
    
    /**
     * @param genes the genes to set
     */
    public void setGenes(HashMap genes) {
        this.geneHash = genes;
    }

    public void addGene(Gene currGen) {
        if(geneHash == null){
            genes = new ArrayList();
            geneHash = new HashMap();
        }
        genes.add(currGen);
        geneHash.put(currGen.getName(), currGen);
    }

    public ArrayList getGenes() {
        return genes;
    }

    public void setGenes(ArrayList genes) {
        this.genes = genes;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy