当前位置: 首页>>代码示例>>C#>>正文


C# IEvaluator类代码示例

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


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

示例1: ConfigurationDetails

 public ConfigurationDetails(IPredicate predicate, ISerializationProvider serializationProvider, ISourceDataProvider sourceDataProvider, IEvaluator evaluator)
 {
     _predicate = predicate;
     _serializationProvider = serializationProvider;
     _sourceDataProvider = sourceDataProvider;
     _evaluator = evaluator;
 }
开发者ID:kalpesh0082,项目名称:Unicorn,代码行数:7,代码来源:ConfigurationDetails.cs

示例2: GeneticEngine

        /// <summary>
        /// Initialise a new instance of the GeneticEngine class with the supplied plug-ins and populate the initial generation.
        /// </summary>
        /// <param name="populator">The populator plug-in. Generates the initial population.</param>
        /// <param name="evaluator">The evaluator plug-in. Provides the fitness function.</param>
        /// <param name="geneticOperator">The genetic operator plug-in. Processes one generation to produce the individuals for the next.</param>
        /// <param name="terminator">The terminator plug-in. Provides the termination condition.</param>
        /// <param name="outputter">The outputter plug-in or null for no output. Outputs each generation.</param>
        /// <param name="generationFactory">The generation factory plug-in or null to use the default. Creates the generation container.</param>
        public GeneticEngine(IPopulator populator, IEvaluator evaluator, IGeneticOperator geneticOperator, ITerminator terminator, IOutputter outputter = null, IGenerationFactory generationFactory = null)
        {
            if (populator == null)
            {
                throw new GeneticEngineException("populator must not be null");
            }

            if (evaluator == null)
            {
                throw new GeneticEngineException("pvaluator must not be null");
            }

            if (geneticOperator == null)
            {
                throw new GeneticEngineException("geneticOperator must not be null");
            }

            if (terminator == null)
            {
                throw new GeneticEngineException("terminator must not be null");
            }

            this.populator = populator;
            this.evaluator = evaluator;
            this.geneticOperator = geneticOperator;
            this.terminator = terminator;
            this.outputter = outputter;
            this.generationFactory = generationFactory == null ? new AATreeGenerationFactory() : generationFactory;

            Setup();
        }
开发者ID:thepowersgang,项目名称:cits3200,代码行数:40,代码来源:GeneticEngine.cs

示例3: Verify

        public override void Verify(CommandCall commandCall, IEvaluator evaluator, IResultRecorder resultRecorder)
        {
            CommandCallList childCommands = commandCall.Children;
            childCommands.SetUp(evaluator, resultRecorder);
            childCommands.Execute(evaluator, resultRecorder);
            childCommands.Verify(evaluator, resultRecorder);

            String expression = commandCall.Expression;
            Object result = evaluator.Evaluate(expression);

            if (result != null && result is Boolean)
            {
                if ((Boolean) result)
                {
                    ProcessTrueResult(commandCall, resultRecorder);
                }
                else
                {
                    ProcessFalseResult(commandCall, resultRecorder);
                }
            }
            else
            {
                throw new InvalidExpressionException("Expression '" + expression + "' did not produce a boolean result (needed for assertTrue).");
            }
        }
开发者ID:concordion,项目名称:concordion-net,代码行数:26,代码来源:BooleanCommand.cs

示例4: TaskState

        public TaskState( NBTag tag )
        {
            if( FormatVersion != tag["FormatVersion"].GetInt() ) throw new FormatException( "Incompatible format." );
            Shapes = tag["Shapes"].GetInt();
            Vertices = tag["Vertices"].GetInt();
            ImprovementCounter = tag["ImprovementCounter"].GetInt();
            MutationCounter = tag["MutationCounter"].GetInt();
            TaskStart = DateTime.UtcNow.Subtract( TimeSpan.FromTicks( tag["ElapsedTime"].GetLong() ) );

            ProjectOptions = new ProjectOptions( tag["ProjectOptions"] );

            BestMatch = new DNA( tag["BestMatch"] );
            CurrentMatch = BestMatch;

            Initializer = (IInitializer)ModuleManager.ReadModule( tag["Initializer"] );
            Mutator = (IMutator)ModuleManager.ReadModule( tag["Mutator"] );
            Evaluator = (IEvaluator)ModuleManager.ReadModule( tag["Evaluator"] );

            byte[] imageBytes = tag["ImageData"].GetBytes();
            using( MemoryStream ms = new MemoryStream( imageBytes ) ) {
                OriginalImage = new Bitmap( ms );
            }

            var statsTag = (NBTList)tag["MutationStats"];
            foreach( NBTag stat in statsTag ) {
                MutationType mutationType = (MutationType)Enum.Parse( typeof( MutationType ), stat["Type"].GetString() );
                MutationCounts[mutationType] = stat["Count"].GetInt();
                MutationImprovements[mutationType] = stat["Sum"].GetDouble();
            }
        }
开发者ID:fragmer,项目名称:SuperImageEvolver,代码行数:30,代码来源:TaskState.cs

示例5: ConfigurationDetails

 public ConfigurationDetails(IPredicate predicate, ITargetDataStore serializationStore, ISourceDataStore sourceDataStore, IEvaluator evaluator)
 {
     _predicate = predicate;
     _serializationStore = serializationStore;
     _sourceDataStore = sourceDataStore;
     _evaluator = evaluator;
 }
