We present a model for describing the spread of an infectious disease with publicscreening measures to control the spread. We want to address the problem of determining anoptimal screening strategy for a disease characterized by appreciable duration of theinfectiveness period and by variability of the transmission risk. The specific disease wehave in mind is the HIV infection. However the model will apply to a disease for whichclass-age structure is significant and should not be disregarded.