Esempio n. 1
0
        public override void Update(Simulation simulation)
        {
            base.Update(simulation);
            Links(simulation.GetLinks());
            if (nodes == null)
            {
                return;
            }
            count = new double[nodes.Length];
            for (int i = 0; i < links.Length; i++)
            {
                LinkInfo link = links[i];
                link.index              = i;
                count[link.from.index] += 1;
                count[link.to.index]   += 1;
            }

            bias = new double[links.Length];
            for (int i = 0; i < links.Length; i++)
            {
                LinkInfo link = links[i];
                bias[i] = count[link.from.index] / (count[link.from.index] + count[link.to.index]);
            }

            strengths = new double[links.Length];
            InitializeStrength();

            distances = new double[links.Length];
            InitializeDistance();
        }
Esempio n. 2
0
 public override void Init(Simulation simulation)
 {
     base.Init(simulation);
     Links(simulation.GetLinks());
     Update(simulation);
 }