コード例 #1
0
        private Task PostOperationActionAsync(PollinatorsGroup group, Pollinator currentPollinator,
                                              Pollinator newPollinator)
        {
            var ruleArgument = new ResetPollinationRuleArgument(group, newPollinator);

            return(_resetPollinationRule.ApplyRuleAsync(currentPollinator, ruleArgument));
        }
コード例 #2
0
        private Task <Pollinator> LocalPollinationAsync(PollinatorsGroup group, Pollinator pollinator)
        {
            var randomPollinator = group.ElementAt(RandomGenerator.Random.Next() % group.Count());

            var ruleArgument = new LocalPollinationRuleArgument(randomPollinator);

            return(_localPollinationRule.ApplyRuleAsync(pollinator, ruleArgument));
        }
コード例 #3
0
        private Task <Pollinator> GlobalPollinationAsync(PollinatorsGroup group, Pollinator pollinator)
        {
            var bestPollinator = group.GetBestSolution(_functionStrategy, _algorithmSettings.IsMin);

            var ruleArgument = new GlobalPollinationRuleArgument(bestPollinator);

            return(_globalPollinationRule.ApplyRuleAsync(pollinator, ruleArgument));
        }