Ejemplo n.º 1
0
        private static void Main(string[] args)
        {
            var env = new ConcurrentEnvironment();

            Utils.AisLying = false;
            var agentA = new BeneficiaryAgent(); env.Add(agentA, "a"); agentA.Start();
            var agentB = new BeneficiaryAgent(); env.Add(agentB, "b"); agentB.Start();
            var agentC = new BeneficiaryAgent(); env.Add(agentC, "c"); agentC.Start();

            Thread.Sleep(100);

            var dmAgent = new DecisionMakerAgent(); env.Add(dmAgent, "dm"); dmAgent.Start();

            env.WaitAll();

            Thread.Sleep(1000);
            Console.WriteLine("\r\n");

            Utils.AisLying = true;
            env.Add(agentA, "a"); agentA.Start();
            env.Add(agentB, "b"); agentB.Start();
            env.Add(agentC, "c"); agentC.Start();

            Thread.Sleep(100);

            env.Add(dmAgent, "dm"); dmAgent.Start();

            env.WaitAll();
        }
Ejemplo n.º 2
0
        private static void Main(string[] args)
        {
            var env = new EnvironmentMas(noTurns: 100, randomOrder: false);

            Settings.AisLying = false;
            var agentA  = new BeneficiaryAgent(); env.Add(agentA, "a");
            var agentB  = new BeneficiaryAgent(); env.Add(agentB, "b");
            var agentC  = new BeneficiaryAgent(); env.Add(agentC, "c");
            var dmAgent = new DecisionMakerAgent(); env.Add(dmAgent, "dm");

            env.Start();

            Console.WriteLine("\r\n--------------------------------------------\r\n");

            env = new EnvironmentMas(noTurns: 100, randomOrder: false);

            Settings.AisLying = true;
            agentA            = new BeneficiaryAgent(); env.Add(agentA, "a");
            agentB            = new BeneficiaryAgent(); env.Add(agentB, "b");
            agentC            = new BeneficiaryAgent(); env.Add(agentC, "c");
            dmAgent           = new DecisionMakerAgent(); env.Add(dmAgent, "dm");

            env.Start();
        }