}
private synchronized boolean canAdvanceSimulationTime(long minstep)
{
long newTime = SystemClock.getWallTime() + minstep;
SimulationManager manager = SimulationManager.getInstance();
if (newTime <= nextSimulationStop || ( manager.isOptimizationEnabled() && SharedStateListner.isAutoIncrementTime() && newTime <manager.getFinishTime()))
{
return true; // OK, just proceed there is still simulation time left
} else
{
// We have reached the allowed simulation time
nextSimulationStop = manager.waitForStep(minstep);
if (newTime <= nextSimulationStop)
{
return true;
} else
{