private float interactionForceGoal(float desiredDistance, float distance,
            objectType object)
    {
        //Attractive force acting on robot
        float attractive;
        //Repulsive force acting on the robot
        float repulsive;
        //Net force acting on robot
        float force;

        switch (object)
        {
            case OBSTACLE: repulsive =
                        (float) (c * Math.pow(desiredDistance, 6) / Math.pow(
                                distance, 7));
                attractive = 0;
                break;
            case ROBOT: repulsive =
                        (float) (c * Math.pow(desiredDistance, 6) / Math.pow(
                                distance, 7));
                attractive = 0;
                break;
            case GOAL: attractive = (float) (2 * d * Math.pow(desiredDistance,
                        12) / Math.pow(distance, 13));
                repulsive = 0;
                break;
            default: attractive = repulsive = 0;
        }

        force = 24 * epsilon * (attractive - repulsive);
        if (force > FMAX)
        {
            force = FMAX;
        }
        if (force < -FMAX)
        {
            force = -FMAX;
        }

        return force;
    }
}

enum objectType
{

    OBSTACLE(1), ROBOT(2), GOAL(3);

    private final int value;

    objectType(int value)
    {
        this.value = value;
    }