public Quadrivalent(HaploStruct[] haplostruct) throws Exception {
        super();
        boolean ok = haplostruct!=null && haplostruct.length==4 &&
                haplostruct[0]!=null && haplostruct[0].getChrom()!=null;
        for (int h=1; h<4; h++) {
            ok = ok && haplostruct[h]!=null &&
                    haplostruct[0].getChrom().equals(haplostruct[h].getChrom());
        }
        if (!ok) {
            throw new Exception("Error in Quadrivalent constructor parameters");
        }
        this.chrom = haplostruct[0].getChrom();
        this.popdata = chrom.getPopdata();
        this.tools = popdata.tools;
        this.rand = tools.rand;
        this.haplostruct = haplostruct;
    }