An optimization model for investment in technology and government regulation