Java code for batch processing algorithm-scheduler