public void run() {

        suspendRequested = false;
        stopRequested = false;
        state = VmState.RUNNING;

        while (!stopRequested) {

            if (activeAnts.size() == 0) {
                state = VmState.STOPPED_BY_SIM;
                break;
            }

            runCurrentAnt();
            regrowFood();

            try {
                if (sleepPerCycle > 0)
                    sleep(sleepPerCycle);

                if (suspendRequested) {
                    state = VmState.SUSPENDED;
                    synchronized (this) {
                        while (suspendRequested && !stopRequested)
                            wait();
                    }
                    state = VmState.RUNNING;
                }

            } catch (InterruptedException e) {
                state = VmState.TERMINATED;
                break;
            }
        }

        if (stopRequested)
            state = VmState.STOPPED_BY_COMMAND;
    }