Ejemplo n.º 1
0
        public void ApiServiceTestWithKey()
        {
            ApiService svc  = new ApiService(APIKEY);
            Ranked     data = svc.Api.GetStatsRanked(summonerId1, region.tr, null, true);

            Assert.IsNotNull(data);
        }
Ejemplo n.º 2
0
        public override string ToString()
        {
            var query =
                $"?{nameof(StreamId).ToLower()}={StreamId}" +
                $"&{nameof(Count).ToLower()}={Count}" +
                $"&{nameof(Ranked).ToLower()}={Ranked.ToString().ToLower()}" +
                $"&{nameof(UnreadOnly).ToLower()}={UnreadOnly.ToString().ToLower()}";

            if (string.IsNullOrEmpty(Continuation))
            {
                return(query);
            }

            return(query + $"&{nameof(Continuation).ToLower()}={Continuation}");
        }
Ejemplo n.º 3
0
        private Ranked <ContextRuleMapping> getRankedMapping(FeatureCover cover, Ranked <Interpretation> rankedInterpretation)
        {
            var ruleDecomposition = createInterpretationDecompositions(rankedInterpretation.Value);
            //assign rule parts to features
            var assignments = new Dictionary <RulePart, FeatureBase>();

            foreach (var rulePart in ruleDecomposition.Parts)
            {
                var bestFeature = getBestFeature(rulePart, cover);
                assignments[rulePart] = bestFeature;
            }

            var rankedMapping = createRankedContextRuleMapping(assignments);

            //rerank with interpretation ranking
            var rerankedMapping = new Ranked <ContextRuleMapping>(rankedMapping.Value, rankedMapping.Rank * rankedInterpretation.Rank);

            return(rerankedMapping);
        }
Ejemplo n.º 4
0
        public Ranked GetStatsRanked(long summonerId, region region, season?season = null, bool useCaching = false)
        {
            Ranked val = Cache.Get <Ranked>(summonerId.ToString(), region.ToString(), season.ToString()); //cache getting

            if (val != null)
            {
                return(val);
            }

            Ranked data = new Summoner()
            {
                Id = summonerId, Region = region
            }
            .GetStatsRanked(season);

            if (useCaching)
            {
                Cache.AddOrUpdate(new cacheObject <Ranked>(new cacheParam <Ranked>(summonerId, region, season), data, new TimeSpan(0, 22, 0)));
            }

            return(data);
        }
Ejemplo n.º 5
0
        private void Awake()
        {
            var roomNameStr = PhotonNetwork.CurrentRoom.Name;

            if (roomNameStr.Contains("Random"))
            {
                roomType   = RoomType.Random;
                randomRoom = gameObject.AddComponent <Random>();
                randomRoom.StartRoom();
            }
            else if (roomNameStr.Contains("Ranked"))
            {
                roomType   = RoomType.Ranked;
                rankedRoom = gameObject.AddComponent <Ranked>();
                rankedRoom.StartRoom();
            }
            else
            {
                roomType    = RoomType.Private;
                privateRoom = gameObject.AddComponent <Private>();
                privateRoom.StartRoom();
            }
        }
Ejemplo n.º 6
0
        public Ranked <NodeReference> GetAnswer(string question)
        {
            string questionSignature;
            IEnumerable <NodeReference> questionEntities;

            extractSignature(question, out questionSignature, out questionEntities);

            var rankedCandidates = new List <Ranked <NodeReference> >();
            var signatures       = findMatchingSignatures(questionSignature).OrderByDescending(s => s.Rank).ToArray();

            foreach (var rankedSignature in signatures)
            {
                /*if (rankedSignature.Value != questionSignature)
                 *  continue;*/
                var originalQuestions = _originalQuestions[rankedSignature.Value].ToArray();
                if (rankedSignature.Rank <= 0.9)
                {
                    continue;
                }


                var answerGroup = GetAnswerGroup(rankedSignature.Value);
                if (answerGroup.Count <= 1)
                {
                    continue;
                }

                var pattern = answerGroup.FindEdgePattern(1, 1000);
                var start   = DateTime.Now;
                var match   = PatternMatchProbability(pattern, questionSignature, questionEntities, _graph);
                Console.WriteLine("GetAnswer {0}s", (DateTime.Now - start).TotalSeconds);

                if (match == null)
                {
                    //pattern does not match
                    continue;
                }

                //find answer candidates (intersect substitution paths)
                var answerGroupCandidates = findCandidates(match);
                //rank them according to answer pattern match

                var rankedGroupCandidates  = rankCandidates(answerGroupCandidates, pattern);
                var orderedGroupCandidates = rankedGroupCandidates.OrderByDescending(c => c.Rank).ToArray();
                var bestGroupCandidate     = orderedGroupCandidates.FirstOrDefault();

                if (bestGroupCandidate == null)
                {
                    continue;
                }

                bestGroupCandidate = new Ranked <NodeReference>(bestGroupCandidate.Value, bestGroupCandidate.Rank * rankedSignature.Rank);

                /*foreach (var substitution in match.SubstitutionPaths)
                 * {
                 *  GoldenAnswer_Batch.DebugInfo(substitution);
                 * }*/
                rankedCandidates.Add(bestGroupCandidate);
            }

            var orderedCandidates = rankedCandidates.OrderByDescending(r => r.Rank).ToArray();
            var bestCandidate     = orderedCandidates.FirstOrDefault();

            return(bestCandidate);
        }
Ejemplo n.º 7
0
 private bool tryImprove(Ranked <ContextRuleMapping> mapping)
 {
     throw new NotImplementedException();
 }