Пример #1
0
    public static void Main(string[] args)
    {
        if (args != null && System.Linq.Enumerable.Any(args, s => s.Equals("-l")))
        {
            Mars.Common.Logging.LoggerFactory.SetLogLevel(Mars.Common.Logging.Enums.LogLevel.Info);
            Mars.Common.Logging.LoggerFactory.ActivateConsoleLogging();
        }
        var description = new Mars.Core.ModelContainer.Entities.ModelDescription();

        description.AddLayer <rugby_sim.Grassland>();
        description.AddAgent <rugby_sim.AllBlack, rugby_sim.Grassland>();
        description.AddAgent <rugby_sim.Wallaby, rugby_sim.Grassland>();
        var task        = Mars.Core.SimulationStarter.SimulationStarter.Start(description, args);
        var loopResults = task.Run();

        System.Console.WriteLine($"Simulation execution finished after {loopResults.Iterations} steps");
    }
Пример #2
0
    public static void Main(string[] args)
    {
        if (args != null && System.Linq.Enumerable.Any(args, s => s.Equals("-l")))
        {
            Mars.Common.Logging.LoggerFactory.SetLogLevel(Mars.Common.Logging.Enums.LogLevel.Info);
            Mars.Common.Logging.LoggerFactory.ActivateConsoleLogging();
        }
        var description = new Mars.Core.ModelContainer.Entities.ModelDescription();

        description.AddLayer <MyVirusSpreading.City>();
        description.AddLayer <VirusSpreading.City>();
        description.AddLayer <corona.city>();
        description.AddAgent <MyVirusSpreading.Human, MyVirusSpreading.City>();
        description.AddAgent <VirusSpreading.Human, VirusSpreading.City>();
        description.AddAgent <corona.Human, corona.city>();
        var task        = Mars.Core.SimulationStarter.SimulationStarter.Start(description, args);
        var loopResults = task.Run();

        System.Console.WriteLine($"Simulation execution finished after {loopResults.Iterations} steps");
    }
    public static void Main(string[] args)
    {
        if (args != null && System.Linq.Enumerable.Any(args, s => s.Equals("-l")))
        {
            Mars.Common.Logging.LoggerFactory.SetLogLevel(Mars.Common.Logging.Enums.LogLevel.Info);
            Mars.Common.Logging.LoggerFactory.ActivateConsoleLogging();
        }
        var description = new Mars.Core.ModelContainer.Entities.ModelDescription();

        description.AddLayer <cessna_digital_twin.AgentLayer>();
        description.AddAgent <cessna_digital_twin.AirTrafficController, cessna_digital_twin.AgentLayer>();
        description.AddAgent <cessna_digital_twin.Aircraft, cessna_digital_twin.AgentLayer>();
        description.AddAgent <cessna_digital_twin.Observer, cessna_digital_twin.AgentLayer>();
        description.AddAgent <cessna_digital_twin.Pilot, cessna_digital_twin.AgentLayer>();
        description.AddAgent <cessna_digital_twin.Weather, cessna_digital_twin.AgentLayer>();
        var task        = Mars.Core.SimulationStarter.SimulationStarter.Start(description, args);
        var loopResults = task.Run();

        System.Console.WriteLine($"Simulation execution finished after {loopResults.Iterations} steps");
    }