A short-term scheduler algorithm written in Java