• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IGenerator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IGenerator的典型用法代码示例。如果您正苦于以下问题:C# IGenerator类的具体用法?C# IGenerator怎么用?C# IGenerator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IGenerator类属于命名空间,在下文中一共展示了IGenerator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DiscoTask

 public DiscoTask(Settings settings, IGenerator<amBXScene> randomSceneGenerator, NotificationClientBase notificationService, Random random)
 {
     this.settings = settings;
       this.randomSceneGenerator = randomSceneGenerator;
       this.notificationService = notificationService;
       this.random = random;
 }
开发者ID:usmanatron,项目名称:amBXPeripheralController,代码行数:7,代码来源:DiscoTask.cs


示例2: ProcessTree

        private static void ProcessTree(Option<IAbstractSyntaxTree> ast, IGenerator generator)
        {
            if (!ast.Any())
                return;

            generator.Process(ast.Single());
        }
开发者ID:zoran-horvat,项目名称:parsing-demos,代码行数:7,代码来源:Program.cs


示例3: VertexSourceAdapter

 public VertexSourceAdapter(IVertexSource vertexSource, IGenerator generator)
 {
     markers = new null_markers();
     this.VertexSource = vertexSource;
     this.generator = generator;
     m_status = status.initial;
 }
开发者ID:jeske,项目名称:agg-sharp,代码行数:7,代码来源:VertexSourceAdapter.cs


示例4: Learn

        /// <summary>
        /// Trains a single model based on a generator
        /// a predefined number of times with the provided
        /// examples and data split and selects the best 
        /// (or most accurate) model
        /// </summary>
        /// <param name="examples">Source data</param>
        /// <param name="trainingPercentage">Data split percentage</param>
        /// <param name="repeat">Number of repetitions per generator</param>
        /// <param name="generator">Model generator used</param>
        /// <returns>Best model for provided generator</returns>
        public static LearningModel Learn(IEnumerable<object> examples, double trainingPercentage, int repeat, IGenerator generator)
        {
            var total = examples.Count();
            var descriptor = generator.Descriptor;
            var data = descriptor.Convert(examples).ToExamples();

            Matrix x = data.Item1;
            Vector y = data.Item2;

            var models = new IModel[repeat];
            var accuracy = Vector.Zeros(repeat);

            // run in parallel since they all have
            // read-only references to the data model
            // and update indices independently
            Parallel.For(0, models.Length, i =>
            {
                var t = GenerateModel(generator, x, y, examples, trainingPercentage);
                models[i] = t.Model;
                accuracy[i] = t.Accuracy;
            });

            var idx = accuracy.MaxIndex();

            return new LearningModel { Generator = generator, Model = models[idx], Accuracy = accuracy[idx] };
        }
开发者ID:budbjames,项目名称:numl,代码行数:37,代码来源:Learner.cs


示例5: GenerateWithWatch

        private static void GenerateWithWatch(IGenerator g)
        {
            Console.ForegroundColor = ConsoleColor.White;
            Console.Write("\r\n{0}: ", g);
            Console.ResetColor();
            Console.Write("Working...\r\n");

            List<string> result = null;
            var sw = new Stopwatch();
            var total = 0L;
            for (int i = 0;i < _loop;i++)
            {
                sw.Reset();
                sw.Start();
                result = g.Generate(DIC, _len);
                sw.Stop();
                total += sw.ElapsedMilliseconds;
                if (i <= 10)
                {
                    Console.WriteLine("\tGot {0} items in {1,7}ms", result.Count, sw.ElapsedMilliseconds);
                    if (i == 10 && _loop > 10)
                    {
                        Console.WriteLine("\t......");
                    }
                }
            }
            Console.WriteLine("\tGenerate finished for {2} times in {0,7}ms, {1,7}ms for each time.", total, total / _loop, _loop);
            if (result != null)
            {
                PrintTheResult(result);
            }
        }
开发者ID:uonun,项目名称:Whois,代码行数:32,代码来源:Program.cs


示例6: HelloWorldController

        public HelloWorldController(IGenerator generator)
        {
            if (generator == null)
                throw new ArgumentNullException("generator");

            _Generator = generator;
        }
开发者ID:ZeroSharp,项目名称:RoslynPlugins,代码行数:7,代码来源:HelloWorldController.cs


