simulator.cpp