public OpenLoop copy(){
        if(this==null){
            return null;
        }
        else{
            OpenLoop bb = new OpenLoop();
            this.copyBBvariables(bb);

            bb.nBoxes = this.nBoxes;
            bb.nSeg = this.nSeg;
            bb.checkPath = this.checkPath;
            bb.checkNoMix = this.checkNoMix;
            bb.checkConsolidate = this.checkConsolidate;
            if(this.openPath.size()==0){
                bb.openPath = new ArrayList<BlackBox>();
            }
            else{
                for(int i=0; i<openPath.size(); i++)bb.openPath.add((this.openPath.get(i)).copy());
            }
            if(this.segments.size()==0){
                bb.segments = new ArrayList<Object>();
            }
            else{
                int j=0;
                for(int i=0; i<this.nSeg; i++){
                    Integer holdI1 = (Integer)this.segments.get(j);
                    int ii = holdI1.intValue();
                    bb.segments.add(new Integer(ii));
                    j++;
                    Integer holdI2 = (Integer)this.segments.get(j);
                    ii = holdI2.intValue();
                    bb.segments.add(new Integer(ii));
                    j++;
                    String holdS = (String)this.segments.get(j);
                    bb.segments.add(holdS);
                    j++;
                    bb.segments.add(((BlackBox)this.segments.get(j)).copy());
                    j++;
                }
            }

            return bb;
        }
    }