From de8fbbfc635f433dcb729740aebf32f31688bb6b Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Fri, 13 Nov 2020 02:27:54 +0300 Subject: [PATCH] Added logger. Not incomplete. --- src/MakkahCity.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/MakkahCity.java b/src/MakkahCity.java index 98c3a2d..7c7fb45 100644 --- a/src/MakkahCity.java +++ b/src/MakkahCity.java @@ -1,4 +1,8 @@ +import sun.rmi.runtime.Log; + import java.util.*; +import java.util.logging.Level; +import java.util.logging.Logger; public class MakkahCity { @@ -13,13 +17,16 @@ public class MakkahCity { new GregorianCalendar(2020, Calendar.JANUARY, 1, 20, 0, 0) ); - public static void main(String[] args) { + static Logger log = Logger.getLogger("MakkahCity"); + public static void main(String[] args) { + log.setLevel(Level.FINE); + log.info("Starting Hajj-simulation"); //Gen Camp generateCamps(District.ALAZIZIYA, getRandom(70, 100)); generateCamps(District.ALMANSOOR, getRandom(110, 160)); generateCamps(District.ALHIJRA, getRandom(80, 110)); - + log.fine(String.format("Generated %d Campaigns", listOfCampaigns.size())); fillBusesToList(); //Make Streets @@ -51,8 +58,6 @@ public class MakkahCity { && timeManager.getCurrentCalendar().get(Calendar.SECOND) == getRandom(0,59)){ } - System.out.println("v1 "+ v.getCurrentLocation()+ " " + v.getCurrentStreet().getName().name()); - System.out.println("v2 "+ v2.getCurrentLocation()+ " " + v.getCurrentStreet().getName().name()); //TODO: [2]add civil cars in loop iterations. (noise) //noise based on time of day (From PDate) //TODO: [3]Move busses and vehicles. -- 2.39.5