Simulation code for the paper “Regulating speculative housing markets via public housing construction programs: Insights from a heterogeneous agent model” by Carolin Martin and Frank Westerhoff, Jahrbücher für Nationalökonomie und Statistik (Journal of Economics and Statistics). The simulation code allows the replication of the basic model dynamics and the computation of the main summary statistics used in our paper. The code rests on Mathematica 11.3.