private LinkGene crossoverLinkGenes(LinkGene a, LinkGene b){
        double weightA = a.getWeight();
        double weightB = b.getWeight();

        long weightALong = Double.doubleToRawLongBits(weightA);
        long weightBLong = Double.doubleToRawLongBits(weightB);
        long mask = -1L; // all bits set to 1
        double newWeight;
        do{
            int crossOverPoint = randInt(0, Long.SIZE);
            long combined;
            // treat special cases because of modulo Long.SIZE of second parameter of shifting operations
            if (crossOverPoint == 0) {
                combined = weightBLong;
            } else if (crossOverPoint == Long.SIZE) {
                combined = weightALong;
            } else {
                combined = (weightALong & (mask << (Long.SIZE - crossOverPoint))) |
                        (weightBLong & (mask >>> crossOverPoint));
            }

            newWeight = Double.longBitsToDouble(combined);
        } while(newWeight == Double.NaN || newWeight == Double.POSITIVE_INFINITY || newWeight == Double.NEGATIVE_INFINITY);
        boolean newActivation;
        if(a.isActivated() == b.isActivated()){
            newActivation = a.isActivated();
        }else {
            if(Math.random() > 0.5){
                newActivation = a.isActivated();
            }
            else {
                newActivation = b.isActivated();
            }
        }
        return new LinkGene(a.getStartLayer(),a.getStartNode(),a.getEndNode(),newWeight, newActivation);
    }