Seismic Vulnerability and Old Towns. A Cost-Based Programming Model