开发者ID:PetersonDave,项目名称:Unicorn,代码行数:7,代码来源:ConfigurationDetails.cs

示例6: ForNode

 public ForNode(IEvaluator from, string key, string value, INode body, INode empty)
 {
     this.body = body;
     this.empty = empty;
     this.from = from;
     this.key = key;
     this.value = value;
 }
开发者ID:r3c,项目名称:cottle,代码行数:8,代码来源:ForNode.cs

示例7: SimplePlayer

        public SimplePlayer(IMoveFinder moveFinder, IEvaluator evaluator)
        {
            if (moveFinder == null) { throw new ArgumentNullException(nameof(moveFinder)); }

            MoveFinder = moveFinder;
            Evaluator = evaluator;
            _numMovesTried = 0;
        }
开发者ID:sayedihashimi,项目名称:sudoku,代码行数:8,代码来源:SimplePlayer.cs

示例8: ConfigurationDetails

		public ConfigurationDetails(IPredicate predicate, ITargetDataStore serializationStore, ISourceDataStore sourceDataStore, IEvaluator evaluator, ConfigurationDependencyResolver dependencyResolver)
		{
			_predicate = predicate;
			_serializationStore = serializationStore;
			_sourceDataStore = sourceDataStore;
			_evaluator = evaluator;
			_dependencyResolver = dependencyResolver;
		}
开发者ID:hbopuri,项目名称:Unicorn,代码行数:8,代码来源:ConfigurationDetails.cs

示例9: Trainer

 public Trainer(int nb_inputs, int[] nb_neurons_layer, int population_size, IEvaluator evaluator)
 {
     this.population = new List<DNA>();
     for(int i = 0; i < population_size; i++)
     {
         this.population.Add (new DNA(nb_inputs, nb_neurons_layer));
     }
     this.evaluator = evaluator;
 }
开发者ID:Underflow,项目名称:genetik-perceptron,代码行数:9,代码来源:Trainer.cs

示例10: Evaluate

        private static double[] Evaluate(IEvaluator evaluator, Function[] functions)
        {
            List<double> values = new List<double>();
            foreach (Function function in functions)
            {
                values.Add(evaluator.Evaluate(function));
            }

            return values.ToArray();
        }
开发者ID:mortenbakkedal,项目名称:SharpMath,代码行数:10,代码来源:Evaluator.cs

示例11: LtcService

 public LtcService(IEventLogger eventLogger, IUserUnloger userUnloger, IOsUsersReader osUsersReader, IEvaluator evaluator)
 {
     InitializeComponent();
     Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
     _notAdminUserLoggedIn = false;
     _eventLogger = eventLogger;
     _userUnloger = userUnloger;
     _osUsersReader = osUsersReader;
     _evaluator = evaluator;
 }
开发者ID:sarochm,项目名称:ltc,代码行数:10,代码来源:LtcService.cs

示例12: increaseLevel

 private void increaseLevel(IEvaluator evaluator)
 {
     if (evaluator.GetVariable(LEVEL_VARIABLE) == null)
     {
         evaluator.SetVariable(LEVEL_VARIABLE, 1);
     }
     else
     {
         evaluator.SetVariable(LEVEL_VARIABLE, 1 + (int)evaluator.GetVariable(LEVEL_VARIABLE));
     }
 }
开发者ID:concordion,项目名称:concordion-net,代码行数:11,代码来源:ListExecuteStrategy.cs

示例13: Verify

 public override void Verify(CommandCall commandCall, IEvaluator evaluator, IResultRecorder resultRecorder)
 {
     try
     {
         m_command.Verify(commandCall, evaluator, resultRecorder);
     }
     catch (Exception e)
     {
         resultRecorder.Record(Result.Exception);
         AnnounceThrowableCaught(commandCall.Element, e, commandCall.Expression);
     }
 }
开发者ID:john-ross,项目名称:concordion-net,代码行数:12,代码来源:ExceptionCatchingDecorator.cs

示例14: Process

        public void Process(IUrlParser parser, IEvaluator evaluator)
        {
            if (parser == null) throw new ArgumentNullException("parser");
            if (evaluator == null) throw new ArgumentNullException("evaluator");

            var words = parser.Parse(_url);
            var buzzwords = words.Where(evaluator.IsBuzzword);
            foreach (var buzzword in buzzwords)
            {
                ApplyEvent(new BuzzwordFoundEvent(buzzword));
            }
        }
开发者ID:michael-ell,项目名称:Buzz,代码行数:12,代码来源:Feed.cs

示例15: Execute

 public override void Execute(CommandCall commandCall, IEvaluator evaluator, IResultRecorder resultRecorder)
 {
     try
     {
         m_command.Execute(commandCall, evaluator, resultRecorder);
     }
     catch (Exception e)
     {
         resultRecorder.Record(Result.Exception);
         OnExceptionCaught(commandCall.Element, e, commandCall.Expression);
     }
 }
开发者ID:ManiAzizzadeh,项目名称:Concordion.NET,代码行数:12,代码来源:ExceptionCatchingDecorator.cs


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