Ejemplo n.º 1
0
        /// <summary>
        /// Executes the antWorld test/benchmark
        /// </summary>
        /// <param name="n">The number of doAntWorld rounds to execute</param>
        static void AlternativeOne(int n)
        {
            int startTime = Environment.TickCount;

            AntWorld_NoGammel graph = new AntWorld_NoGammel();
            AntWorld_ExtendAtEndOfRound_NoGammelActions actions = new AntWorld_ExtendAtEndOfRound_NoGammelActions(graph);

            Action_InitWorld initWorld = Action_InitWorld.Instance;
            IAnt             firstAnt  = null;

            initWorld.Apply(graph, ref firstAnt);

            int endTime = Environment.TickCount;

            PrintResults(endTime - startTime, graph);

            for (int i = 0; i < n; ++i)
            {
                Action_doAntWorld doAntWorld = Action_doAntWorld.Instance;
                doAntWorld.Apply(graph, firstAnt);

                endTime = Environment.TickCount;
                PrintResults(endTime - startTime, graph);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Executes the antWorld test/benchmark
        /// </summary>
        /// <param name="n">The number of doAntWorld rounds to execute</param>
        static void AlternativeTwo(int n)
        {
            int startTime = Environment.TickCount;

            AntWorld_NoGammel graph = new AntWorld_NoGammel();
            AntWorld_ExtendAtEndOfRound_NoGammelActions actions = new AntWorld_ExtendAtEndOfRound_NoGammelActions(graph);

            Action_InitWorld initWorld = Action_InitWorld.Instance;
            IAnt firstAnt = null;
            initWorld.Apply(graph, ref firstAnt);

            // TODO

            int endTime = Environment.TickCount;

            PrintResults(endTime - startTime, graph);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Executes the antWorld test/benchmark
        /// </summary>
        /// <param name="n">The number of doAntWorld rounds to execute</param>
        static void AlternativeTwo(int n)
        {
            int startTime = Environment.TickCount;

            AntWorld_NoGammel graph = new AntWorld_NoGammel();
            AntWorld_ExtendAtEndOfRound_NoGammelActions actions = new AntWorld_ExtendAtEndOfRound_NoGammelActions(graph);

            Action_InitWorld initWorld = Action_InitWorld.Instance;
            IAnt             firstAnt  = null;

            initWorld.Apply(graph, ref firstAnt);

            // TODO

            int endTime = Environment.TickCount;

            PrintResults(endTime - startTime, graph);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Executes the antWorld test/benchmark
        /// </summary>
        /// <param name="n">The number of doAntWorld rounds to execute</param>
        static void AlternativeOne(int n)
        {
            int startTime = Environment.TickCount;

            AntWorld_NoGammel graph = new AntWorld_NoGammel();
            AntWorld_ExtendAtEndOfRound_NoGammelActions actions = new AntWorld_ExtendAtEndOfRound_NoGammelActions(graph);

            Action_InitWorld initWorld = Action_InitWorld.Instance;
            IAnt firstAnt = null;
            initWorld.Apply(graph, ref firstAnt);

            int endTime = Environment.TickCount;
            PrintResults(endTime - startTime, graph);

            for (int i = 0; i < n; ++i)
            {
                Action_doAntWorld doAntWorld = Action_doAntWorld.Instance;
                doAntWorld.Apply(graph, firstAnt);

                endTime = Environment.TickCount;
                PrintResults(endTime - startTime, graph);
            }
        }