Exemplo n.º 1
0
        public void makeNewDecision(Base_ACO algorithm, DecisionArchive archive, Random rand, double xi)
        {
            double [] sigma = calcSigma(archive, xi);

            decision = new Decision(algorithm);
            decision.TermOrWeghtClassParams.AddRange(archive[l].TermOrWeghtClassParams);
            for (int j = 0; j < archive[l].TermOrWeghtClassParams.Count; j++)
            {
                decision.TermOrWeghtClassParams[j] = Base_ACO.BoxMullerTransform(sigma[j], decision.TermOrWeghtClassParams[j], rand);
            }
        }
Exemplo n.º 2
0
 public Colony(int antCount, int decisionArchiveCount, int numTerm, Term Term, Base_ACO algorithm)
 {
     for (int i = 0; i < antCount; i++)
     {
         Ant the_Ant = new Ant();
         theAnts.Add(the_Ant);
     }
     theArchive = new DecisionArchive(decisionArchiveCount, algorithm);
     theTerm    = Term;
     parrent    = algorithm;
 }
Exemplo n.º 3
0
        private double[] calcSigma(DecisionArchive archive, double xi)
        {
            double [] sigma = new double [archive[l].TermOrWeghtClassParams.Count];

            for (int j = 0; j < archive[l].TermOrWeghtClassParams.Count; j++)
            {
                sigma[j] = 0;
                for (int i = 0; i < archive.Count; i++)
                {
                    sigma[j] += (Math.Abs(archive[i].TermOrWeghtClassParams[j] - archive[l].TermOrWeghtClassParams[j])) / archive.Count;
                }
                sigma[j] *= xi;
            }
            return(sigma);
        }
Exemplo n.º 4
0
 public void getL(DecisionArchive archive, Random rand)
 {
     double[] propability = archive.Propability;
     l = getOneOfArchive(propability, rand);
 }