示例#1
0
        private int GetWeight(Edge claimEdge, Punter punter, PunterConnectedComponents punterConnectedComponents)
        {
            if (punterConnectedComponents.IsInSameComponent(claimEdge.Source.Id, claimEdge.Target.Id, punter.Id))
            {
                return(0);
            }

            claimEdge.Punter = punter;

            var leftComponent  = punterConnectedComponents.GetComponent(punter.Id, claimEdge.Source.Id);
            var rightComponent = punterConnectedComponents.GetComponent(punter.Id, claimEdge.Target.Id);

            var scoreDelta = scorer.ScoreForUnitingComponents(leftComponent, rightComponent);

            claimEdge.Punter = null;
            return(scoreDelta);
        }
        private int GetWeight(Edge claimEdge, Punter punter, PunterConnectedComponents punterConnectedComponents)
        {
            if (punterConnectedComponents.IsInSameComponent(claimEdge.Source.Id, claimEdge.Target.Id, punter.Id))
            {
                return(0);
            }

            claimEdge.Punter = punter;

            var leftComponent  = punterConnectedComponents.GetComponent(punter.Id, claimEdge.Source.Id);
            var rightComponent = punterConnectedComponents.GetComponent(punter.Id, claimEdge.Target.Id);

            var scalingFactor = Math.Max(10, maxScore / 100);
            var scoreDelta    = (scorer.ScoreForUnitingComponents(leftComponent, rightComponent) + scalingFactor - 1) /
                                scalingFactor;

            claimEdge.Punter = null;
            return(scoreDelta);
        }