  Comets are icy objects that orbitally evolve from the trans-Neptunian region
(the Kuiper belt and beyond) into the inner Solar System, where they are heated
by solar radiation and become active due to sublimation of water ice. Here we
perform end-to-end simulations in which cometary reservoirs are formed in the
early Solar System and evolved over 4.5 Gyr. The gravitational effects of
Planet 9 (P9), hypothesized to circle the Sun on a wide orbit, are included in
some of our simulations. Different models are considered for comets to be
active, including a simple assumption that comets remain active for Np(q)
perihelion passages with perihelion distance q<2.5 au. The orbital distribution
and number of active comets produced in our model is compared to observations.
The orbital distribution of ecliptic comets (ECs) is well reproduced in models
with Np(2.5)=500 and without P9. With P9, the inclination distribution of model
ECs is wider than the observed one. We find that the known Halley-type comets
(HTCs) have a nearly isotropic inclination distribution (with only a slight
preference for prograde orbits). In our model, the HTCs appear to be an
extension of the population of returning Oort-cloud comets (OCCs) to shorter
orbital periods. The inclination distribution of model HTCs becomes broader
with increasing Np, but the existing observational data are not good enough to
constrain Np from orbital fits. Np(2.5)>1000 is required to obtain a
steady-state population of large active HTCs that is consistent with
observations. To fit the ratio of the returning-to-new OCCs, by contrast, our
model implies that Np(2.5)<10, possibly because the detected long-period comets
are smaller and much easier to disrupt than observed HTCs.
