CPD Results

The following document contains the results of PMD's CPD 4.2.5.

Duplications

FileLine
SteeringStuff\SteeringTools.java24
SteeringStuff\SteeringTools.java59
        dA.normalize();
        dB.normalize();
        if (!dA.equals(dB)) {
            if (dA.x == 0) dA.x = 0.001;
            if (dB.x == 0) dB.x = 0.001;
            if (dA.y == 0) dA.y = 0.001;
            if (dB.y == 0) dB.y = 0.001;
            double tB = ( (sA.y - sB.y) / dB.y ) + ( ( dA.y * (sB.x - sA.x) ) / (dA.x * dB.y) );
            tB = tB / (1 - ((dB.x * dA.y)/(dA.x * dB.y)) );
            double tA = ( sB.x - sA.x + (tB*dB.x) );
            tA = tA / dA.x;
            double pointX = sA.x + tA * dA.x;
            double pointY = sA.y + tA * dA.y;
FileLine
Steerings\WallFollowingSteer.java388
Steerings\WallFollowingSteer.java408
            normal = nrightfront.getHitNormal();
            multiplier = Math.pow(1 - (longSideFrontRayLength - botToHitLocation.length()) / longSideFrontRayLength, orderOfTheForce);
            normal.scale(attractiveForceWeight * multiplier * wallForce);
            nextVelocity.sub((Tuple3d) normal);
            //if (SteeringManager.DEBUG) System.out.println("right-front to "+normal.length());

            //When closer, the bot is pushed away from the wall by another force.
            if (botToHitLocation.length() < shortSideFrontRayLength) {
                shortrays = true;
                multiplier = Math.pow(((shortSideFrontRayLength - botToHitLocation.length()) * 2f / shortSideFrontRayLength), orderOfTheForce);
                normal.normalize();
                normal.scale(repulsiveForceWeight * multiplier * wallForce);
                nextVelocity.add((Tuple3d) normal);
                //if (SteeringManager.DEBUG) System.out.println("right-front from "+normal.length());
            }
        }
        if (sensornFront) {
FileLine
Steerings\WallFollowingSteer.java349
Steerings\WallFollowingSteer.java369
            normal = nright.getHitNormal();
            multiplier = Math.pow(1 - (longSideRayLength - botToHitLocation.length()) / longSideRayLength, orderOfTheForce);
            normal.scale(attractiveForceWeight * multiplier * wallForce);
            nextVelocity.sub((Tuple3d) normal);
            //if (SteeringManager.DEBUG) System.out.println("right to "+normal.length());

            //When closer, the bot is pushed away from the wall by another force.
            if (botToHitLocation.length() < shortSideRayLength) {
                shortrays = true;
                multiplier = Math.pow(((shortSideRayLength - botToHitLocation.length()) * 2f / shortSideRayLength), orderOfTheForce);
                normal.normalize();
                normal.scale(repulsiveForceWeight * multiplier * wallForce);
                nextVelocity.add((Tuple3d) normal);
                //if (SteeringManager.DEBUG) System.out.println("right from "+normal.length());
            }
        }
        if (sensornLeftFront) {
FileLine
SteeringProperties\WallFollowingProperties.java192
Steerings\WallFollowingSteer.java592
        this.orderOfTheForce = ((WallFollowingProperties)newProperties).getOrderOfTheForce();
        this.attractiveForceWeight = ((WallFollowingProperties)newProperties).getAttractiveForceWeight();
        this.repulsiveForceWeight = ((WallFollowingProperties)newProperties).getRepulsiveForceWeight();
        this.concaveEdgesForceWeight = ((WallFollowingProperties)newProperties).getConcaveEdgesForceWeight();
        this.convexEdgesForceWeight = ((WallFollowingProperties)newProperties).getConvexEdgesForceWeight();
        this.justMySide = ((WallFollowingProperties)newProperties).isJustMySide();
        this.specialDetection = ((WallFollowingProperties)newProperties).isSpecialDetection();
        this.frontCollisions = ((WallFollowingProperties)newProperties).isFrontCollisions();
    }

    public WallFollowingProperties getProperties() {
FileLine
SteeringProperties\LeaderFollowingProperties.java247
Steerings\LeaderFollowingSteer.java342
        this.distanceFromTheLeader = ((LeaderFollowingProperties)newProperties).getDistanceFromTheLeader();
        this.forceDistance = ((LeaderFollowingProperties)newProperties).getForceDistance();
        this.myLFtype = ((LeaderFollowingProperties)newProperties).getMyLFtype();
        this.deceleration = ((LeaderFollowingProperties)newProperties).isDeceleration();
        this.angleFromTheLeader = ((LeaderFollowingProperties)newProperties).getAngleFromTheLeader();
        this.velocityMemory = ((LeaderFollowingProperties)newProperties).isVelocityMemory();
        this.sizeOfMemory = ((LeaderFollowingProperties)newProperties).getSizeOfMemory();
        this.circumvention = ((LeaderFollowingProperties)newProperties).isCircumvention();