A criterion to classify asteroids and comets based on the orbital parameters