Exemplo n.º 1
0
        public static SimulationForm CreateSimulationForm(SimulationPlugin simulationPlugin, string pluginName, ISpaceTemplateFactory spaceTemplateFactory, SimulationModelConfiguration modelConfiguration, int animationInterval)
        {
            var method = typeof(SimulationTemplate).GetMethods(BindingFlags.Static | BindingFlags.Public).Where(m => m.Name == nameof(CreateSimulationForm)).Skip(1).First();

            method = method.MakeGenericMethod(simulationPlugin.GetType(), simulationPlugin.AgentType);
            return(method.Invoke(null, new object[] { simulationPlugin, pluginName, spaceTemplateFactory, modelConfiguration, animationInterval }) as SimulationForm);
        }
Exemplo n.º 2
0
        public static ISimulation CreateSimulation(SimulationPlugin plugin, string pluginName, ISpaceTemplateFactory spaceTemplateFactory, SimulationModelConfiguration modelConfiguration)
        {
            var method = typeof(SimulationTemplate).GetMethods(BindingFlags.Static | BindingFlags.Public).Where(m => m.Name == nameof(CreateSimulation)).Skip(1).First();

            method = method.MakeGenericMethod(plugin.GetType(), plugin.AgentType);
            return(method.Invoke(null, new object[] { plugin, pluginName, spaceTemplateFactory, modelConfiguration }) as ISimulation);
        }