示例7: Main

        public static void Main(string[] args)
        {
            var targetDirectory = Path.GetFullPath(args.Length > 0 ? args[0] : ".");
            var outputDirectory = Path.GetFullPath(args.Length > 1 ? args[1] : ".");
            var options = args.Length > 2 ? args[2] : "";

            if (!Directory.Exists(targetDirectory))
                return;

            if (!Directory.Exists(outputDirectory))
                MiscUtil.CreateDirectory(outputDirectory);

            var generators = new IGenerator[]
                {
                    new MessageCodeGenerator(outputDirectory, options),
                    new DataCodeGenerator(outputDirectory),
                    new AttributeCodeGenerator(outputDirectory)
                };

            var targetFiles = Directory.GetFiles(targetDirectory, "*.xml", SearchOption.AllDirectories);
            Parallel.ForEach(targetFiles, eachFile =>
                {
                    var document = new XmlDocument();
                    document.Load(eachFile);

                    Parallel.ForEach(generators, e => e.Load(eachFile, document));
                });

            Parallel.ForEach(generators, e => e.Generate());
        }
开发者ID:ktj007,项目名称:mmo,代码行数:30,代码来源:Program.cs


示例8: Field

 public Field(IGenerator generator)
 {
     _generator = generator;
     _generator.Generate(this);
     if (_tiles == null || _types == null)
         throw new Exception("Generator failed. Tiles or TileTypes missing!");
 }
开发者ID:cry-inc,项目名称:mahjong,代码行数:7,代码来源:Field.cs


示例9: ConverterAdaptorVcgen

 ///<summary>
 ///</summary>
 ///<param name="source"></param>
 ///<param name="generator"></param>
 public ConverterAdaptorVcgen(IVertexSource source, IGenerator generator)
 {
     _markers = new NullMarkers();
     _source = source;
     _generator = generator;
     _status = EStatus.Initial;
 }
开发者ID:GeroL,项目名称:MOSA-Project,代码行数:11,代码来源:VcGenConverterAdaptor.cs


示例10: PerformSampling

 public void PerformSampling(string name, IGenerator layer)
 {
     PerformSamplingIndividual(name, layer, 5, 0);
     PerformSamplingIndividual(name, layer, 5, 100);
     PerformSamplingIndividual(name, layer, 5, 10000);
     PerformSamplingIndividual(name, layer, 5, 10000000);
 }
开发者ID:TreeSeed,项目名称:Tychaia,代码行数:7,代码来源:ContinuityTests.cs


示例11: Setup

		public void Setup()
		{
			ccu = new CodeCompileUnit();
			mocks = new MockRepository();
			engine = Engine.GlobalEngine;
			engine.BinPath = @"C:\Program Files (x86)\MSBuild";
			project = new Project();
			buildEngine = mocks.DynamicMock<MockBuildEngine>(project);

			logger = new NullLogger();
			parserService = mocks.DynamicMock<ISiteTreeGeneratorService>();
			naming = mocks.DynamicMock<INamingService>();
			sourceStorage = mocks.DynamicMock<IParsedSourceStorageService>();
			source = mocks.DynamicMock<ISourceGenerator>();
			typeResolver = mocks.DynamicMock<ITypeResolver>();
			treeService = mocks.DynamicMock<ITreeCreationService>();
			viewSourceMapper = mocks.DynamicMock<IViewSourceMapper>();
			generator = mocks.DynamicMock<IGenerator>();

			task = new GenerateMonoRailSiteTreeTask(logger, parserService, naming, source, sourceStorage, typeResolver,
			                                         treeService, viewSourceMapper, generator);

			item = mocks.DynamicMock<ITaskItem>();
			parsedSource = mocks.DynamicMock<IParser>();
		}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:25,代码来源:GenerateMonoRailSiteTreeTaskTests.cs


示例12: Emit

 public void Emit(IGenerator codeEmittor)
 {
     foreach(var i in _instructions)
     {
         i.Emit(codeEmittor);
     }
 }
开发者ID:michaelgwelch,项目名称:brainmess,代码行数:7,代码来源:InstructionContainer.cs


