OnSimulate function

Learn technical details about the OnSimulate function.