This page lists some utility functions that may become handy when you need to implement your own simulation.