示例13: BuildBuffers

        private void BuildBuffers(IGenerator generator)
        {
            List<MyOwnVertexFormat> vertices = new List<MyOwnVertexFormat>();

            for (int x = 0; x < sideSize; x++)
            {
                for (int z = 0; z < sideSize; z++)
                {

                    for (int y = 0; y < sideSize; y++)
                    {
                        double sample = generator.Sample(new Vector3(x, y, z) + location);
                        if ( sample > 0.6f)
                        {
                            CreateVertices(vertices, x, y, z, new Color((float)sample, (float)sample, (float)sample));
                        }

                    }
                }
            }

            if(vertices.Count > 0)
            {
                vertexBuffer = new VertexBuffer(device, MyOwnVertexFormat.VertexDeclaration, vertices.Count, BufferUsage.WriteOnly);
                vertexBuffer.SetData(vertices.ToArray());
            }

            numVertices = vertices.Count;
        }
开发者ID:nordsoyv,项目名称:GraphicsFun,代码行数:29,代码来源:GeneratingLeafNode.cs


示例14: Generator

 /// <summary>
 /// Initializes a new instance of a Generator.
 /// </summary>
 /// <param name="generator">The text generator to wrap.</param>
 internal Generator(IGenerator generator)
 {
     _generator = generator;
     _foundHandlers = new List<EventHandler<KeyFoundEventArgs>>();
     _notFoundHandlers = new List<EventHandler<KeyNotFoundEventArgs>>();
     _valueRequestedHandlers = new List<EventHandler<ValueRequestEventArgs>>();
 }
开发者ID:sheigl,项目名称:mustache-sharp,代码行数:11,代码来源:Generator.cs


示例15: Toolchain

 public Toolchain(string name, IGenerator generator, IBuilder builder, IExecutor executor)
 {
     Name = name;
     Generator = generator;
     Builder = builder;
     Executor = executor;
 }
开发者ID:omariom,项目名称:BenchmarkDotNet,代码行数:7,代码来源:Toolchain.cs


示例16: GenerateSettingsWizard

		public GenerateSettingsWizard(IGenerator generator, List<Type> generatorTypeList)
			: this()
		{
			//Only show this the first time if never generated
			var cacheFile = new ModelCacheFile(generator);
			if (cacheFile.FileExists())
			{
				this.DialogResult = DialogResult.Cancel;
				this.IsValid = false;
				return;
			}

			_generatorTypeList = generatorTypeList;

			//Load all wizard files
			var xmlFileList = Directory.GetFiles(AddinAppData.Instance.ExtensionDirectory, "genwizard.*.xml");
			foreach (var fileName in xmlFileList)
			{
				this.LoadWizardFile(fileName);
			}

			if (cboItem.Items.Count == 0)
			{
				this.DialogResult = DialogResult.Cancel;
				this.IsValid = false;
				return;
			}

			cboItem.SelectedIndex = 0;

		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:31,代码来源:GenerateSettingsWizard.cs


示例17: Import

 public Import(ILocalhost localhost, IGenerator generator)
 {
     this.localhost = localhost;
     this.generator = generator;
     mapper = new Mapper<Key, Key>();
     interactions = new List<Interaction>();
 }
开发者ID:raysearchlabs,项目名称:spark,代码行数:7,代码来源:Import.cs


示例18: GeneratingLeafNode

 public GeneratingLeafNode(GraphicsDevice device, IGenerator generator, Vector3 pos, int size)
 {
     this.device = device;
     location = pos;
     sideSize = size;
     boundingBoxes = new List<BoundingBox>();
     BuildBuffers(generator);
 }
开发者ID:nordsoyv,项目名称:GraphicsFun,代码行数:8,代码来源:GeneratingLeafNode.cs


示例19: Display

 public void Display(IGenerator generator)
 {
     textBox1.Text = string.Empty;
         foreach (object o in generator.Get())
         {
             textBox1.Text += o + Environment.NewLine;
         }
 }
开发者ID:BenHall,项目名称:ExtendViaMEF,代码行数:8,代码来源:UserControl1.cs


示例20: ConvAdaptorVcgen

 public ConvAdaptorVcgen(IVertexSource source, IGenerator generator)
 {
     this.markers = null;
     // TODO NullMarkers();
     this.source = source;
     this.generator = generator;
     this.status = Status.Initial;
 }
开发者ID:Kintaro,项目名称:Pictor,代码行数:8,代码来源:ConvAdaptorVcgen.cs



注:本文中的IGenerator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IGenericAttributeService类代码示例发布时间:2022-05-24
下一篇:
C# IGatewayProviderService类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap