  Initially classified as a supernova (SN) type Ib, $\sim$ 100 days after the
explosion SN\,2014C made a transition to a SN type II, presenting a gradual
increase in the H${\alpha}$ emission. This has been interpreted as evidence of
interaction between the supernova shock wave and a massive shell previously
ejected from the progenitor star. In this paper, we present numerical
simulations of the propagation of the SN shock through the progenitor star and
its wind, as well as the interaction of the SN ejecta with the massive shell.
To determine with high precision the structure and location of the shell, we
couple a genetic algorithm to a hydrodynamic and a bremsstrahlung radiation
transfer code. We iteratively modify the density stratification and location of
the shell by minimizing the variance between X-ray observations and synthetic
predictions computed from the numerical model. By assuming spherical symmetry,
we found that the shell has a mass of 2.6 M$_\odot$, extends from 1.6 $\times
10^{16}$ cm to $1.87 \times 10^{17}$ cm, implying that it was ejected $\sim
60/(v_w/100 {\rm \; km \; s^{-1}})$ yrs before the SN explosion, and has a
density stratification decaying as $\sim r^{-3}$. We found that the product of
metallicity by the ionization fraction (due to photo-ionization by the
post-shock X-ray emission) %and/or the SN UV radiation is $\sim$ 0.5. Finally,
we predict that, if the density stratification follows the same power-law
behaviour, the SN will break out from the shell by mid 2022, i.e. 8.5 years
after explosion.
