예제 #1
0
 static void Loc(HeurFacade facToRun)
 {
     while (true)
     {
         string start = DateTime.Now.ToUniversalTime().ToString();
         string result = facToRun.GeoLocate().ToString();
         Console.Out.WriteLine(start + " " + result);
     }
 }
예제 #2
0
        static void Main(string[] args)
        {
            // Read serialized networks
            int default_interval = 300;
            //System.Timers.Timer aTimer = new System.Timers.Timer();
            //aTimer = new System.Timers.Timer();
            //aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
            //aTimer.Interval = default_interval;
            HeurFacade fac = new HeurFacade(mutexName, mmfName, iter);
            HeurFacade fac2 = new HeurFacade(mutexName, mmfName, 10);
            fac.RegisterLocation("Casa mia",500);
            fac2.RegisterLocation("Casa mia", 100);
            int i=0;
            float facAvg = 0, fac2Avg = 0, facMin = 1, fac2Min = 1;
            while (i < 1000)
            {
                //Console.Out.WriteLine(i);
                var res = fac.GeoLocate();
                //Console.Out.WriteLine(DateTime.Now.ToUniversalTime());
                var res2 = fac2.GeoLocate();
                facAvg += res;
                fac2Avg += res2;
                if (res < facMin)
                {
                    Console.Out.WriteLine("New Minimum for fac: " + res );
                        facMin = res;
                }

                if (res2 < facMin)
                {
                    Console.Out.WriteLine("New Minimum for fac2: " + res2);
                        facMin = res2;
                }

                //Console.Out.WriteLine("fac: " +fac.GeoLocate());
                //Console.Out.WriteLine(DateTime.Now.ToUniversalTime());
                //Console.Out.WriteLine("fac2: " + fac2.GeoLocate());
                //Console.Out.WriteLine(" " + DateTime.Now.ToShortTimeString() + "\r\n");
                //System.Threading.Thread.Sleep(default_interval);
                i++;
            }
            Console.Out.WriteLine("Fac Result:" + facAvg);
            Console.Out.WriteLine("Fac2 Result:" + fac2Avg);
        }
예제 #3
0
 static void Main(string[] args)
 {
     HeurFacade f = new HeurFacade();
 }