assert(environment!=null);
if (environmentSingleton==null) {
environmentSingleton = environment;
uiSingleton = gui;
if (gui!=null) environment.addEnvironmentListener(gui);
Kernel k = Kernels.create(new SimulationScheduler(environment, waitDuration));
k.addKernelListener(new KernelAdapter(){
/**
* {@inheritDoc}
*/
@SuppressWarnings("synthetic-access")
@Override